Re: [PATCH 07/34] drm/amdgpu: add gfx9.4.1 hw debug mode enable and disable calls

2023-03-27 Thread kernel test robot
Hi Jonathan, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on drm/drm-next] [also build test WARNING on drm-exynos/exynos-drm-next drm-tip/drm-tip next-20230327] [cannot apply to drm-misc/drm-misc-next drm-intel/for-linux-next drm-intel/for-linux-next-fixes

[PATCH] drm/amdgpu: Add JPEG IP block to SRIOV reinit

2023-03-27 Thread Yifan Zha
[Why] Reset(mode1) failed as JPRG IP did not reinit under sriov. [How] Add JPEG IP block to sriov reinit function. Signed-off-by: Yifan Zha --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

RE: [PATCH] drm/amd/pm: re-enable the gfx imu when smu resume

2023-03-27 Thread Zhang, Yifan
[AMD Official Use Only - General] This patch is : Reviewed-by: Yifan Zhang Best Regards, Yifan -Original Message- From: Huang, Tim Sent: Friday, March 24, 2023 3:08 PM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Zhang, Yifan ; Du, Xiaojian ; Ma, Li ; Huang, Tim

[PATCH] drm/amdgpu: simplify amdgpu_ras_eeprom.c

2023-03-27 Thread Alex Deucher
All chips that support RAS also support IP discovery, so use the IP versions rather than a mix of IP versions and asic types. Signed-off-by: Alex Deucher Cc: Luben Tuikov --- .../gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c| 72 ++- 1 file changed, 20 insertions(+), 52

Re: [PATCH 12/12] drm/amd/display: Remove two unused variables 'result_write_min_hblank' and 'hblank_size'

2023-03-27 Thread Alex Deucher
On Mon, Mar 27, 2023 at 7:36 PM Caio Novais wrote: > > Compiling AMD GPU drivers displays a warning: > > drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_capability.c: > In function ‘dpcd_set_source_specific_data’: >

Re: [PATCH 09/12] drm/amd/display: Remove two unused variables 'is_pipe_split_expected' and 'state'

2023-03-27 Thread Alex Deucher
On Mon, Mar 27, 2023 at 7:35 PM Caio Novais wrote: > > Compiling AMD GPU drivers displays two warnings: > > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource.c: In function > ‘dcn32_acquire_post_bldn_3dlut’: > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource.c:1614:31:

Re: [PATCH 02/12] drm/amd: Remove unused variable 'value0'

2023-03-27 Thread Alex Deucher
On Mon, Mar 27, 2023 at 7:34 PM Caio Novais wrote: > > Compiling AMD GPU drivers displays a warning: > > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_link_encoder.c: In > function ‘dcn10_link_encoder_update_mst_stream_allocation_table’: >

Re: [PATCH 01/12] drm/amd: Remove unused variable 'r'

2023-03-27 Thread Alex Deucher
On Mon, Mar 27, 2023 at 7:34 PM Caio Novais wrote: > > Compiling AMD GPU drivers displays a warning: > > drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c: In function > ‘amdgpu_mes_ctx_alloc_meta_data’: > drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1099:13: warning: variable ‘r’ set > but not used

[PATCH 12/12] drm/amd/display: Remove two unused variables 'result_write_min_hblank' and 'hblank_size'

2023-03-27 Thread Caio Novais
Compiling AMD GPU drivers displays a warning: drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_capability.c: In function ???dpcd_set_source_specific_data???: drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_capability.c:1290:32: warning: variable

[PATCH 11/12] drm/amd/display: Remove unused variable 'scl_enable'

2023-03-27 Thread Caio Novais
Compiling AMD GPU drivers displays a warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_rq_dlg_calc_31.c: In function ???dml_rq_dlg_get_dlg_params???: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_rq_dlg_calc_31.c:905:14: warning: variable ???scl_enable??? set but

[PATCH 10/12] drm/amd/display: Remove unused variable 'cursor_bpp'

2023-03-27 Thread Caio Novais
Compiling AMD GPU drivers displays a warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c: In function ???dcn32_helper_calculate_mall_bytes_for_cursor???: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource_helpers.c:62:18: warning: variable

[PATCH 09/12] drm/amd/display: Remove two unused variables 'is_pipe_split_expected' and 'state'

2023-03-27 Thread Caio Novais
Compiling AMD GPU drivers displays two warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource.c: In function ???dcn32_acquire_post_bldn_3dlut???: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn32/dcn32_resource.c:1614:31: warning: variable ???state??? set but not used

[PATCH 08/12] drm/amd/display: Remove two unused variables 'speakers' and 'channels' and remove unused function 'speakers_to_channels'

2023-03-27 Thread Caio Novais
Compiling AMD GPU drivers displays two warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_apg.c: In function ???apg31_se_audio_setup???: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_apg.c:117:18: warning: variable ???channels??? set but not used [-Wunused-but-set-variable]

[PATCH 07/12] drm/amd/display: Remove unused variable 'optc'

2023-03-27 Thread Caio Novais
Compiling AMD GPU drivers displays a warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_hwseq.c: In function ???dcn30_enable_writeback???: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_hwseq.c:326:34: warning: variable ???optc??? set but not used [-Wunused-but-set-variable]

[PATCH 06/12] drm/amd/display: Remove unused variable 'mc_vm_apt_default'

2023-03-27 Thread Caio Novais
Compiling AMD GPU drivers displays a warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_hubp.c: In function ???hubp3_set_vm_system_aperture_settings???: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_hubp.c:50:30: warning: variable ???mc_vm_apt_default??? set but not used

[PATCH 05/12] drm/amd/display: Remove unused variable 'speakers'

2023-03-27 Thread Caio Novais
Compiling AMD GPU drivers displays a warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_afmt.c: In function ???afmt3_se_audio_setup???: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_afmt.c:126:18: warning: variable ???speakers??? set but not used [-Wunused-but-set-variable]

[PATCH 04/12] drm/amd/display: Remove unused variable 'hubp'

2023-03-27 Thread Caio Novais
Compiling AMD GPU drivers displays a warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn201/dcn201_hwseq.c: In function ???dcn201_pipe_control_lock???: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn201/dcn201_hwseq.c:544:22: warning: variable ???hubp??? set but not used

[PATCH 03/12] drm/amd/display: Remove unused variable 'pixel_width'

2023-03-27 Thread Caio Novais
Compiling AMD GPU drivers displays a warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn201/dcn201_dpp.c: In function ???dpp201_get_optimal_number_of_taps???: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn201/dcn201_dpp.c:188:18: warning: variable ???pixel_width??? set but not used

[PATCH 02/12] drm/amd: Remove unused variable 'value0'

2023-03-27 Thread Caio Novais
Compiling AMD GPU drivers displays a warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_link_encoder.c: In function ???dcn10_link_encoder_update_mst_stream_allocation_table???: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_link_encoder.c:1222:18: warning: variable ???value0???

[PATCH 01/12] drm/amd: Remove unused variable 'r'

2023-03-27 Thread Caio Novais
Compiling AMD GPU drivers displays a warning: drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c: In function ???amdgpu_mes_ctx_alloc_meta_data???: drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1099:13: warning: variable ???r??? set but not used [-Wunused-but-set-variable] Get rid of it by removing the

[PATCH 00/12] drm/amd: Remove unused variables

2023-03-27 Thread Caio Novais
This patchset cleans the code removing unused variables and one unused function. Caio Novais (12): Remove unused variable 'r' Remove unused variable 'value0' Remove unused variable 'pixel_width' Remove unused variable 'hubp' Remove unused variable 'speakers' Remove unused variable

Re: [PATCH 00/10] drm/radeon: Convert fbdev to DRM client

2023-03-27 Thread Alex Deucher
Applied. Thanks! On Fri, Mar 24, 2023 at 5:44 PM Alex Deucher wrote: > > On Tue, Mar 21, 2023 at 5:33 AM Thomas Zimmermann wrote: > > > > Hi > > > > Am 20.03.23 um 16:23 schrieb Alex Deucher: > > > On Mon, Mar 20, 2023 at 11:19 AM Thomas Zimmermann > > > wrote: > > >> > > >> Hi > > >> > > >>

Re: [PATCH 01/34] drm/amdkfd: add debug and runtime enable interface

2023-03-27 Thread Felix Kuehling
With my comments on patches 8 and 21 addressed, patches 1-33 are Reviewed-by: Felix Kuehling Patch 34 needs a more thorough review and testing. It's not an essential part of the patch series and can be finished later. Regards,   Felix On 2023-03-27 14:43, Jonathan Kim wrote: Introduce

Re: [PATCH 34/34] drm/amdkfd: optimize gfx off enable toggle for debugging

2023-03-27 Thread Felix Kuehling
On 2023-03-27 14:43, Jonathan Kim wrote: Legacy debug devices limited to pinning a single debug VMID for debugging are the only devices that require disabling GFX OFF while accessing debug registers. Debug devices that support multi-process debugging rely on the hardware scheduler to update

Re: [PATCH 21/34] drm/amdkfd: add debug trap enabled flag to tma

2023-03-27 Thread Felix Kuehling
On 2023-03-27 14:43, Jonathan Kim wrote: From: Jay Cornwall Trap handler behavior will differ when a debugger is attached. Make the debug trap flag available in the trap handler TMA. Update it when the debug trap ioctl is invoked. v4: fix up comments to clarify flagging implementation. v3:

Re: [PATCH 08/34] drm/amdkfd: fix kfd_suspend_all_processes for gfx941 debugging

2023-03-27 Thread Felix Kuehling
On 2023-03-27 14:43, Jonathan Kim wrote: The debugger for GFX9.4.1 uses kfd_suspend_all_processes to pause the compute pipe line so it can safely toggle the SQ's implicit wait on barrier setting during debug attach/detach to work around the wave exception s_barrier race condition. For mGPU

Re: [PATCH 07/13] drm/amdgpu: add UAPI to query GFX shadow sizes

2023-03-27 Thread Marek Olšák
Reviewed-by: Marek Olšák On Thu, Mar 23, 2023 at 5:41 PM Alex Deucher wrote: > Add UAPI to query the GFX shadow buffer requirements > for preemption on GFX11. UMDs need to specify the shadow > areas for preemption. > > v2: move into existing asic info query > drop GDS as its use is

[PATCH 11/11] drm/amdgpu/jpeg: add multiple jpeg rings support for vcn4_0_3

2023-03-27 Thread Alex Deucher
From: James Zhu Add multiple jpeg rings support for vcn4_0_3 Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 214 --- drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.h | 1 + 2 files changed, 147

[PATCH 10/11] drm/amdgpu/jpeg: add multiple jpeg rings support

2023-03-27 Thread Alex Deucher
From: James Zhu Add multiple jpeg rings support. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 21 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.h | 6 -- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

[PATCH 03/11] drm/amdgpu/jpeg: add jpeg support for VCN4_0_3

2023-03-27 Thread Alex Deucher
From: James Zhu Add jpeg support for VCN4_0_3. v2: squash in delayed work typo fix (Alex) Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/Makefile | 3 +- drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 762 +++

[PATCH 05/11] drm/amdgpu/jpeg: enable jpeg cg for VCN4_0_3

2023-03-27 Thread Alex Deucher
From: James Zhu Enable jpeg cg for VCN4_0_3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/soc15.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c

[PATCH 07/11] drm/amdgpu/vcn: enable vcn cg for VCN4_0_3

2023-03-27 Thread Alex Deucher
From: James Zhu Enable vcn cg for VCN4_0_3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/soc15.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c index

[PATCH 09/11] drm/amdgpu/vcn: enable vcn DPG mode for VCN4_0_3

2023-03-27 Thread Alex Deucher
From: James Zhu Enable vcn DPG mode for VCN4_0_3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/soc15.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c

[PATCH 08/11] drm/amdgpu/vcn: enable vcn pg for VCN4_0_3

2023-03-27 Thread Alex Deucher
From: James Zhu Enable vcn pg for VCN4_0_3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/soc15.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c index

[PATCH 04/11] drm/amdgpu/vcn: add vcn support for VCN4_0_3

2023-03-27 Thread Alex Deucher
From: James Zhu Add vcn support for VCN4_0_3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/Makefile |1 + drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 1438 +++ drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.h |

[PATCH 06/11] drm/amdgpu/jpeg: enable jpeg pg for VCN4_0_3

2023-03-27 Thread Alex Deucher
From: James Zhu Enable jpeg pg for VCN4_0_3. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/soc15.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c

[PATCH 02/11] drm/amdgpu: add VCN4_0_3 firmware

2023-03-27 Thread Alex Deucher
From: James Zhu Add VCN4_0_3 firmware. v2: fix fw name (Alex) Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git

[PATCH 00/11] VCN 4.0.3 Support

2023-03-27 Thread Alex Deucher
This adds support for VCN 4.0.3. VCN is the media engine on AMD GPUs. Patch 1 add new register headers and is too big for the mailing list. Hawking Zhang (1): drm/amdgpu: add vcn v4_0_3 ip headers James Zhu (10): drm/amdgpu: add VCN4_0_3 firmware drm/amdgpu/jpeg: add jpeg support for

[PATCH 20/28] drm/amdgpu: init vmhubs bitmask for GC 9.4.3

2023-03-27 Thread Alex Deucher
From: Le Ma Each XCD owns one GFXHUB. v2: switch to the new VMHUB layout Signed-off-by: Le Ma Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git

[PATCH 27/28] drm/amdgpu: Use the correct API to read register

2023-03-27 Thread Alex Deucher
From: Lijo Lazar Use SOC15 API so that the register offset is calculated correctly. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 23/28] drm/amdgpu: make the WREG32_SOC15_xx macro to support multi GC

2023-03-27 Thread Alex Deucher
From: Shiwu Zhang To write regs on different GCDs, use the inst index. Signed-off-by: Shiwu Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/soc15_common.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH 28/28] drm/amdgpu/: add more macro to support offset variant

2023-03-27 Thread Alex Deucher
From: James Zhu Add more macro to support offset variant and simplify macro SOC15_WAIT_ON_RREG. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 3 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 28 +

[PATCH 22/28] drm/amdgpu: add sysfs node for compute partition mode

2023-03-27 Thread Alex Deucher
From: Le Ma Add current/available compute partitin mode sysfs node. v2: make the sysfs node as IP independent one in amdgpu_gfx.c Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 +

[PATCH 26/28] drm/amdgpu: Add kgd2kfd for GC 9.4.3

2023-03-27 Thread Alex Deucher
From: Amber Lin New GC (v9.4.3) and ATHUB (v1.8.0) versions are used. Add kgd_gfx_v9_4_3_* functions if registers in use of kgd_gfx_v9_* functions are changed or have different offset. Signed-off-by: Amber Lin Acked-by: Felix Kuehling Reviewed-by: Mukul Joshi Signed-off-by: Alex Deucher ---

[PATCH 15/28] drm/amdgpu: allocate doorbell index for multi-die case

2023-03-27 Thread Alex Deucher
From: Le Ma Allocate different doorbell index for kiq/kcq rings on each die Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h | 9 - drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 5 +

[PATCH 24/28] drm/amdgpu: override partition mode through module parameter

2023-03-27 Thread Alex Deucher
From: Shiwu Zhang Add a module parameter to override the partition mode. Signed-off-by: Shiwu Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +

[PATCH 16/28] drm/amdgpu: do gfxhub init for all XCDs

2023-03-27 Thread Alex Deucher
From: Le Ma Each XCD needs to do gfxhub init Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 581 +-- 1 file changed, 317 insertions(+), 264 deletions(-) diff --git

[PATCH 17/28] drm/amdgpu: introduce vmhub definition for multi-partition cases (v3)

2023-03-27 Thread Alex Deucher
From: Hawking Zhang v1: Each partition has its own gfxhub or mmhub. adjust the num of MAX_VMHUBS and the GFXHUB/MMHUB layout (Le) v2: re-design the AMDGPU_GFXHUB/AMDGPU_MMHUB layout (Le) v3: apply the gfxhub/mmhub layout to new IPs (Hawking) v4: fix up gmc11 (Alex) v5: rebase (Alex)

[PATCH 18/28] drm/amdgpu: assign register address for vmhub object on each XCD

2023-03-27 Thread Alex Deucher
From: Le Ma Each XCD has its own gfxhub. v2: switch to the new VMHUB layout v3: fix mistake Signed-off-by: Le Ma Reviewed-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 58 ++-- 1 file changed,

[PATCH 25/28] drm/amdgpu: alloc vm inv engines for every vmhub

2023-03-27 Thread Alex Deucher
From: Shiwu Zhang There are AMDGPU_MAX_VMHUBS of vmhub in maximum and need to init the vm_inv_engs for all of them. In this way, the below error can be ruled out. [ 217.317752] amdgpu :02:00.0: amdgpu: no VM inv eng for ring sdma0 Signed-off-by: Shiwu Zhang Reviewed-by: Christian Koenig

[PATCH 11/28] drm/amdgpu: add xcc index argument to select_sh_se function v2

2023-03-27 Thread Alex Deucher
From: Le Ma v1: To support multiple XCD case (Le) v2: introduce xcc index to gfx_v11_0_select_sh_se (Hawking) Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 4 +--

[PATCH 07/28] drm/amdgpu: split gc v9_4_3 functionality from gc v9_0

2023-03-27 Thread Alex Deucher
From: Le Ma To prepare for gc v9_4_3 specific feature. v2: fix exports (Alex) Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 2668 ++-

[PATCH 13/28] drm/amdgpu: add master/slave check in init phase

2023-03-27 Thread Alex Deucher
From: Le Ma Skip KCQ setup on slave xcc as there's no use case. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 59 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 2 +

[PATCH 10/28] drm/amdgpu: add xcc index argument to gfx v9_4_3 functions

2023-03-27 Thread Alex Deucher
From: Le Ma Change those v9_4_3 interfaces which are exposed in gfx_v9_0.c. For some active single-xcc emu models, the code path in gfx_v9_0.c is better to keep reserved for a while. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher ---

[PATCH 09/28] drm/amdgpu: add multi-XCC initial support in gfx_v9_4_3.c

2023-03-27 Thread Alex Deucher
From: Le Ma Each XCD needs to be initialized respectively. The major changes are: 1. add iteration to do rlc/kiq/kcq init/fini for each xcd 2. load rlc/mec microcode to each xcd 3. add argument to specify xcc index in initialization functions Signed-off-by: Le Ma Reviewed-by: Hawking

[PATCH 21/28] drm/amdgpu: assign different AMDGPU_GFXHUB for rings on each xcc

2023-03-27 Thread Alex Deucher
From: Le Ma Pass the xcc_id to AMDGPU_GFXHUB(x) Signed-off-by: Le Ma Reviewed-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 2 +- 2 files changed, 2 insertions(+), 2

[PATCH 12/28] drm/amdgpu: add xcc index argument to rlc safe_mode func (v4)

2023-03-27 Thread Alex Deucher
From: Le Ma v1: To support multple XCD case (Le) v2: unify naming style (Le) v3: apply the changes to gc v11_0 (Hawking) v4: apply the changes to gc SOC21 (Morris) Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Morris Zhang Signed-off-by: Alex

[PATCH 19/28] drm/amdgpu: add bitmask to iterate vmhubs

2023-03-27 Thread Alex Deucher
From: Le Ma As the layout of VMHUB definition has been changed to cover multiple XCD/AID case, the original num_vmhubs is not appropriate to do vmhub iteration any more. Drop num_vmhubs and introduce vmhubs_mask instead. v2: switch to the new VMHUB layout v3: use DECLARE_BITMAP to define

[PATCH 14/28] drm/amdgpu: initialize num_xcd to 1 for gfx v9_0

2023-03-27 Thread Alex Deucher
From: Le Ma Assign value here as the num_xcd is referenced in some gfx9 common path. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 05/28] drm/amdgpu: separate the mqd_backup for kiq from kcq

2023-03-27 Thread Alex Deucher
From: Le Ma This will benifit the mqd indexing for kiq/kcq in multi XCD case. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 08/28] drm/amdgpu: add xcc index argument to soc15_grbm_select

2023-03-27 Thread Alex Deucher
From: Le Ma To support grbm select for multiple XCD case. v2: unify naming style Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 10 +++ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 26

[PATCH 06/28] drm/amdgpu: add multi-xcc support to amdgpu_gfx interfaces (v4)

2023-03-27 Thread Alex Deucher
From: Le Ma v1: Modify kiq_init/fini, mqd_sw_init/fini and enable/disable_kcq to adapt to multi-die case. Pass 0 as default to all asics with single xcc (Le) v2: squash commits to avoid breaking the build (Le) v3: unify naming style (Le) v4: apply the changes to gc v11_0 (Hawking)

[PATCH 04/28] drm/amdgpu: move queue_bitmap to an independent structure (v3)

2023-03-27 Thread Alex Deucher
From: Le Ma To allocate independent queue_bitmap for each XCD, then the old bitmap policy can be continued to use with a clear logic. Use mec_bitmap[0] as default for all non-GC 9.4.3 IPs. v2: squash commits to avoid breaking the build v3: unify naming style Signed-off-by: Le Ma Reviewed-by:

[PATCH 03/28] drm/amdgpu: convert gfx.kiq to array type (v3)

2023-03-27 Thread Alex Deucher
From: Le Ma v1: more kiq instances are a available in SOC (Le) v2: squash commits to avoid breaking the build (Le) v3: make the conversion for gfx/mec v11_0 (Hawking) Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher ---

[PATCH 01/28] drm/amdgpu: move vmhub out of amdgpu_ring_funcs (v4)

2023-03-27 Thread Alex Deucher
From: Le Ma It looks better to place this field in ring structure. Also drop the repeated ring funcs definitions if there's no difference except for vmhub field. v2: rename the field to vm_hub like others (Le) v3: apply the changes to new ip blocks (Hawking) v4: fix vcn sw ring (Alex)

[PATCH 02/28] drm/amdgpu: add some basic elements for multiple XCD case

2023-03-27 Thread Alex Deucher
From: Le Ma Add some basic definitions and structure member. Inscrease MAX_WB slots to 1024 to support the increasing number of rings for multiple partitions. v2: unify naming style Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher ---

[PATCH] drm/amd/display: set correct capablity for MPO on DCN321

2023-03-27 Thread Aurabindo Pillai
[Why] Fix the incorrect value for parameters used to enable multi plane overlay support for DCN321 Fixes: 235c6763423 ("drm/amd/display: add DCN32/321 specific files for Display Core") Cc: sta...@vger.kernel.org Signed-off-by: Aurabindo Pillai ---

[PATCH 08/10] drm/amdgpu: switch to v9_4_3 gfx_funcs callbacks for GC 9.4.3

2023-03-27 Thread Alex Deucher
From: Hawking Zhang add gfx_funcs callbacks implemenation based on gc_v9_4_3 ip headers Signed-off-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 154 +++- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.h | 1 + 2

[PATCH 03/10] drm/amdkfd: Trap handler changes for GC 9.4.3 v2

2023-03-27 Thread Alex Deucher
From: Jay Cornwall v1: Check new exception bits in TRAPSTS register Remove single step exception workaround, now part of exception bits v2: GC 9.4.3 uses ttmp11 to store {1’b0, dispatch index [24:0], wave_id_in_workgroup[5:0]}, so use ttmp13 instead of ttmp11 to preserve ib_sts. (Laurent)

[PATCH 05/10] drm/amdgpu: add gc v9_4_3 rlc_funcs implementation

2023-03-27 Thread Alex Deucher
From: Hawking Zhang all the gc v9_4_3 registers fall in gc_rlcpdec address range have different relative offsets and base_idx from the ones defined in gc v9_0 ip headers. gc_v9_0_rlc_funcs can not be reused anymore for gc v9_4_3 v2: drop unused handshake function (Alex) Signed-off-by: Hawking

[PATCH 09/10] drm/amdgpu: add common early init support for GC 9.4.3

2023-03-27 Thread Alex Deucher
From: Hawking Zhang init asic funcs and cp/pg flags for GC 9.4.3 Signed-off-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/soc15.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c

[PATCH 06/10] drm/amdkfd: Enable HW_UPDATE_RPTR on GC 9.4.3

2023-03-27 Thread Alex Deucher
From: Amber Lin GC 9.4.3 uses the hardware to update AQL queues read pointer, so remove CP_HQD_PQ_CONTROL__NO_UPDATE_RPTR_MASK flag from MQD if it's GC 9.4.3, and keep it for other existing gfx9 ASICs. Signed-off-by: Amber Lin Acked-by: Felix Kuehling Signed-off-by: Alex Deucher ---

[PATCH 10/10] drm/amdgpu: add common ip block for GC 9.4.3

2023-03-27 Thread Alex Deucher
From: Hawking Zhang Add common IP handling for GC 9.4.3 Signed-off-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

[PATCH 07/10] drm/amdkfd: Add gfx_target_version for GC 9.4.3

2023-03-27 Thread Alex Deucher
From: Graham Sider Required for Thunk GFX version sysfs query. Signed-off-by: Graham Sider Reviewed-by: Amber Lin Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[PATCH 02/10] drm/amdkfd: Set noretry/xnack for GC 9.4.3

2023-03-27 Thread Alex Deucher
From: Amber Lin For GC 9.4.3, disable retry as default and XNACK can be different modes per process. Signed-off-by: Amber Lin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 1 + drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 3 ++- 2 files

[PATCH 04/10] drm/amdkfd: Set TG_CHUNK_SIZE for GC 9.4.3

2023-03-27 Thread Alex Deucher
From: Amber Lin On GC 9.4.3, DW 41 in MQD is repurposed as compute_tg_chunk_size for cooperative dispatch. When it's a AQL queue, set compute_tg_chunk_size as 1 to spread work groups evenly among XCCs. If it's PM4 queue, unset compute_tg_chunk_size to disable cooperative mode. v3: set

[PATCH 01/10] drm/amdkfd: Add GC 9.4.3 KFD support

2023-03-27 Thread Alex Deucher
From: Hawking Zhang Add initial KFD support Convert a few structures to IP version checking (Hawking) Signed-off-by: Elena Sakhnovitch Signed-off-by: Hawking Zhang Reviewed-by: Amber Lin Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 1 +

Re: [PATCH] drm/amdgpu: Fix desktop freezed after gpu-reset

2023-03-27 Thread Luben Tuikov
Hi, That's a good fix. Some questions and comments below: On 2023-03-27 11:20, Alan Liu wrote: > [Why] > After gpu-reset, sometimes the driver would fail to enable vblank irq, > causing flip_done timed out and the desktop freezed. > > During gpu-reset, we will disable and enable vblank irq in

RE: [PATCH] drm/amd/amdgpu: Remove initialisation of globals to 0 or NULL

2023-03-27 Thread SHANMUGAM, SRINIVASAN
[AMD Official Use Only - General] Thanks a lot Alex for reviewing the patch. Best Regards, Srini -Original Message- From: Alex Deucher Sent: Tuesday, March 28, 2023 12:12 AM To: SHANMUGAM, SRINIVASAN Cc: Koenig, Christian ; Deucher, Alexander ; Limonciello, Mario ; Mahfooz, Hamza ;

[PATCH 34/34] drm/amdkfd: optimize gfx off enable toggle for debugging

2023-03-27 Thread Jonathan Kim
Legacy debug devices limited to pinning a single debug VMID for debugging are the only devices that require disabling GFX OFF while accessing debug registers. Debug devices that support multi-process debugging rely on the hardware scheduler to update debug registers and do not run into GFX OFF

[PATCH 33/34] drm/amdkfd: bump kfd ioctl minor version for debug api availability

2023-03-27 Thread Jonathan Kim
Bump the minor version to declare debugging capability is now available. v2: bump to 1.13 after upstream rebase. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 1 - include/uapi/linux/kfd_ioctl.h | 3 ++- 2 files changed, 2

[PATCH 27/34] drm/amdkfd: add debug set and clear address watch points operation

2023-03-27 Thread Jonathan Kim
Shader read, write and atomic memory operations can be alerted to the debugger as an address watch exception. Allow the debugger to pass in a watch point to a particular memory address per device. Note that there exists only 4 watch points per devices to date, so have the KFD keep track of what

[PATCH 21/34] drm/amdkfd: add debug trap enabled flag to tma

2023-03-27 Thread Jonathan Kim
From: Jay Cornwall Trap handler behavior will differ when a debugger is attached. Make the debug trap flag available in the trap handler TMA. Update it when the debug trap ioctl is invoked. v4: fix up comments to clarify flagging implementation. v3: Rebase for upstream v2: Add missing debug

[PATCH 25/34] drm/amdkfd: add debug wave launch mode operation

2023-03-27 Thread Jonathan Kim
Allow the debugger to set wave behaviour on to either normally operate, halt at launch, trap on every instruction, terminate immediately or stall on allocation. v3: remove unrequired stall_launch reference in an earlier patch. gfx off optimization will be addressed later. v2: add gfx11 support

[PATCH 26/34] drm/amdkfd: add debug suspend and resume process queues operation

2023-03-27 Thread Jonathan Kim
In order to inspect waves from the saved context at any point during a debug session, the debugger must be able to preempt queues to trigger context save by suspending them. On queue suspend, the KFD will copy the context save header information so that the debugger can correctly crawl the

[PATCH 28/34] drm/amdkfd: add debug set flags operation

2023-03-27 Thread Jonathan Kim
Allow the debugger to set single memory and single ALU operations. Some exceptions are imprecise (memory violations, address watch) in the sense that a trap occurs only when the exception interrupt occurs and not at the non-halting faulty instruction. Trap temporaries 0 & 1 save the program

[PATCH 20/34] drm/amdkfd: add runtime enable operation

2023-03-27 Thread Jonathan Kim
The debugger can attach to a process prior to HSA enablement (i.e. inferior is spawned by the debugger and attached to immediately before target process has been enabled for HSA dispatches) or it can attach to a running target that is already HSA enabled. Either way, the debugger needs to know

[PATCH 19/34] drm/amdkfd: add send exception operation

2023-03-27 Thread Jonathan Kim
Add a debug operation that allows the debugger to send an exception directly to runtime through a payload address. For memory violations, normal vmfault signals will be applied to notify runtime instead after passing in the saved exception data when a memory violation was raised to the debugger.

[PATCH 32/34] drm/amdkfd: add debug device snapshot operation

2023-03-27 Thread Jonathan Kim
Similar to queue snapshot, return an array of device information using an entry_size check and return. Unlike queue snapshots, the debugger needs to pass to correct number of devices that exist. If it fails to do so, the KFD will return the number of actual devices so that the debugger can make a

[PATCH 16/34] drm/amdkfd: add per process hw trap enable and disable functions

2023-03-27 Thread Jonathan Kim
To enable HW debug mode per process, all devices must be debug enabled successfully. If a failure occures, rewind the enablement of debug mode on the enabled devices. A power management scenario that needs to be considered is HW debug mode setting during GFXOFF. During GFXOFF, these registers

[PATCH 13/34] drm/amdkfd: prepare map process for single process debug devices

2023-03-27 Thread Jonathan Kim
Older HW only supports debugging on a single process because the SPI debug mode setting registers are device global. The HWS has supplied a single pinned VMID (0xf) for MAP_PROCESS for debug purposes. To pin the VMID, the KFD will remove the VMID from the HWS dynamic VMID allocation via

[PATCH 07/34] drm/amdgpu: add gfx9.4.1 hw debug mode enable and disable calls

2023-03-27 Thread Jonathan Kim
On GFX9.4.1, the implicit wait count instruction on s_barrier is disabled by default in the driver during normal operation for performance requirements. There is a hardware bug in GFX9.4.1 where if the implicit wait count instruction after an s_barrier instruction is disabled, any wave that hits

[PATCH 30/34] drm/amdkfd: add debug query exception info operation

2023-03-27 Thread Jonathan Kim
Allow the debugger to query additional info based on an exception code. For device exceptions, it's currently only memory violation information. For process exceptions, it's currently only runtime information. Queue exception only report the queue exception status. The debugger has the option of

[PATCH 31/34] drm/amdkfd: add debug queue snapshot operation

2023-03-27 Thread Jonathan Kim
Allow the debugger to get a snapshot of a specified number of queues containing various queue property information that is copied to the debugger. Since the debugger doesn't know how many queues exist at any given time, allow the debugger to pass the requested number of snapshots as 0 to get the

[PATCH 17/34] drm/amdkfd: apply trap workaround for gfx11

2023-03-27 Thread Jonathan Kim
Due to a HW bug, waves in only half the shader arrays can enter trap. When starting a debug session, relocate all waves to the first shader array of each shader engine and mask off the 2nd shader array as unavailable. When ending a debug session, re-enable the 2nd shader array per shader engine.

[PATCH 14/34] drm/amdgpu: prepare map process for multi-process debug devices

2023-03-27 Thread Jonathan Kim
Unlike single process debug devices, multi-process debug devices allow debug mode setting per-VMID (non-device-global). Because the HWS manages PASID-VMID mapping, the new MAP_PROCESS API allows the KFD to forward the required SPI debug register write requests. To request a new debug mode

[PATCH 15/34] drm/amdgpu: expose debug api for mes

2023-03-27 Thread Jonathan Kim
Similar to the F32 HWS, the RS64 HWS for GFX11 now supports a multi-process debug API. The skip_process_ctx_clear ADD_QUEUE requirement is to prevent the MES from clearing the process context when the first queue is added to the scheduler in order to maintain debug mode settings during queue

[PATCH 23/34] drm/amdkfd: add debug set exceptions enabled operation

2023-03-27 Thread Jonathan Kim
The debugger subscibes to nofication for requested exceptions on attach. Allow the debugger to change its subsciption later on. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 ++ drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 36

[PATCH 24/34] drm/amdkfd: add debug wave launch override operation

2023-03-27 Thread Jonathan Kim
This operation allows the debugger to override the enabled HW exceptions on the device. On debug devices that only support the debugging of a single process, the HW exceptions are global and set through the SPI_GDBG_TRAP_MASK register. Because they are global, only address watch exceptions are

[PATCH 29/34] drm/amdkfd: add debug query event operation

2023-03-27 Thread Jonathan Kim
Allow the debugger to query a single queue, device and process exception. The KFD should also return the GPU or Queue id of the exception. The debugger also has the option of clearing exceptions after being queried. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling ---

  1   2   >