[PATCH 1/8] drm: execution context for GEM buffers v2

2022-05-04 Thread Christian König
This adds the infrastructure for an execution context for GEM buffers which is similar to the existinc TTMs execbuf util and intended to replace it in the long term. The basic functionality is that we abstracts the necessary loop to lock many different GEM buffers with automated deadlock and dupli

[RFC] Common DRM execution context v2

2022-05-04 Thread Christian König
Hello everyone, compared to the earlier version this has seen quite a bit of additional testing and can now handle both amdgpu as well as radeon without any performance drop. QXL is converted over as well and then the remaining ttm_execbuf_util implementation moved into VMWGFX which is the only r

[PATCH 1/8] drm: execution context for GEM buffers v2

2022-05-04 Thread Christian König
This adds the infrastructure for an execution context for GEM buffers which is similar to the existinc TTMs execbuf util and intended to replace it in the long term. The basic functionality is that we abstracts the necessary loop to lock many different GEM buffers with automated deadlock and dupli

[PATCH 2/8] drm: add drm_exec selftests

2022-05-04 Thread Christian König
Largely just the initial skeleton. Signed-off-by: Christian König --- drivers/gpu/drm/selftests/Makefile| 2 +- .../gpu/drm/selftests/drm_exec_selftests.h| 10 +++ drivers/gpu/drm/selftests/test-drm_exec.c | 74 +++ 3 files changed, 85 insertions(+), 1 deleti

[PATCH 3/8] drm/amdkfd: switch over to using drm_exec

2022-05-04 Thread Christian König
Avoids quite a bit of logic and kmalloc overhead. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 5 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 303 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c| 14 + drivers/gpu/drm/amd/amdgpu/a

[PATCH 6/8] drm/radeon: switch over to drm_exec

2022-05-04 Thread Christian König
Just a straightforward conversion without any optimization. Signed-off-by: Christian König --- drivers/gpu/drm/radeon/radeon.h| 7 ++-- drivers/gpu/drm/radeon/radeon_cs.c | 45 +- drivers/gpu/drm/radeon/radeon_gem.c| 40 +-- drivers/gp

[PATCH 4/8] drm/amdgpu: use drm_exec for GEM and CSA handling

2022-05-04 Thread Christian König
Start using the new component here as well. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 42 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 77 +++-- 2 files changed, 53 insertions(+), 66 deletions(-) diff --git a/drivers/gpu/drm/amd

[PATCH 5/8] drm/amdgpu: use the new drm_exec object for CS

2022-05-04 Thread Christian König
Use the new component here as well and remove the old handling. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 70 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h | 7 +- drivers/gpu/drm/amd/amdgpu/amdgp

[PATCH 7/8] drm/qxl: switch to using drm_exec

2022-05-04 Thread Christian König
Just a straightforward conversion without any optimization. Only compile tested for now. Signed-off-by: Christian König --- drivers/gpu/drm/qxl/qxl_drv.h | 7 ++-- drivers/gpu/drm/qxl/qxl_release.c | 67 --- 2 files changed, 38 insertions(+), 36 deletions(-) di

[PATCH 8/8] drm: move ttm_execbuf_util into vmwgfx

2022-05-04 Thread Christian König
VMWGFX is the only remaining user of this and should probably moved over to drm_exec when it starts using GEM as well. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/Makefile | 4 ++-- drivers/gpu/drm/vmwgfx/Makefile | 2 +-

[PATCH 1/3] drm/amdgpu/vcn: add common vcn sofware ring decode

2022-05-04 Thread James Zhu
Add common vcn sofware ring decode. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/Makefile | 1 + drivers/gpu/drm/amd/amdgpu/vcn_sw_ring.c | 85 drivers/gpu/drm/amd/amdgpu/vcn_sw_ring.h | 39 +++ 3 files changed, 125 insertions(+) create mode 100

[PATCH 3/3] drm/amdgpu/vcn4: replace ip based software ring decode with common vcn software ring decode

2022-05-04 Thread James Zhu
Replace ip based software ring decode with common vcn software ring decode. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd

[PATCH 2/3] drm/amdgpu/vcn3: replace ip based software ring decode with common vcn software ring decode

2022-05-04 Thread James Zhu
Replace ip based software ring decode with common vcn software ring decode. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 82 --- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.h | 12 2 files changed, 11 insertions(+), 83 deletions(-) diff --git a/drive

[PATCH 2/2] Revert "fbdev: fbmem: add a helper to determine if an aperture is used by a fw fb"

2022-05-04 Thread Alex Deucher
This reverts commit 9a45ac2320d0a6ae01880a30d4b86025fce4061b. This was added a helper for amdgpu to workaround a runtime pm regression caused by a runtime pm fix in efifb. We now have a better workarouund in amdgpu in commit f95af4a9236695 ("drm/amdgpu: don't runtime suspend if there are displays

[PATCH 1/2] Revert "drm/amdgpu: disable runpm if we are the primary adapter"

2022-05-04 Thread Alex Deucher
This reverts commit b95dc06af3e683d6b7ddbbae178b2b2a21ee8b2b. This workaround is no longer necessary. We have a better workaround in commit f95af4a9236695 ("drm/amdgpu: don't runtime suspend if there are displays attached (v3)"). Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdg

[PATCH 1/2] Revert "drm/amdgpu: disable runpm if we are the primary adapter"

2022-05-04 Thread Alex Deucher
This reverts commit b95dc06af3e683d6b7ddbbae178b2b2a21ee8b2b. This workaround is no longer necessary. We have a better workaround in commit f95af4a9236695 ("drm/amdgpu: don't runtime suspend if there are displays attached (v3)"). Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdg

[PATCH 2/2] Revert "fbdev: fbmem: add a helper to determine if an aperture is used by a fw fb"

2022-05-04 Thread Alex Deucher
This reverts commit 9a45ac2320d0a6ae01880a30d4b86025fce4061b. This was added a helper for amdgpu to workaround a runtime pm regression caused by a runtime pm fix in efifb. We now have a better workarouund in amdgpu in commit f95af4a9236695 ("drm/amdgpu: don't runtime suspend if there are displays

Re: [PATCH 2/3] drm/amdgpu/vcn3: replace ip based software ring decode with common vcn software ring decode

2022-05-04 Thread Christian König
Am 04.05.22 um 15:23 schrieb James Zhu: Replace ip based software ring decode with common vcn software ring decode. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 82 --- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.h | 12 2 files changed, 11 inser

[PATCH] drm/amdgpu/psp: Return failure when firmware failed to load in SRIOV

2022-05-04 Thread Alice Wong
In SRIOV, PSP will block incompatible firmware from loading. When this happens, driver should be prevented from continue initialization and start cleanup. Return failure in psp_cmd_submit_buf when firmware load failed in SRIOV. Signed-off-by: Alice Wong --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.

[PATCH v2 1/3] drm/amdgpu/vcn: add common vcn sofware ring decode

2022-05-04 Thread James Zhu
Add common vcn sofware ring decode. Signed-off-by: James Zhu Reviewed-by: Christian Koenig --- drivers/gpu/drm/amd/amdgpu/Makefile | 1 + drivers/gpu/drm/amd/amdgpu/vcn_sw_ring.c | 85 drivers/gpu/drm/amd/amdgpu/vcn_sw_ring.h | 44 3 files changed, 13

[PATCH v2 0/3] add common vcn software ring decode.

2022-05-04 Thread James Zhu
v2: add VCN_SW_RING_EMIT_FRAME_SIZE.(Suggested from Christian) James Zhu (3): drm/amdgpu/vcn: add common vcn sofware ring decode drm/amdgpu/vcn3: replace ip based software ring decode with common vcn software ring decode drm/amdgpu/vcn4: replace ip based software ring decode with common

[PATCH v2 2/3] drm/amdgpu/vcn3: replace ip based software ring decode with common vcn software ring decode

2022-05-04 Thread James Zhu
Replace ip based software ring decode with common vcn software ring decode. Signed-off-by: James Zhu Reviewed-by: Christian Koenig --- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 80 +++ drivers/gpu/drm/amd/amdgpu/vcn_v3_0.h | 12 2 files changed, 9 insertions(+), 83 de

[PATCH v2 3/3] drm/amdgpu/vcn4: replace ip based software ring decode with common vcn software ring decode

2022-05-04 Thread James Zhu
Replace ip based software ring decode with common vcn software ring decode. Signed-off-by: James Zhu Reviewed-by: Christian Koenig --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v

[PATCH] drm/amdgpu: Fix multiple GPU resets in XGMI hive.

2022-05-04 Thread Andrey Grodzovsky
Problem: During hive reset caused by command timing out on a ring extra resets are generated by triggered by KFD which is unable to accesses registers on the resetting ASIC. Fix: Rework GPU reset to use a list of pending reset jobs such that the first reset jobs that actaully resets the entire res

Re: [PATCH 1/2] Revert "drm/amdgpu: disable runpm if we are the primary adapter"

2022-05-04 Thread Javier Martinez Canillas
Hello Alex, On 5/4/22 15:48, Alex Deucher wrote: > This reverts commit b95dc06af3e683d6b7ddbbae178b2b2a21ee8b2b. > > This workaround is no longer necessary. We have a better workaround > in commit f95af4a9236695 ("drm/amdgpu: don't runtime suspend if there are > displays attached (v3)"). > I w

Re: [PATCH 1/2] Revert "drm/amdgpu: disable runpm if we are the primary adapter"

2022-05-04 Thread Daniel Vetter
On Wed, May 04, 2022 at 09:48:32AM -0400, Alex Deucher wrote: > This reverts commit b95dc06af3e683d6b7ddbbae178b2b2a21ee8b2b. > > This workaround is no longer necessary. We have a better workaround > in commit f95af4a9236695 ("drm/amdgpu: don't runtime suspend if there are > displays attached (v

Re: [PATCH 2/2] Revert "fbdev: fbmem: add a helper to determine if an aperture is used by a fw fb"

2022-05-04 Thread Javier Martinez Canillas
On 5/4/22 15:48, Alex Deucher wrote: > This reverts commit 9a45ac2320d0a6ae01880a30d4b86025fce4061b. > > This was added a helper for amdgpu to workaround a runtime pm regression > caused by a runtime pm fix in efifb. We now have a better workarouund s/workarouund/workaround > in amdgpu in > com

Re: [PATCH 1/2] Revert "drm/amdgpu: disable runpm if we are the primary adapter"

2022-05-04 Thread Alex Deucher
On Wed, May 4, 2022 at 12:46 PM Javier Martinez Canillas wrote: > > Hello Alex, > > On 5/4/22 15:48, Alex Deucher wrote: > > This reverts commit b95dc06af3e683d6b7ddbbae178b2b2a21ee8b2b. > > > > This workaround is no longer necessary. We have a better workaround > > in commit f95af4a9236695 ("drm

Re: [PATCH 1/2] Revert "drm/amdgpu: disable runpm if we are the primary adapter"

2022-05-04 Thread Javier Martinez Canillas
On 5/4/22 18:50, Alex Deucher wrote: > On Wed, May 4, 2022 at 12:46 PM Javier Martinez Canillas > wrote: >> >> Hello Alex, >> >> On 5/4/22 15:48, Alex Deucher wrote: >>> This reverts commit b95dc06af3e683d6b7ddbbae178b2b2a21ee8b2b. >>> >>> This workaround is no longer necessary. We have a better

[pull] amdgpu drm-fixes-5.18

2022-05-04 Thread Alex Deucher
Hi Dave, Daniel, Fixes for 5.18. The following changes since commit 9d9f720733b7e8d11e4cc53b53f461b117dab839: Merge tag 'amd-drm-fixes-5.18-2022-04-27' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes (2022-04-29 10:27:05 +1000) are available in the Git repository at: https:/

Re: Do we really need to increase/decrease MST VC payloads?

2022-05-04 Thread Lyude Paul
Some good news: I actually came up with a way of handling this in the new MST code pretty nicely, so I think we should be able to move forward without having to disable this (although it would be very nice to know whether or not this is necessary for amdgpu to work, since it'd still be nice to spli

[PATCH v2 0/2] drm/amdgpu: Fix a couple of clang warnings

2022-05-04 Thread Mike Lothian
The 3rd patch from the previous series was already applied This reworks the other two based on Alex's comments Mike Lothian (2): drm/amdgpu/gfx10: Avoid uninitialised variable 'index' drm/amdgpu/gfx11: Avoid uninitialised variable 'index' drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 ++- driv

[PATCH 1/2] drm/amdgpu/gfx10: Avoid uninitialised variable 'index'

2022-05-04 Thread Mike Lothian
This stops clang complaining: drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3846:6: warning: variable 'index' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (ring->is_mes_queue) { ^~ drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3903:30:

[PATCH 2/2] drm/amdgpu/gfx11: Avoid uninitialised variable 'index'

2022-05-04 Thread Mike Lothian
This stops clang complaining: drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:376:6: warning: variable 'index' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (ring->is_mes_queue) { ^~ drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:433:30: n

Re: [PATCH v6] drm/amdgpu: Ensure the DMA engine is deactivated during set ups

2022-05-04 Thread Haohui Mai
Ping... From: ricet...@gmail.com Sent: Saturday, April 30, 2022 3:34:00 PM To: amd-gfx@lists.freedesktop.org Cc: lang...@amd.com ; ckoenig.leichtzumer...@gmail.com ; guchun.c...@amd.com ; yifan1.zh...@amd.com ; hawking.zh...@amd.com ; Haohui Mai Subject: [PATC

[PATCH] drm/amdgpu: simplify the return expression

2022-05-04 Thread cgel . zte
From: Minghao Chi Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdg

Re: [PATCH 2/2] drm/amdgpu/gfx11: Avoid uninitialised variable 'index'

2022-05-04 Thread Alex Deucher
Applied the series. Thanks! Alex On Wed, May 4, 2022 at 6:24 PM Mike Lothian wrote: > > This stops clang complaining: > > drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:376:6: warning: variable 'index' is > used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] > if (ri

Re: [PATCH] drm/amdgpu: simplify the return expression

2022-05-04 Thread Alex Deucher
Applied. Thanks! On Wed, May 4, 2022 at 10:11 PM wrote: > > From: Minghao Chi > > Simplify the return expression. > > Reported-by: Zeal Robot > Signed-off-by: Minghao Chi > --- > drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 13 ++--- > 1 file changed, 2 insertions(+), 11 deletions(-) > >

[PATCH] drm/amdgpu: simplify the return expression of vega10_ih_hw_init()

2022-05-04 Thread cgel . zte
From: Minghao Chi Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi --- drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10

Re: [PATCH] drm/amdgpu: simplify the return expression of vega10_ih_hw_init()

2022-05-04 Thread Alex Deucher
Applied. Thanks! Alex On Wed, May 4, 2022 at 10:22 PM wrote: > > From: Minghao Chi > > Simplify the return expression. > > Reported-by: Zeal Robot > Signed-off-by: Minghao Chi > --- > drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 7 +-- > 1 file changed, 1 insertion(+), 6 deletions(-) > > di

RE: Do we really need to increase/decrease MST VC payloads?

2022-05-04 Thread Zuo, Jerry
[AMD Official Use Only - General] Hi Lyude: Sorry for replying late. 1. The payload increase/decrease routines are not for DP2. 2. mst_bw_update is not used in amdgpu_dm, so those two functions are not getting used for now. I leave it there simply for future possible hook up. Re

Re: [PATCH 1/2] drm/amdgpu: handle asics with 1 SDMA instance

2022-05-04 Thread Alex Deucher
On Wed, May 4, 2022 at 2:28 AM Christian König wrote: > > Am 03.05.22 um 22:38 schrieb Alex Deucher: > > From: Xiaojian Du > > > > This patch will handle asics with 1 SDMA instance. > > > > Signed-off-by: Xiaojian Du > > Reviewed-by: Huang Rui > > Reviewed-by: Alex Deucher > > Signed-off-by: A

[PATCH] drm/amdgpu: simplify nv and soc21 read_register functions

2022-05-04 Thread Alex Deucher
Check of the base offset for the IP exists rather than explicitly checking for how many instances of a particular IP there are. This is what soc15.c already does. Expand this to nv.c and soc21.c. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/nv.c| 6 +++--- drivers/gpu/drm/amd

[PATCH] drm/amdgpu/gfx11: remove some register fields that no longer exist

2022-05-04 Thread Alex Deucher
Some copy paste leftovers for older asics. They were protected by __BIG_ENDIAN, so we didn't notice them initially. Reported-by: kernel test robot Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/amd

[PATCH] drm/amdgpu: make scratch_get/free more general

2022-05-04 Thread Lang Yu
Then other IPs can use this utility. Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 3 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 36 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c| 36 -- drivers/gpu/drm/amd/amdgpu/amdgpu_gf

[PATCH] drm/amdgpu/mes11: remove some register fields that no longer exist

2022-05-04 Thread Alex Deucher
Some copy paste leftovers for older asics. They were protected by __BIG_ENDIAN, so we didn't notice them initially. Reported-by: kernel test robot Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/amd/am

[PATCH] drm/amdgpu: flush delete wq after wait fence

2022-05-04 Thread Yiqing Yao
[why] lru_list not empty warning in sw fini during repeated device bind unbind. There should be a amdgpu_fence_wait_empty() before the flush_delayed_work() call as sugested. [how] Do flush_delayed_work for ttm bo delayed delete wq after fence_driver_hw_fini. Signed-off-by: Yiqing Yao --- driver

Re: [PATCH] drm/amdgpu: make scratch_get/free more general

2022-05-04 Thread Christian König
Am 05.05.22 um 05:20 schrieb Lang Yu: Then other IPs can use this utility. Oh, we intentionally move the scratch register handling from the device code into the GFX code a few years ago. Why is that suddenly necessary here again? Regards, Christian. Signed-off-by: Lang Yu --- drivers/

Re: [PATCH] drm/amdgpu: flush delete wq after wait fence

2022-05-04 Thread Christian König
Am 05.05.22 um 08:35 schrieb Yiqing Yao: [why] lru_list not empty warning in sw fini during repeated device bind unbind. There should be a amdgpu_fence_wait_empty() before the flush_delayed_work() call as sugested. [how] Do flush_delayed_work for ttm bo delayed delete wq after fence_driver_hw_fi