]> www.infradead.org Git - users/dwmw2/linux.git/log
users/dwmw2/linux.git
9 months agodrm/amd/pm: smu v14.0.4 reuse smu v14.0.0 dpmtable
Li Ma [Tue, 28 May 2024 08:30:56 +0000 (16:30 +0800)]
drm/amd/pm: smu v14.0.4 reuse smu v14.0.0 dpmtable

Replace IP VERSION with smu->is_apu in if condition.
And the dpmtable of smu v14.0.4 is same as smu v14.0.0.

Signed-off-by: Li Ma <li.ma@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: add PSP IP v14.0.4 discovery support
Tim Huang [Tue, 14 May 2024 07:56:37 +0000 (15:56 +0800)]
drm/amdgpu: add PSP IP v14.0.4 discovery support

This patch is to add PSP 14.0.4 support.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: add PSP IP v14.0.4 support
Tim Huang [Tue, 14 May 2024 07:53:25 +0000 (15:53 +0800)]
drm/amdgpu: add PSP IP v14.0.4 support

This patch is to add PSP 14.0.4 support.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: add firmware for VPE IP v6.1.3
Tim Huang [Tue, 4 Jun 2024 05:51:30 +0000 (13:51 +0800)]
drm/amdgpu: add firmware for VPE IP v6.1.3

This patch is to add firmware for VPE 6.1.3.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: add VPE IP v6.1.3 discovery support
Tim Huang [Wed, 15 May 2024 08:32:28 +0000 (16:32 +0800)]
drm/amdgpu: add VPE IP v6.1.3 discovery support

This patch is to add VPE 6.1.3 support.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: add VPE IP v6.1.3 support
Tim Huang [Wed, 15 May 2024 08:27:06 +0000 (16:27 +0800)]
drm/amdgpu: add VPE IP v6.1.3 support

This patch is to add VPE 6.1.3 support.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: Add NBIO IP v7.11.3 support
Tim Huang [Tue, 14 May 2024 07:04:02 +0000 (15:04 +0800)]
drm/amdgpu: Add NBIO IP v7.11.3 support

Enable setting soc21 common clockgating for NBIO 7.11.3.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: add NBIO IP v7.11.3 discovery support
Tim Huang [Tue, 14 May 2024 07:01:42 +0000 (15:01 +0800)]
drm/amdgpu: add NBIO IP v7.11.3 discovery support

This patch is to add NBIO 7.11.3 support.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: add firmware for SDMA IP v6.1.2
Tim Huang [Tue, 4 Jun 2024 05:27:23 +0000 (13:27 +0800)]
drm/amdgpu: add firmware for SDMA IP v6.1.2

This patch is to add firmware for SDMA 6.1.2.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdkfd: add KFD support for SDMA IP v6.1.2
Tim Huang [Tue, 14 May 2024 06:50:12 +0000 (14:50 +0800)]
drm/amdkfd: add KFD support for SDMA IP v6.1.2

Enable KFD setting SDMA info for SDMA 6.1.2.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: add SDMA IP v6.1.2 discovery support
Tim Huang [Tue, 14 May 2024 06:48:01 +0000 (14:48 +0800)]
drm/amdgpu: add SDMA IP v6.1.2 discovery support

This patch is to add SDMA 6.1.2 support.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: add firmware for GC IP v11.5.2
Tim Huang [Tue, 4 Jun 2024 05:22:39 +0000 (13:22 +0800)]
drm/amdgpu: add firmware for GC IP v11.5.2

This patch is to add firmware for GC 11.5.2.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdkfd: add KFD support for GC IP v11.5.2
Tim Huang [Tue, 14 May 2024 06:24:44 +0000 (14:24 +0800)]
drm/amdkfd: add KFD support for GC IP v11.5.2

Enable KFD for GC 11.5.2.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: add GC IP v11.5.2 to GC 11.5.0 family
Tim Huang [Tue, 14 May 2024 06:22:09 +0000 (14:22 +0800)]
drm/amdgpu: add GC IP v11.5.2 to GC 11.5.0 family

This patch is to add GC 11.5.2 to GC 11.5.0 family.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: add GC IP v11.5.2 soc21 support
Tim Huang [Tue, 14 May 2024 06:17:13 +0000 (14:17 +0800)]
drm/amdgpu: add GC IP v11.5.2 soc21 support

Add CG and PG flags for GFX IP v11.5.2 and
PG flags for VCN IP v4.0.5.

Signed-off-by: Saleemkhan Jamadar <saleemkhan.jamadar@amd.com>
Signed-off-by: Li Ma <li.ma@amd.com>
Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: add tmz support for GC IP v11.5.2
Tim Huang [Tue, 14 May 2024 06:14:17 +0000 (14:14 +0800)]
drm/amdgpu: add tmz support for GC IP v11.5.2

Add tmz support for GC 11.5.2.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: add GFXHUB IP v11.5.2 support
Tim Huang [Tue, 14 May 2024 06:11:22 +0000 (14:11 +0800)]
drm/amdgpu: add GFXHUB IP v11.5.2 support

This patch is to add GFXHUB 11.5.2 support.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: initialize GC IP v11.5.2
Tim Huang [Tue, 14 May 2024 06:06:03 +0000 (14:06 +0800)]
drm/amdgpu: initialize GC IP v11.5.2

Initialize GC 11.5.2 and set gfx hw configuration.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amdgpu: fix out of bounds access in gfx10 during ip dump
Sunil Khatri [Tue, 2 Jul 2024 08:16:50 +0000 (13:46 +0530)]
drm/amdgpu: fix out of bounds access in gfx10 during ip dump

During ip dump in gfx10 the index variable is reused but is
not reinitialized to 0 and this causes the index calculation
to be wrong and access out of bound access.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amd/display: Fix warning comparing pointer to 0
Jiapeng Chong [Mon, 1 Jul 2024 07:04:51 +0000 (15:04 +0800)]
drm/amd/display: Fix warning comparing pointer to 0

Avoid pointer type value compared with 0 to make code clear.

./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_factory.c:14:12-13: WARNING comparing pointer to 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9458
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amd/display: Fix warning comparing pointer to 0
Jiapeng Chong [Mon, 1 Jul 2024 07:04:52 +0000 (15:04 +0800)]
drm/amd/display: Fix warning comparing pointer to 0

Avoid pointer type value compared with 0 to make code clear.

./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_factory.c:24:12-13: WARNING comparing pointer to 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9458
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amd/display: Fix warning comparing pointer to 0
Jiapeng Chong [Mon, 1 Jul 2024 07:04:53 +0000 (15:04 +0800)]
drm/amd/display: Fix warning comparing pointer to 0

Avoid pointer type value compared with 0 to make code clear.

./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_mcg/dml2_mcg_factory.c:19:12-13: WARNING comparing pointer to 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9458
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amd/display: Fix warning comparing pointer to 0
Jiapeng Chong [Mon, 1 Jul 2024 07:04:54 +0000 (15:04 +0800)]
drm/amd/display: Fix warning comparing pointer to 0

Avoid pointer type value compared with 0 to make code clear.

./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_factory.c:31:12-13: WARNING comparing pointer to 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9458
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 months agodrm/amd/display: Fix unsigned comparison with less than zero
Jiapeng Chong [Mon, 1 Jul 2024 02:50:28 +0000 (10:50 +0800)]
drm/amd/display: Fix unsigned comparison with less than zero

The return value from the call to dml21_find_dc_pipes_for_plane() is int.
However, the return value is being assigned to an unsigned int variable
'num_pipes', the condition if(num_pipes <= 0) is not rigorous enough,
so making 'num_pipes' an int.

./drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c:318:6-15: WARNING: Unsigned expression compared with zero: num_pipes <= 0.
./drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c:360:6-15: WARNING: Unsigned expression compared with zero: num_pipes <= 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9454
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: rewrite convert_tiling_flags_to_modifier_gfx12
Marek Olšák [Sat, 1 Jun 2024 18:31:39 +0000 (14:31 -0400)]
drm/amdgpu: rewrite convert_tiling_flags_to_modifier_gfx12

There were multiple bugs, like checking SWIZZLE_MODE before checking
GFX12_SWIZZLE_MODE, which has undefined behavior.

The function had no effect before (it always returned -EINVAL).

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/radeon: check bo_va->bo is non-NULL before using it
Pierre-Eric Pelloux-Prayer [Tue, 25 Jun 2024 12:31:34 +0000 (14:31 +0200)]
drm/radeon: check bo_va->bo is non-NULL before using it

The call to radeon_vm_clear_freed might clear bo_va->bo, so
we have to check it before dereferencing it.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdkfd: Use device based logging for errors
Lijo Lazar [Mon, 24 Jun 2024 08:03:16 +0000 (13:33 +0530)]
drm/amdkfd: Use device based logging for errors

Convert some pr_* to some dev_* APIs to identify the device.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: Fix hbm stack id in boot error report
Hawking Zhang [Fri, 28 Jun 2024 08:50:56 +0000 (16:50 +0800)]
drm/amdgpu: Fix hbm stack id in boot error report

To align with firmware, hbm id field 0x1 refers to
hbm stack 0, 0x2 refers to hbm statck 1.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: add amdgpu_framebuffer::gfx12_dcc
Marek Olšák [Sat, 1 Jun 2024 19:05:20 +0000 (15:05 -0400)]
drm/amdgpu: add amdgpu_framebuffer::gfx12_dcc

amdgpu_framebuffer doesn't have tiling_flags, so we need this.

amdgpu_display_get_fb_info never gets NULL parameters, so checking for NULL
was useless.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu/display: add all gfx12 modifiers
Marek Olšák [Wed, 26 Jun 2024 18:01:33 +0000 (14:01 -0400)]
drm/amdgpu/display: add all gfx12 modifiers

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu/display: set plane attributes for gfx12 correctly
Marek Olšák [Sat, 1 Jun 2024 20:37:22 +0000 (16:37 -0400)]
drm/amdgpu/display: set plane attributes for gfx12 correctly

It used gfx9 flags, which has undefined behavior on gfx12.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu/display: handle gfx12 in amdgpu_dm_plane_format_mod_supported
Marek Olšák [Sat, 1 Jun 2024 23:59:34 +0000 (19:59 -0400)]
drm/amdgpu/display: handle gfx12 in amdgpu_dm_plane_format_mod_supported

All this code has undefined behavior on GFX12 and shouldn't be executed.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: handle gfx12 in amdgpu_display_verify_sizes
Marek Olšák [Sat, 1 Jun 2024 23:53:01 +0000 (19:53 -0400)]
drm/amdgpu: handle gfx12 in amdgpu_display_verify_sizes

It verified GFX9-11 swizzle modes on GFX12, which has undefined behavior.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: Correct register used to clear fault status
Hawking Zhang [Fri, 28 Jun 2024 08:47:36 +0000 (16:47 +0800)]
drm/amdgpu: Correct register used to clear fault status

Driver should write to fault_cntl registers to do
one-shot address/status clear.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: don't use amdgpu_lookup_format_info on gfx12
Marek Olšák [Sat, 1 Jun 2024 21:25:51 +0000 (17:25 -0400)]
drm/amdgpu: don't use amdgpu_lookup_format_info on gfx12

It only uses fields for GFX9-11 related to the separate DCC buffer,
which doesn't exist in GFX12.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu/display: handle gfx12 in dm_check_cursor_fb
Marek Olšák [Sat, 1 Jun 2024 18:36:41 +0000 (14:36 -0400)]
drm/amdgpu/display: handle gfx12 in dm_check_cursor_fb

Checking SWIZZLE_MODE has undefined behavior on gfx12.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: remove AMD_FMT_MOD_GFX12_DCC_MAX_COMPRESSED_BLOCK_* definitions
Marek Olšák [Sat, 1 Jun 2024 18:56:16 +0000 (14:56 -0400)]
drm/amdgpu: remove AMD_FMT_MOD_GFX12_DCC_MAX_COMPRESSED_BLOCK_* definitions

They were added accidentally.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu/gfx12: remove GDS leftovers
Marek Olšák [Fri, 31 May 2024 23:48:05 +0000 (19:48 -0400)]
drm/amdgpu/gfx12: remove GDS leftovers

GDS doesn't exist in gfx12. The incomplete packet allows userspace to hang
the hw from the kernel.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu/gfx12: remove superfluous cache flags
Marek Olšák [Fri, 31 May 2024 23:38:18 +0000 (19:38 -0400)]
drm/amdgpu/gfx12: remove superfluous cache flags

If any INV flags are needed, they should be executed via ACQUIRE_MEM
before INDIRECT_BUFFER.

GLM flags are also removed because the hw ignores them.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu/gfx11: remove superfluous cache flags
Marek Olšák [Fri, 31 May 2024 23:38:18 +0000 (19:38 -0400)]
drm/amdgpu/gfx11: remove superfluous cache flags

If any INV flags are needed, they should be executed via ACQUIRE_MEM
before INDIRECT_BUFFER.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: check for LINEAR_ALIGNED correctly in check_tiling_flags_gfx6
Marek Olšák [Sat, 1 Jun 2024 20:36:27 +0000 (16:36 -0400)]
drm/amdgpu: check for LINEAR_ALIGNED correctly in check_tiling_flags_gfx6

Fix incorrect check.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: 3.2.291
Aric Cyr [Sun, 23 Jun 2024 20:45:28 +0000 (16:45 -0400)]
drm/amd/display: 3.2.291

* FW Release 0.0.224.0
* Fix bw issue for dcn351
* Fix FAMS2 logic issue for dcn401
* Fix Coverity issues
* Fix cursor issues
* Refactor dio sources

Acked-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Fix array-index-out-of-bounds in dml2/FCLKChangeSupport
Roman Li [Wed, 26 Jun 2024 18:08:41 +0000 (14:08 -0400)]
drm/amd/display: Fix array-index-out-of-bounds in dml2/FCLKChangeSupport

[Why]
Potential out of bounds access in dml2_calculate_rq_and_dlg_params()
because the value of out_lowest_state_idx used as an index for FCLKChangeSupport
array can be greater than 1.

[How]
Currently dml2 core specifies identical values for all FCLKChangeSupport
elements. Always use index 0 in the condition to avoid out of bounds access.

Acked-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Roman Li <Roman.Li@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Update efficiency bandwidth for dcn351
Fangzhi Zuo [Wed, 26 Jun 2024 18:07:49 +0000 (14:07 -0400)]
drm/amd/display: Update efficiency bandwidth for dcn351

Fix 4k240 underflow on dcn351

Acked-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Fix refresh rate range for some panel
Tom Chung [Fri, 14 Jun 2024 07:38:56 +0000 (15:38 +0800)]
drm/amd/display: Fix refresh rate range for some panel

[Why]
Some of the panels does not have the refresh rate range info
in base EDID and only have the refresh rate range info in
DisplayID block.
It will cause the max/min freesync refresh rate set to 0.

[How]
Try to parse the refresh rate range info from DisplayID if the
max/min refresh rate is 0.

Reviewed-by: Sun peng Li <sunpeng.li@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: replace CRTC disable function call
Xi (Alex) Liu [Wed, 12 Jun 2024 16:45:19 +0000 (12:45 -0400)]
drm/amd/display: replace CRTC disable function call

[Why]

In OTG disable workarund, CRTC is disabled immediately
to improve performance, but this may cause timing issue
in DP HPO encoder FIFO and result in blank CRCs.

[How]

Replace the immediate CRTC disable call with normal disable call

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Xi (Alex) Liu <xi.liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Move dio files into dio folder
Bhuvanachandra Pinninti [Thu, 20 Jun 2024 12:24:23 +0000 (17:54 +0530)]
drm/amd/display: Move dio files into dio folder

[why]
Refactor the code of dio to unit test.

[how]
Moved files to respective folders and changed cMakeLists and makefiles.

Acked-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Bhuvanachandra Pinninti <bpinnint@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Account for cursor prefetch BW in DML1 mode support
Alvin Lee [Thu, 20 Jun 2024 19:11:38 +0000 (15:11 -0400)]
drm/amd/display: Account for cursor prefetch BW in DML1 mode support

[Description]
We need to ensure to take into account cursor prefetch BW in
mode support or we may pass ModeQuery but fail an actual flip
which will cause a hang. Flip may fail because the cursor_pre_bw
is populated during mode programming (and mode programming is
never called prior to ModeQuery).

Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com>
Reviewed-by: Nevenko Stupar <nevenko.stupar@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Alvin Lee <alvin.lee2@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: fix a crash when clock source is reference for non otg master pipe
Wenjing Liu [Mon, 17 Jun 2024 16:58:35 +0000 (12:58 -0400)]
drm/amd/display: fix a crash when clock source is reference for non otg master pipe

[why]
The function enumerates all pipes without checking pipe type. It is only
supposed to call program pixel clock for OTG master pipe only.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Fix dmub timeout after fams2 enabled
Fangzhi Zuo [Thu, 20 Jun 2024 15:27:39 +0000 (11:27 -0400)]
drm/amd/display: Fix dmub timeout after fams2 enabled

Reset fams stream count upon stream removal, otherwise
fams2 state machine in dmub will get corrupted.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Add debug option for disabling SLDO optimizations
Nicholas Kazlauskas [Mon, 17 Jun 2024 19:45:51 +0000 (15:45 -0400)]
drm/amd/display: Add debug option for disabling SLDO optimizations

[Why]
DM can hook this up to disable SLDO optimizations in firmware during
DMCUB initialization for debug purposes.

[How]
Add the option and pass it through dmub_srv.

Reviewed-by: Hansen Dsouza <hansen.dsouza@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: un-block 8k with single dimm
Paul Hsieh [Thu, 20 Jun 2024 09:09:25 +0000 (17:09 +0800)]
drm/amd/display: un-block 8k with single dimm

[Why]
Driver doesn't validate multi-display with scaling when OS calls DDI.
This behavior causes the validated result to be a mismatch
between some automated test cases.
To address this issue, some workaround was added that caused issues in 8k.

[How]
Since the origin issue had been root caused,
revert the previous workaround and unblock 8k with a single dimm.

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Paul Hsieh <paul.hsieh@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Add available bandwidth calculation for audio
Ryan Seto [Thu, 20 Jun 2024 17:40:43 +0000 (13:40 -0400)]
drm/amd/display: Add available bandwidth calculation for audio

[Why]
Audio for 8K 240Hz monitor was not available when it should be

[How]
Added calculation based on stream state

Co-developed-by: Ryan Seto <ryanseto@amd.com>
Reviewed-by: George Shen <george.shen@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Ryan Seto <ryanseto@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Add refresh rate range check
Tom Chung [Wed, 19 Jun 2024 06:03:55 +0000 (14:03 +0800)]
drm/amd/display: Add refresh rate range check

[Why]
We only enable the VRR while monitor usable refresh rate range
is greater than 10 Hz.
But we did not check the range in DRM_EDID_FEATURE_CONTINUOUS_FREQ
case.

[How]
Add a refresh rate range check before set the freesync_capable flag
in DRM_EDID_FEATURE_CONTINUOUS_FREQ case.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Cleanup dce_get_dp_ref_freq_khz
Dillon Varone [Wed, 19 Jun 2024 14:05:12 +0000 (10:05 -0400)]
drm/amd/display: Cleanup dce_get_dp_ref_freq_khz

[WHY&HOW]
Cleanup unnecessary code pathes as compile guards were added and removed
overtime.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Dillon Varone <dillon.varone@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Check denominator crb_pipes before used
Alex Hung [Tue, 18 Jun 2024 22:19:48 +0000 (16:19 -0600)]
drm/amd/display: Check denominator crb_pipes before used

[WHAT & HOW]
A denominator cannot be 0, and is checked before used.

This fixes 2 DIVIDE_BY_ZERO issues reported by Coverity.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Check denominator pbn_div before used
Alex Hung [Tue, 18 Jun 2024 22:21:20 +0000 (16:21 -0600)]
drm/amd/display: Check denominator pbn_div before used

[WHAT & HOW]
A denominator cannot be 0, and is checked before used.

This fixes 1 DIVIDE_BY_ZERO issue reported by Coverity.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Adjust cursor visibility between MPC slices
Nevenko Stupar [Wed, 19 Jun 2024 20:08:41 +0000 (16:08 -0400)]
drm/amd/display: Adjust cursor visibility between MPC slices

[Why & How]
When MPC enabled, need to adjust x and hot spot x
position on one pipe when the cursor is between
MPC slices i.e. when the cursor is moving from one
MPC slice to next slice, while whole cursor size is not
contained within one pipe, to make part of the cursor
to be visible on the other pipe.

Reviewed-by: Sridevi Arvindekar <sridevi.arvindekar@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Nevenko Stupar <nevenko.stupar@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Skip unnecessary abm disable
Sherry Wang [Thu, 6 Jun 2024 08:51:43 +0000 (16:51 +0800)]
drm/amd/display: Skip unnecessary abm disable

[Why]
We try to disable abm immediately when it's being gradually
disabled, which causes backlight ramping being paused in the
middle

[How]
Don't disable abm immediately if abm has been or is being
disabled through set_abm_level path

Reviewed-by: Anthony Koo <anthony.koo@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Sherry Wang <yao.wang1@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Fix possible overflow in integer multiplication
Alex Hung [Sat, 8 Jun 2024 04:09:53 +0000 (22:09 -0600)]
drm/amd/display: Fix possible overflow in integer multiplication

[WHAT & HOW]
Integer multiplies integer may overflow in context that expects an
expression of unsigned/siged long long (64 bits). This can be fixed
by casting integer to unsigned/siged long long to force 64 bits results.

This fixes 26 OVERFLOW_BEFORE_WIDEN issues reported by Coverity.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Add ASIC cap to limit DCC surface width
George Shen [Mon, 17 Jun 2024 20:32:15 +0000 (16:32 -0400)]
drm/amd/display: Add ASIC cap to limit DCC surface width

[Why]
Certain configurations of DCN401 require ODM4:1 to support DCC for 10K
surfaces. DCC should be conservatively disabled in those cases.

The issue is that current logic limits 10K surface DCC for all
configurations of DCN401.

[How]
Add DC ASIC cap to indicate max surface width that can support DCC.
Disable DCC if this ASIC cap is non-zero and surface width exceeds it.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: George Shen <george.shen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Revert Add workaround to restrict max frac urgent for DPM0
Teeger [Wed, 19 Jun 2024 13:26:40 +0000 (09:26 -0400)]
drm/amd/display: Revert Add workaround to restrict max frac urgent for DPM0

This reverts commit 871512e36f9c1c2cb4e62eb860ca0438800e4d63
due to multiple issues found.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Teeger <gateeger@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Choose HUBP unbounded request based on DML output
Sung Joon Kim [Fri, 14 Jun 2024 23:14:31 +0000 (19:14 -0400)]
drm/amd/display: Choose HUBP unbounded request based on DML output

[why]
Previously, we decide on the unbounded request
purely based on pipe_cnt which is a wrong variable
to use to determine how many pipes are in "use".
DML already accounts for number of pipes in use
along with other various factors and is a more reliable
method of determination.

[how]
Use UnboundedRequestEnabledThisState to decide
on unbounbded_req_enabled.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Sung Joon Kim <sungjoon.kim@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Remove unnecessary error message
Joshua Aberback [Mon, 17 Jun 2024 19:22:44 +0000 (15:22 -0400)]
drm/amd/display: Remove unnecessary error message

[Why]
This error message is unnecessary because returning when aconnector is
uninitialized is the desired outcome during initialization. As well, there
is no equivalent error message for read_dpcd.

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Joshua Aberback <joshua.aberback@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Fix divide by zero in CURSOR_DST_X_OFFSET calculation
George Shen [Sat, 15 Jun 2024 01:13:43 +0000 (21:13 -0400)]
drm/amd/display: Fix divide by zero in CURSOR_DST_X_OFFSET calculation

[Why]
Certain situations cause pipes to have a recout of 0, such as when the
dst_rect lies completely outside of a given ODM slice.

[How]
Skip calculation that transforms cursor coordinates to viewport space.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: George Shen <george.shen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Reset freesync config before update new state
Tom Chung [Mon, 17 Jun 2024 07:59:06 +0000 (15:59 +0800)]
drm/amd/display: Reset freesync config before update new state

[Why]
Sometimes the new_crtc_state->vrr_infopacket did not sync up with the
current state.
It will affect the update_freesync_state_on_stream() does not update
the state correctly.

[How]
Reset the freesync config before get_freesync_config_for_crtc() to
make sure we have the correct new_crtc_state for VRR.

Reviewed-by: Sun peng Li <sunpeng.li@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Add replay state entry to replay_state
Anthony Koo [Sat, 15 Jun 2024 16:51:44 +0000 (12:51 -0400)]
drm/amd/display: Add replay state entry to replay_state

 - Add new Replay states 2A (initial Replay entry) and 4E (frame update)
   to check is there is new frame update before sending

Acked-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Anthony Koo <anthony.koo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: use vmalloc for struct dc_state
Alex Deucher [Wed, 26 Jun 2024 21:35:41 +0000 (17:35 -0400)]
drm/amd/display: use vmalloc for struct dc_state

This is a big structure so use vmalloc as malloc can
fail when there is memory pressure.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3454
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd: Don't initialize ISP hardware without FW
Mario Limonciello [Tue, 18 Jun 2024 16:43:05 +0000 (11:43 -0500)]
drm/amd: Don't initialize ISP hardware without FW

Although designs may contain an ISP IP block, the camera might be a USB
camera. Because of this the ISP firmware is considered optional from
amdgpu.  However if the firmware doesn't get loaded the hardware should
not be initialized.

Adjust the return code for early init to ensure the IP block doesn't go
through the other init and fini sequences. Also decrease the message
about firmware load failure to debug so it's not as alarming to users.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: refine isp firmware loading
Yang Wang [Thu, 30 May 2024 14:48:34 +0000 (22:48 +0800)]
drm/amdgpu: refine isp firmware loading

refine isp firmware loading

Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/amdgpu: Enable MMHUB prefetch for ISP v4.1.0 and 4.1.1
Pratap Nirujogi [Tue, 28 May 2024 19:21:44 +0000 (15:21 -0400)]
drm/amd/amdgpu: Enable MMHUB prefetch for ISP v4.1.0 and 4.1.1

Remove temporary WA to disable ISP prefetch as MMHUB SAW is initialized
to support ISP HW access GART memory using the TLSi path with prefetch
enabled.

Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/amdgpu: Fix 'snprintf' output truncation warning
Pratap Nirujogi [Mon, 27 May 2024 19:05:47 +0000 (15:05 -0400)]
drm/amd/amdgpu: Fix 'snprintf' output truncation warning

snprintf can truncate the output fw filename if the isp ucode_prefix
exceeds 29 characters. Knowing ISP ucode_prefix is in the format
isp_x_x_x, limiting the size of ucode_prefix[] to 10 characters
to fix the warning.

Fixes the below warning:

   drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c: In function 'isp_early_init':
   drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c:192:58: warning: 'snprintf'
   output may be truncated before the last format character
   [-Wformat-truncation=]
     192 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", ucode_prefix);
         |                                                          ^
   In function 'isp_load_fw_by_psp',
       inlined from 'isp_early_init' at drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c:218:8:
   drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c:192:9: note: 'snprintf' output between 12 and 41 bytes into a destination of size 40
     192 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", ucode_prefix);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/amdgpu: Disable MMHUB prefetch for ISP v4.1.1
Pratap Nirujogi [Thu, 16 May 2024 06:39:14 +0000 (02:39 -0400)]
drm/amd/amdgpu: Disable MMHUB prefetch for ISP v4.1.1

Disable MMHUB prefetch for ISP v4.1.1 as a temporary WA until
the GART supports MMHUB TLSi and SAW for ISP HW to access
GART memory using the TLSi path.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/amdgpu: Add ISP4.1.0 and ISP4.1.1 modules
Pratap Nirujogi [Fri, 17 May 2024 04:39:48 +0000 (00:39 -0400)]
drm/amd/amdgpu: Add ISP4.1.0 and ISP4.1.1 modules

Add independent IP centric modules for ISP4.1.0 and ISP4.1.1 hw blocks.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/amdgpu: Map ISP interrupts as generic IRQs
Pratap Nirujogi [Wed, 8 May 2024 02:49:46 +0000 (22:49 -0400)]
drm/amd/amdgpu: Map ISP interrupts as generic IRQs

Map ISP IH interrupts to Linux generic IRQ for ISP driver to
handle the interrupts using MFD IORESOURCE_IRQ resource.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: fix Kconfig for ISP v2
Alex Deucher [Tue, 14 May 2024 20:45:45 +0000 (16:45 -0400)]
drm/amdgpu: fix Kconfig for ISP v2

Add new config option and set proper dependencies for ISP.

v2: add missed guards, drop separate Kconfig

Reviewed-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Pratap Nirujogi <pratap.nirujogi@amd.com>
10 months agodrm/amd/amdgpu: Enable ISP in amdgpu_discovery
Pratap Nirujogi [Thu, 2 May 2024 23:05:57 +0000 (19:05 -0400)]
drm/amd/amdgpu: Enable ISP in amdgpu_discovery

Enable ISP for ISP V4.1.0 and V4.1.1 in amdgpu_discovery.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/amdgpu: Add ISP driver support
Pratap Nirujogi [Thu, 2 May 2024 22:54:05 +0000 (18:54 -0400)]
drm/amd/amdgpu: Add ISP driver support

Add the isp driver in amdgpu to support ISP device on the APUs that
supports ISP IP block. ISP hw block is used for camera front-end, pre
and post processing operations.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/amdgpu: Add ISP support to amdgpu_discovery
Pratap Nirujogi [Thu, 2 May 2024 20:51:39 +0000 (16:51 -0400)]
drm/amd/amdgpu: Add ISP support to amdgpu_discovery

ISP hw block is supported in some of the AMD GPU versions, add support
to discover ISP IP in amdgpu_discovery.

v2: squash in documentation update (Alex)

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu/jpeg5: Add support for DPG mode
Sonny Jiang [Tue, 18 Jun 2024 18:37:05 +0000 (14:37 -0400)]
drm/amdgpu/jpeg5: Add support for DPG mode

Add DPG support for JPEG 5.0

Signed-off-by: Sonny Jiang <sonjiang@amd.com>
Acked-by: Saleemkhan Jamadar <saleemkhan.jamadar@amd.com>
Reviewed-by: David (Ming Qiang) Wu <David.Wu3@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: tolerate allocating GTT bo with dcc flag
Frank Min [Mon, 13 May 2024 12:51:18 +0000 (20:51 +0800)]
drm/amdgpu: tolerate allocating GTT bo with dcc flag

Do not return failure for allocating GTT bo with dcc flag on gfx12.
This will improve compatibility for UMD.

Signed-off-by: Frank Min <Frank.Min@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Fix null pointer deref in dcn20_resource.c
Aurabindo Pillai [Wed, 26 Jun 2024 17:13:57 +0000 (13:13 -0400)]
drm/amd/display: Fix null pointer deref in dcn20_resource.c

Fixes a hang thats triggered when MPV is run on a DCN401 dGPU:

mpv --hwdec=vaapi --vo=gpu --hwdec-codecs=all

and then enabling fullscreen playback (double click on the video)

The following calltrace will be seen:

[  181.843989] BUG: kernel NULL pointer dereference, address: 0000000000000000
[  181.843997] #PF: supervisor instruction fetch in kernel mode
[  181.844003] #PF: error_code(0x0010) - not-present page
[  181.844009] PGD 0 P4D 0
[  181.844020] Oops: 0010 [#1] PREEMPT SMP NOPTI
[  181.844028] CPU: 6 PID: 1892 Comm: gnome-shell Tainted: G        W  OE      6.5.0-41-generic #41~22.04.2-Ubuntu
[  181.844038] Hardware name: System manufacturer System Product Name/CROSSHAIR VI HERO, BIOS 6302 10/23/2018
[  181.844044] RIP: 0010:0x0
[  181.844079] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
[  181.844084] RSP: 0018:ffffb593c2b8f7b0 EFLAGS: 00010246
[  181.844093] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000004
[  181.844099] RDX: ffffb593c2b8f804 RSI: ffffb593c2b8f7e0 RDI: ffff9e3c8e758400
[  181.844105] RBP: ffffb593c2b8f7b8 R08: ffffb593c2b8f9c8 R09: ffffb593c2b8f96c
[  181.844110] R10: 0000000000000000 R11: 0000000000000000 R12: ffffb593c2b8f9c8
[  181.844115] R13: 0000000000000001 R14: ffff9e3c88000000 R15: 0000000000000005
[  181.844121] FS:  00007c6e323bb5c0(0000) GS:ffff9e3f85f80000(0000) knlGS:0000000000000000
[  181.844128] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  181.844134] CR2: ffffffffffffffd6 CR3: 0000000140fbe000 CR4: 00000000003506e0
[  181.844141] Call Trace:
[  181.844146]  <TASK>
[  181.844153]  ? show_regs+0x6d/0x80
[  181.844167]  ? __die+0x24/0x80
[  181.844179]  ? page_fault_oops+0x99/0x1b0
[  181.844192]  ? do_user_addr_fault+0x31d/0x6b0
[  181.844204]  ? exc_page_fault+0x83/0x1b0
[  181.844216]  ? asm_exc_page_fault+0x27/0x30
[  181.844237]  dcn20_get_dcc_compression_cap+0x23/0x30 [amdgpu]
[  181.845115]  amdgpu_dm_plane_validate_dcc.constprop.0+0xe5/0x180 [amdgpu]
[  181.845985]  amdgpu_dm_plane_fill_plane_buffer_attributes+0x300/0x580 [amdgpu]
[  181.846848]  fill_dc_plane_info_and_addr+0x258/0x350 [amdgpu]
[  181.847734]  fill_dc_plane_attributes+0x162/0x350 [amdgpu]
[  181.848748]  dm_update_plane_state.constprop.0+0x4e3/0x6b0 [amdgpu]
[  181.849791]  ? dm_update_plane_state.constprop.0+0x4e3/0x6b0 [amdgpu]
[  181.850840]  amdgpu_dm_atomic_check+0xdfe/0x1760 [amdgpu]

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Add null check before access structs
Ma Ke [Wed, 26 Jun 2024 13:06:50 +0000 (21:06 +0800)]
drm/amd/display: Add null check before access structs

In enable_phantom_plane, we should better check null pointer before
accessing various structs.

Fixes: 09a4ec5da92c ("drm/amd/display: Refactor dc_state interface")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: normalize registers as local xcc to read/write in gfx_v9_4_3
Jane Jian [Tue, 25 Jun 2024 11:37:43 +0000 (19:37 +0800)]
drm/amdgpu: normalize registers as local xcc to read/write in gfx_v9_4_3

[WHY]
sriov has the higher bit violation when flushing tlb

[HOW]
normalize the registers to keep lower 16-bit(dword aligned) to aviod higher bit violation
RLCG will mask xcd out and always assume it's accessing its own xcd

v2
add check in wait mem that only do the normalization on regspace

Signed-off-by: Jane Jian <Jane.Jian@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Yiqing Yao <YiQing.Yao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd: Add some missing register definitions
Aurabindo Pillai [Tue, 25 Jun 2024 18:17:46 +0000 (14:17 -0400)]
drm/amd: Add some missing register definitions

Add some register offsets that are required for Display DCC on DCN401

Fixes: 2d072b445622 ("drm/amd: Add reg definitions for DCN401 DCC")
Reported-by: Tom St Denis <tom.stdenis@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: add gpu reset check and exception handling
YiPeng Chai [Mon, 24 Jun 2024 03:38:27 +0000 (11:38 +0800)]
drm/amdgpu: add gpu reset check and exception handling

Add gpu reset check and exception handling for
page retirement.

v2:
  Clear poison consumption messages cached in fifo after
non mode-1 reset.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: refine poison consumption interrupt handler
YiPeng Chai [Mon, 24 Jun 2024 03:33:19 +0000 (11:33 +0800)]
drm/amdgpu: refine poison consumption interrupt handler

1. The poison fifo is only used for poison consumption
   requests.
2. Merge reset requests when poison fifo caches multiple
   poison consumption messages

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: refine poison creation interrupt handler
YiPeng Chai [Mon, 24 Jun 2024 03:26:00 +0000 (11:26 +0800)]
drm/amdgpu: refine poison creation interrupt handler

In order to apply to the case where a large number
of ras poison interrupts:
1. Change to use variable to record poison creation
   requests to avoid fifo full.
2. Prioritize handling poison creation requests
   instead of following the order of requests
   received by the driver.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: process RAS fatal error MB notification
Vignesh Chander [Mon, 24 Jun 2024 21:44:26 +0000 (16:44 -0500)]
drm/amdgpu: process RAS fatal error MB notification

For RAS error scenario, VF guest driver will check mailbox
and set fed flag to avoid unnecessary HW accesses.
additionally, poll for reset completion message first
to avoid accidentally spamming multiple reset requests to host.

v2: add another mailbox check for handling case where kfd detects
timeout first

v3: set host_flr bit and use wait_for_reset

Signed-off-by: Vignesh Chander <Vignesh.Chander@amd.com>
Reviewed-by: Zhigang Luo <Zhigang.Luo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: add variable to record the deferred error number read by driver
YiPeng Chai [Mon, 24 Jun 2024 03:21:06 +0000 (11:21 +0800)]
drm/amdgpu: add variable to record the deferred error number read by driver

Add variable to record the deferred error
number read by driver.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: Use dev_ prints for virtualization as it supports multi adapter
Vignesh Chander [Sun, 16 Jun 2024 21:22:10 +0000 (16:22 -0500)]
drm/amdgpu: Use dev_ prints for virtualization as it supports multi adapter

So we can get clearer per device logging.

Signed-off-by: Vignesh Chander <Vignesh.Chander@amd.com>
Reviewed-by: Zhigang Luo <Zhigang.Luo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amdgpu: clear RB_OVERFLOW bit when enabling interrupts
Danijel Slivka [Mon, 24 Jun 2024 05:58:24 +0000 (07:58 +0200)]
drm/amdgpu: clear RB_OVERFLOW bit when enabling interrupts

Why:
Setting IH_RB_WPTR register to 0 will not clear the RB_OVERFLOW bit
if RB_ENABLE is not set.

How to fix:
Set WPTR_OVERFLOW_CLEAR bit after RB_ENABLE bit is set.
The RB_ENABLE bit is required to be set, together with
WPTR_OVERFLOW_ENABLE bit so that setting WPTR_OVERFLOW_CLEAR bit
would clear the RB_OVERFLOW.

Signed-off-by: Danijel Slivka <danijel.slivka@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agoRevert "drm/amd/amdgpu: add module parameter for jpeg"
Kenneth Feng [Wed, 19 Jun 2024 06:10:59 +0000 (14:10 +0800)]
Revert "drm/amd/amdgpu: add module parameter for jpeg"

This reverts commit d3620eeae82cccf8316e6754f8ddb52473e2e5ea.
Revert this due to a final solution:
commit ed3165d660d8 ("drm/amdgpu/jpeg5: reprogram doorbell setting after power up for each playback")

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Sonny Jiang <sonjiang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agoDocumentation/amdgpu: Add Ryzen 9000 series processors
Mario Limonciello [Mon, 24 Jun 2024 19:14:44 +0000 (14:14 -0500)]
Documentation/amdgpu: Add Ryzen 9000 series processors

These have been announced so add them to the table.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://www.amd.com/en/products/processors/desktops/ryzen/9000-series/amd-ryzen-9-9950x.html
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agoDocumentation/amdgpu: Add Ryzen AI 300 series processors
Mario Limonciello [Mon, 24 Jun 2024 19:12:57 +0000 (14:12 -0500)]
Documentation/amdgpu: Add Ryzen AI 300 series processors

These have been announced so add them to the table.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://www.amd.com/en/products/processors/laptop/ryzen/300-series/amd-ryzen-ai-9-hx-370.html
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: use swap() in is_config_schedulable()
Jiapeng Chong [Mon, 24 Jun 2024 01:57:07 +0000 (09:57 +0800)]
drm/amd/display: use swap() in is_config_schedulable()

Use existing swap() function rather than duplicating its implementation.

./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c:1171:103-104: WARNING opportunity for swap().
./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c:1231:99-100: WARNING opportunity for swap().

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9400
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Remove unused function reverse_planes_order
Jiapeng Chong [Mon, 24 Jun 2024 02:22:25 +0000 (10:22 +0800)]
drm/amd/display: Remove unused function reverse_planes_order

The function are defined in the amdgpu_dm.c file, but not called
anywhere, so delete the unused function.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:371:20: warning: unused function 'reverse_planes_order'.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9402
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Use ARRAY_SIZE for array length
Jiapeng Chong [Mon, 24 Jun 2024 03:11:58 +0000 (11:11 +0800)]
drm/amd/display: Use ARRAY_SIZE for array length

Use of macro ARRAY_SIZE to calculate array size minimizes
the redundant code and improves code reusability.

./drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c:164:45-46: WARNING: Use ARRAY_SIZE.
./drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c:183:47-48: WARNING: Use ARRAY_SIZE.
./drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c:237:45-46: WARNING: Use ARRAY_SIZE.
./drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c:257:47-48: WARNING: Use ARRAY_SIZE.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9405
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 months agodrm/amd/display: Fix Makefile copyright notices
Alex Deucher [Mon, 24 Jun 2024 13:54:37 +0000 (09:54 -0400)]
drm/amd/display: Fix Makefile copyright notices

Leftover copy pasta from original code.

Reviewed-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Harry.Wentland@amd.com
10 months agodrm/amdgpu: Don't show false warning for reg list
Lijo Lazar [Mon, 3 Jun 2024 06:42:18 +0000 (12:12 +0530)]
drm/amdgpu: Don't show false warning for reg list

If reg list is already loaded on PSP 13.0.2 SOCs, psp will give
TEE_ERR_CANCEL response on second time load. Avoid printing warn
message for it.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>