]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
4 months agodrm/amd/display: limit coverage of optimization skip
Ausef Yousof [Thu, 30 Jan 2025 17:30:10 +0000 (12:30 -0500)] 
drm/amd/display: limit coverage of optimization skip

[why&how]
causing some regression on dgpu which still needs the
pre-emptive return, limit this to reporter asic version
it is simple to include
different dcn versions from this point forward, each dcn
resource is initialized with the flag and can be enabled
at will

Reviewed-by: Chris Park <chris.park@amd.com>
Signed-off-by: Ausef Yousof <Ausef.Yousof@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: add new IRQ enum for underflows
Leo Zeng [Tue, 28 Jan 2025 20:47:27 +0000 (15:47 -0500)] 
drm/amd/display: add new IRQ enum for underflows

[WHY & HOW]
needed in certain scenarios for debugging and logging

Reviewed-by: Joshua Aberback <joshua.aberback@amd.com>
Reviewed-by: Martin Leung <martin.leung@amd.com>
Signed-off-by: Leo Zeng <Leo.Zeng@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: remove TF check for LLS policy
Samson Tam [Mon, 27 Jan 2025 23:27:06 +0000 (18:27 -0500)] 
drm/amd/display: remove TF check for LLS policy

[Why & How]
LLS policy not affected by TF.
Remove check in don't care case and use
 pixel format only.

Reviewed-by: Navid Assadian <navid.assadian@amd.com>
Signed-off-by: Samson Tam <Samson.Tam@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: use s1_12 filter tables in SPL
Samson Tam [Mon, 27 Jan 2025 23:44:56 +0000 (18:44 -0500)] 
drm/amd/display: use s1_12 filter tables in SPL

[Why & How]
Instead of converting tables from s1_10 to s1_12,
 added s1_12 tables instead in SPL
Remove init calls that do the conversion

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Samson Tam <Samson.Tam@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: DML21 Reintegration
Austin Zheng [Tue, 21 Jan 2025 22:10:27 +0000 (17:10 -0500)] 
drm/amd/display: DML21 Reintegration

For various fixes to mcache_row_bytes calculation.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Austin Zheng <Austin.Zheng@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Don't try AUX transactions on disconnected link
Ilya Bakoulin [Tue, 28 Jan 2025 18:14:54 +0000 (13:14 -0500)] 
drm/amd/display: Don't try AUX transactions on disconnected link

[Why]
Setting link DPMS off in response to HPD disconnect creates AUX
transactions on a link that is supposed to be disconnected. This can
cause issues in some cases when the sink re-asserts HPD and expects
source to re-enable the link.

[How]
Avoid AUX transactions on disconnected link.

Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Ilya Bakoulin <Ilya.Bakoulin@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: docstring definitions MAX_SURFACES and MAX_PLANES
Zaeem Mohamed [Fri, 27 Sep 2024 14:15:49 +0000 (10:15 -0400)] 
drm/amd/display: docstring definitions MAX_SURFACES and MAX_PLANES

MAX_SURFACES and MAX_PLANES now have docstrings that better show the difference between the two.

Reviewed-by: Sun peng Li <sunpeng.li@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Expose 3 secondary planes for supported ASICs
Zaeem Mohamed [Fri, 6 Sep 2024 16:36:04 +0000 (12:36 -0400)] 
drm/amd/display: Expose 3 secondary planes for supported ASICs

[why]
For enabling 4-plane MPO, we need dc to expose 4 planes for DCN35 and
beyond, as well as DCN21

[how]
Set dc_caps.max_slave_*planes to 3 for appropriate ASICs

Reviewed-by: Sun peng Li <sunpeng.li@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: add discovery support for DCN IP version 3.6.0
Tim Huang [Thu, 2 Jan 2025 06:30:35 +0000 (14:30 +0800)] 
drm/amdgpu: add discovery support for DCN IP version 3.6.0

Add discovery entry for DCN IP version 3.6.0.

Signed-off-by: Tim Huang <tim.huang@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd: Refactor find_system_memory()
Mario Limonciello [Thu, 6 Feb 2025 21:48:35 +0000 (15:48 -0600)] 
drm/amd: Refactor find_system_memory()

find_system_memory() pulls out two fields from an SMBIOS type 17
device and sets them on KFD devices. The data offsets are counted
to find interesting data.

Instead use a struct representation to access the members and pull
out the two specific fields.

No intended functional changes.

Link: https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.8.0.pdf
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Link: https://lore.kernel.org/r/20250206214847.3334595-1-superm1@kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: reset psp->cmd to NULL after releasing the buffer
Jiang Liu [Fri, 7 Feb 2025 06:28:49 +0000 (14:28 +0800)] 
drm/amdgpu: reset psp->cmd to NULL after releasing the buffer

Reset psp->cmd to NULL after releasing the buffer in function psp_sw_fini().

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Jiang Liu <gerry@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Add flags to distinguish vf/pf/pt mode
Asad Kamal [Mon, 27 May 2024 04:15:15 +0000 (12:15 +0800)] 
drm/amdgpu: Add flags to distinguish vf/pf/pt mode

Add extra flag definition for ids_flag field to distinguish
between vf/pf/pt modes

v2: Updated kms driver minor version & removed pf check as default is 0
v3: Fix up version (Alex)
v4: rebase (Alex)

Proposed userspace:
https://github.com/ROCm/amdsmi/commit/e663bed7d6b3df79f5959e73981749b1f22ec698

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdkfd: use GTT for VRAM on APUs only if GTT is larger
Alex Deucher [Thu, 30 Jan 2025 20:20:05 +0000 (15:20 -0500)] 
drm/amdkfd: use GTT for VRAM on APUs only if GTT is larger

If the user has configured a large carveout on a small APU,
only use GTT for VRAM allocations if GTT is larger than
VRAM.

v2: fix reversed check (Philip)

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdkfd: add a new flag to manage where VRAM allocations go
Alex Deucher [Thu, 30 Jan 2025 20:12:58 +0000 (15:12 -0500)] 
drm/amdkfd: add a new flag to manage where VRAM allocations go

On big and small APUs we send KFD VRAM allocations to GTT
since the carve out is either non-existent or relatively
small.  However, if someone sets the carve out size to be
relatively large, we may end up using GTT rather than VRAM.

No change of logic with this patch, but it allows the
driver to determine which logic to use based on the
carve out size in the future.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Make VBIOS image read optional
Lijo Lazar [Wed, 5 Feb 2025 08:40:48 +0000 (14:10 +0530)] 
drm/amdgpu: Make VBIOS image read optional

Keep VBIOS image read optional for select SOCs in passthrough mode.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Add flag to make VBIOS read optional
Lijo Lazar [Wed, 5 Feb 2025 08:36:58 +0000 (14:06 +0530)] 
drm/amdgpu: Add flag to make VBIOS read optional

Certain SOCs may not need much data from VBIOS. Some data like VBIOS
version used will be missed but it doesn't affect functionality. Add a
flag to make VBIOS image optional.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Add VBIOS flags
Lijo Lazar [Wed, 5 Feb 2025 06:32:51 +0000 (12:02 +0530)] 
drm/amdgpu: Add VBIOS flags

Instead of read_bios, use get_bios_flags to get various options around
reading VBIOS.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Add wrapper for freeing vbios memory
Lijo Lazar [Wed, 5 Feb 2025 06:54:17 +0000 (12:24 +0530)] 
drm/amdgpu: Add wrapper for freeing vbios memory

Use bios_release wrapper to release memory allocated for vbios image and
reset the variables.

v2:
Use the same wrapper for clean up in sw_fini (Alex Deucher)

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Add DCN36 DM Support
Wayne Lin [Fri, 10 Jan 2025 13:20:49 +0000 (21:20 +0800)] 
drm/amd/display: Add DCN36 DM Support

Add DM handling for DCN36.

Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Add DCN36 CORE
Wayne Lin [Fri, 10 Jan 2025 13:19:52 +0000 (21:19 +0800)] 
drm/amd/display: Add DCN36 CORE

Add DCN36 support in dc_resource.c.

Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Martin Leung <martin.leung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Support DCN36 HDCP
Wayne Lin [Fri, 10 Jan 2025 13:17:55 +0000 (21:17 +0800)] 
drm/amd/display: Support DCN36 HDCP

Add case in hdcp_create_workqueue() to support HDCP on DCN36 as well.

Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Support DCN36 DSC
Wayne Lin [Fri, 10 Jan 2025 13:13:40 +0000 (21:13 +0800)] 
drm/amd/display: Support DCN36 DSC

Add case on clean_up_dsc_blocks() to support DCN36 as well.

Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Martin Leung <martin.leung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Add DCN36 DMCUB
Wayne Lin [Fri, 10 Jan 2025 13:08:20 +0000 (21:08 +0800)] 
drm/amd/display: Add DCN36 DMCUB

DMCU-B (Display Micro-Controller Unit B) is a display microcontroller
used for shared display functionality with BIOS and for advanced
power saving display features.

Add case to support DCN3.6 as well.

V2: adjust copyright license text

Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Martin Leung <martin.leung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Add DCN36 DML2 support
Wayne Lin [Fri, 10 Jan 2025 12:41:03 +0000 (20:41 +0800)] 
drm/amd/display: Add DCN36 DML2 support

Enable DML2 for DCN36.

Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Martin Leung <martin.leung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Add DCN36 GPIO
Wayne Lin [Fri, 10 Jan 2025 12:37:14 +0000 (20:37 +0800)] 
drm/amd/display: Add DCN36 GPIO

Add DCN36 support in GPIO.

Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Martin Leung <martin.leung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Add DCN36 Resource
Wayne Lin [Fri, 10 Jan 2025 12:32:48 +0000 (20:32 +0800)] 
drm/amd/display: Add DCN36 Resource

Add resource handling for DCN36.

V2: adjust copyright license text
V3: remove unnecessary headers

Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Martin Leung <martin.leung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Add DCN36 IRQ
Wayne Lin [Fri, 10 Jan 2025 12:27:27 +0000 (20:27 +0800)] 
drm/amd/display: Add DCN36 IRQ

Add IRQ services for DCN36.
This allows us to create/init and manage irqs for DCN3

V2: adjust copyright license text

Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Martin Leung <martin.leung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Add DCN36 BIOS command table support
Wayne Lin [Fri, 10 Jan 2025 12:55:42 +0000 (20:55 +0800)] 
drm/amd/display: Add DCN36 BIOS command table support

Add case for DCN36 in command_table_helper2.c.

Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Martin Leung <martin.leung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Add DCN36 version identifiers
Wayne Lin [Fri, 10 Jan 2025 12:24:08 +0000 (20:24 +0800)] 
drm/amd/display: Add DCN36 version identifiers

Add DCN3.6 asic identifiers.

Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Martin Leung <martin.leung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Add dcn36 register header files
Wayne Lin [Fri, 10 Jan 2025 12:10:34 +0000 (20:10 +0800)] 
drm/amd/display: Add dcn36 register header files

[Why & How]
Add register headers for DCN36.

V2: adjust copyright license text

Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu/gfx9: use amdgpu_gfx_off_ctrl_immediate() for PG
Alex Deucher [Fri, 31 Jan 2025 02:25:12 +0000 (21:25 -0500)] 
drm/amdgpu/gfx9: use amdgpu_gfx_off_ctrl_immediate() for PG

Use amdgpu_gfx_off_ctrl_immediate() when powergating.
There's no need for the delay in gfx off allow.  The
powergating is dynamically disabled/enabled as for
RV/PCO on compute queues and allowing gfx off again as
soon the job is submitted improves power savings.

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Suggested-by: Błażej Szczygieł <mumei6102@gmail.com>
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3861
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu/gfx: add amdgpu_gfx_off_ctrl_immediate()
Alex Deucher [Fri, 31 Jan 2025 02:20:57 +0000 (21:20 -0500)] 
drm/amdgpu/gfx: add amdgpu_gfx_off_ctrl_immediate()

Same as amdgpu_gfx_off_ctrl(), but without the delay
for gfxoff disallow.

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Suggested-by: Błażej Szczygieł <mumei6102@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/include : MES v11 and v12 API header update
Shaoyun Liu [Wed, 5 Feb 2025 18:16:45 +0000 (13:16 -0500)] 
drm/amd/include : MES v11 and v12 API header update

MES requires driver set cleaner_shader_fence_mc_addr
for cleaner shader support.

Signed-off-by: Shaoyun Liu <shaoyun.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/pm: Remove unnecessary device state checks
Lijo Lazar [Tue, 4 Feb 2025 06:32:41 +0000 (12:02 +0530)] 
drm/amd/pm: Remove unnecessary device state checks

For amdgpu_get_pp_force_state, amdgpu_get_pp_cur_state already takes
care of device state check. In other cases, values are returned from
driver cached variables and are not dependent on device state.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Feifei Xu <feifei.xu@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/pm: Fix get_if_active usage
Lijo Lazar [Tue, 4 Feb 2025 06:23:26 +0000 (11:53 +0530)] 
drm/amd/pm: Fix get_if_active usage

If a device supports runtime pm, then pm_runtime_get_if_active returns 0
if a device is not active and 1 if already active. However, if a device
doesn't support runtime pm, the API returns -EINVAL. A device not
supporting runtime pm implies it's not affected by runtime pm and it's
active. Hence no need to get() to increment usage count. Remove < 0
return value check. Also, ignore runpm state to determine active status.
If the device is already in suspend state, disallow access.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Feifei Xu <feifei.xu@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/pm: Add APIs for device access checks
Lijo Lazar [Tue, 4 Feb 2025 05:44:21 +0000 (11:14 +0530)] 
drm/amd/pm: Add APIs for device access checks

Wrap the checks before device access in helper functions and use them
for device access. The generic order of APIs now is to do input argument
validation first and check if device access is allowed.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Feifei Xu <feifei.xu@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Clean up atom header file inclusion
Lijo Lazar [Wed, 5 Feb 2025 07:36:44 +0000 (13:06 +0530)] 
drm/amdgpu: Clean up atom header file inclusion

atom bios header files are not required in these files.

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>
4 months agodrm/amdgpu/sdma4: drop gfxoff calls in dump ip state
Alex Deucher [Mon, 3 Feb 2025 15:35:33 +0000 (10:35 -0500)] 
drm/amdgpu/sdma4: drop gfxoff calls in dump ip state

SDMA 4.x is not part of the GFX power domain so this is
not necessary.

Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Replace pr_info in dc_validate_boot_timing()
Alex Hung [Mon, 3 Feb 2025 18:02:03 +0000 (11:02 -0700)] 
drm/amd/display: Replace pr_info in dc_validate_boot_timing()

Use DC_LOG_DEBUG instead of pr_info to match other uses in dc.c.

Fixes: 091e301c2b41 ("drm/amd/display: Add debug messages for dc_validate_boot_timing()")
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Remove unused link_enc_cfg_get_link_enc_used_by_stream
Dr. David Alan Gilbert [Sun, 2 Feb 2025 21:58:56 +0000 (21:58 +0000)] 
drm/amd/display: Remove unused link_enc_cfg_get_link_enc_used_by_stream

link_enc_cfg_get_link_enc_used_by_stream() is no longer used after
2021's:
commit 6366b00346c0 ("drm/amd/display: Maintain consistent mode of
operation during encoder assignment")
which introduces and uses the _current version instead.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Remove unused get_max_support_fbc_buffersize
Dr. David Alan Gilbert [Sun, 2 Feb 2025 21:58:55 +0000 (21:58 +0000)] 
drm/amd/display: Remove unused get_max_support_fbc_buffersize

get_max_support_fbc_buffersize() is unused since 2021's
commit 94f0d0c80cf3 ("drm/amd/display/dc/dce110/dce110_compressor: Remove
unused function 'dce110_get_required_compressed_surfacesize")
removed it's only caller.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Remove unused hubbub1_toggle_watermark_change_req
Dr. David Alan Gilbert [Sun, 2 Feb 2025 21:58:54 +0000 (21:58 +0000)] 
drm/amd/display: Remove unused hubbub1_toggle_watermark_change_req

hubbub1_toggle_watermark_change_req() last use was removed in 2017 by
commit b8fce2c9d773 ("drm/amd/display: Optimize programming front end")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Remove unused get_clock_requirements_for_state
Dr. David Alan Gilbert [Sun, 2 Feb 2025 21:58:53 +0000 (21:58 +0000)] 
drm/amd/display: Remove unused get_clock_requirements_for_state

get_clock_requirements_for_state() was added in 2018 by
commit 8ab2180f96f5 ("drm/amd/display: Add function to fetch clock
requirements")
but never used.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Remove unused dc_stream_get_crtc_position
Dr. David Alan Gilbert [Sun, 2 Feb 2025 21:58:52 +0000 (21:58 +0000)] 
drm/amd/display: Remove unused dc_stream_get_crtc_position

The last user of dc_stream_get_crtc_position() was
mod_freesync_get_v_position() which is removed in a previous
patch in this series.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Remove unused freesync functions
Dr. David Alan Gilbert [Sun, 2 Feb 2025 21:58:51 +0000 (21:58 +0000)] 
drm/amd/display: Remove unused freesync functions

mod_freesync_get_vmin_vmax() and mod_freesync_get_v_position() were
added in 2017 by
commit 72ada5f76939 ("drm/amd/display: FreeSync Auto Sweep Support")

mod_freesync_is_valid_range() was added in 2018 by
commit e80e94460841 ("drm/amd/display: add method to check for supported
range")

mod_freesync_get_settings() was added in 2018 by
commit a3e1737ed61c ("drm/amd/display: Implement stats logging")

and
mod_freesync_calc_field_rate_from_timing() was added in 2020 by
commit 49c70ece54b0 ("drm/amd/display: Change input parameter for
set_drr")

None of these have been used.

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Remove unused mpc1_is_mpcc_idle
Dr. David Alan Gilbert [Sun, 2 Feb 2025 21:58:50 +0000 (21:58 +0000)] 
drm/amd/display: Remove unused mpc1_is_mpcc_idle

mpc1_is_mpcc_idle() was added in 2017 by
commit feb4a3cd8eb0 ("drm/amd/display: Integrating MPC pseudocode")
but never used.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/pm: Limit to 8 jpeg rings per instance
Lijo Lazar [Fri, 31 Jan 2025 12:46:12 +0000 (18:16 +0530)] 
drm/amd/pm: Limit to 8 jpeg rings per instance

JPEG 5.0.1 supports upto 10 rings, however PMFW support for SMU v13.0.6
variants is now limited to 8 per instance. Limit to 8 temporarily to
avoid out of bounds access.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Enable devcoredump for JPEG5_0_0
Sathishkumar S [Thu, 30 Jan 2025 07:05:42 +0000 (12:35 +0530)] 
drm/amdgpu: Enable devcoredump for JPEG5_0_0

Add register list and enable devcoredump for JPEG5_0_0

V2: (Lijo)
 - remove version specific callbacks and use simplified helper functions

V3: (Lijo)
 - move amdgpu_jpeg_reg_dump_fini() to sw_fini() and avoid the call here

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Enable devcoredump for JPEG2_5_0
Sathishkumar S [Wed, 29 Jan 2025 06:43:17 +0000 (12:13 +0530)] 
drm/amdgpu: Enable devcoredump for JPEG2_5_0

Add register list and enable devcoredump for JPEG2_5_0

V2: (Lijo)
- remove version specific callbacks and use simplified helper functions

V3: (Lijo)
- move amdgpu_jpeg_reg_dump_fini() to sw_fini() and avoid the call here

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Enable devcoredump for JPEG2_0_0
Sathishkumar S [Wed, 29 Jan 2025 06:38:48 +0000 (12:08 +0530)] 
drm/amdgpu: Enable devcoredump for JPEG2_0_0

Add register list and enable devcoredump for JPEG2_0_0

V2: (Lijo)
- remove version specific callbacks and use simplified helper functions

V3: (Lijo)
- move amdgpu_jpeg_reg_dump_fini() to sw_fini() and avoid the call here

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Enable devcoredump for JPEG3_0_0
Sathishkumar S [Wed, 29 Jan 2025 06:31:18 +0000 (12:01 +0530)] 
drm/amdgpu: Enable devcoredump for JPEG3_0_0

Add register list and enable devcoredump for JPEG3_0_0

V2: (Lijo)
- remove version specific callbacks and use simplified helper functions

V3: (Lijo)
- move amdgpu_jpeg_reg_dump_fini() to sw_fini() and avoid the call here

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Enable devcoredump for JPEG4_0_5
Sathishkumar S [Wed, 29 Jan 2025 05:22:35 +0000 (10:52 +0530)] 
drm/amdgpu: Enable devcoredump for JPEG4_0_5

Add register list and enable devcoredump for JPEG4_0_5

V2: (Lijo)
- remove version specific callbacks and use simplified helper functions

V3: (Lijo)
- move amdgpu_jpeg_reg_dump_fini() to sw_fini() and avoid the call here

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Enable devcoredump for JPEG4_0_0
Sathishkumar S [Wed, 29 Jan 2025 05:16:15 +0000 (10:46 +0530)] 
drm/amdgpu: Enable devcoredump for JPEG4_0_0

Add register list and enable devcoredump for JPEG4_0_0

V2: (Lijo)
- remove version specific callbacks and use simplified helper functions

V3: (Lijo)
- move amdgpu_jpeg_reg_dump_fini() to sw_fini() and avoid the call here

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Enable devcoredump for JPEG5_0_1
Sathishkumar S [Wed, 29 Jan 2025 05:01:32 +0000 (10:31 +0530)] 
drm/amdgpu: Enable devcoredump for JPEG5_0_1

Add register list and enable devcoredump for JPEG5_0_1

V2: (Lijo)
- remove version specific callbacks and use simplified helper functions

V3: (Lijo)
- move amdgpu_jpeg_reg_dump_fini() to sw_fini() and avoid the call here

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Enable devcoredump for JPEG4_0_3
Sathishkumar S [Tue, 28 Jan 2025 19:23:52 +0000 (00:53 +0530)] 
drm/amdgpu: Enable devcoredump for JPEG4_0_3

Add register list and enable devcoredump for JPEG4_0_3

V2: (Lijo)
 - remove version specific callbacks and use simplified helper functions

V3: (Lijo)
 - move amdgpu_jpeg_reg_dump_fini() to sw_fini() and avoid the call here

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Add helper funcs for jpeg devcoredump
Sathishkumar S [Tue, 28 Jan 2025 18:27:03 +0000 (23:57 +0530)] 
drm/amdgpu: Add helper funcs for jpeg devcoredump

Add devcoredump helper functions that can be reused for all jpeg versions.

V2: (Lijo)
 - add amdgpu_jpeg_reg_dump_init() and amdgpu_jpeg_reg_dump_fini()
 - use reg_list and reg_count from init() to dump and print registers
 - memory allocation and freeing is moved to the init() and fini()

V3: (Lijo)
 - move amdgpu_jpeg_reg_dump_fini() to sw_fini()

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Enable IFWI update support with PSPv13.0.12
Shiwu Zhang [Tue, 22 Oct 2024 09:14:44 +0000 (17:14 +0800)] 
drm/amdgpu: Enable IFWI update support with PSPv13.0.12

Make psp_vbflash_status and psp_vbflash available in sysfs

Signed-off-by: Shiwu Zhang <shiwu.zhang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/pm: Skip P2S load for SMU v13.0.12
Asad Kamal [Thu, 19 Dec 2024 11:16:37 +0000 (19:16 +0800)] 
drm/amd/pm: Skip P2S load for SMU v13.0.12

Skip P2S table load for SMU v13.0.12

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Add support for smuio 13.0.11
Mangesh Gadre [Thu, 30 Jan 2025 05:36:45 +0000 (13:36 +0800)] 
drm/amdgpu: Add support for smuio 13.0.11

Add new IP version support

Signed-off-by: Mangesh Gadre <Mangesh.Gadre@amd.com>
Signed-off-by: Shiwu Zhang <shiwu.zhang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Add support for nbio 7.9.1
Mangesh Gadre [Thu, 30 Jan 2025 05:33:48 +0000 (13:33 +0800)] 
drm/amdgpu: Add support for nbio 7.9.1

Add new IP version support

Signed-off-by: Mangesh Gadre <Mangesh.Gadre@amd.com>
Signed-off-by: Shiwu Zhang <shiwu.zhang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Add support for smu 13.0.12
Mangesh Gadre [Thu, 30 Jan 2025 05:30:02 +0000 (13:30 +0800)] 
drm/amdgpu: Add support for smu 13.0.12

Add new IP version support

Signed-off-by: Mangesh Gadre <Mangesh.Gadre@amd.com>
Signed-off-by: Shiwu Zhang <shiwu.zhang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Add support for umc 12.5.0/mmhub 1.8.1
Mangesh Gadre [Thu, 30 Jan 2025 05:19:17 +0000 (13:19 +0800)] 
drm/amdgpu: Add support for umc 12.5.0/mmhub 1.8.1

Add new IP version support

Signed-off-by: Mangesh Gadre <Mangesh.Gadre@amd.com>
Signed-off-by: Shiwu Zhang <shiwu.zhang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: 3.2.319
Taimur Hassan [Mon, 27 Jan 2025 06:31:18 +0000 (01:31 -0500)] 
drm/amd/display: 3.2.319

- Move SPL to a new path
- Request HW cursor on DCN3.2 with SubVP
- Allow reuse of of DCN4x code
- Enable odm 4:1 when debug key is set
- Fix seamless boot sequence
- Support multiple options during psr entry.
- Revert "Exit idle optimizations before attempt to access PHY"
- Fix out-of-bound accesses
- Fixes for mcache programming in DML21

Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@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>
4 months agodrm/amd/display: Move SPL to a new path
Samson Tam [Thu, 23 Jan 2025 19:36:57 +0000 (14:36 -0500)] 
drm/amd/display: Move SPL to a new path

[WHY & HOW]
- Move SPL from dc/spl to dc/sspl
- Update build files and header paths
- Remove dc/spl files

Reviewed-by: George Zhang <george.zhang@amd.com>
Signed-off-by: Samson Tam <Samson.Tam@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>
4 months agodrm/amd/display: Request HW cursor on DCN3.2 with SubVP
Aric Cyr [Thu, 23 Jan 2025 21:39:52 +0000 (16:39 -0500)] 
drm/amd/display: Request HW cursor on DCN3.2 with SubVP

[WHY]
When SubVP is active the HW cursor size is limited to 64x64, and
anything larger will force composition which is bad for gaming on
DCN3.2 if the game uses a larger cursor.

[HOW]
If HW cursor is requested, typically by a fullscreen game, do not
enable SubVP so that up to 256x256 cursor sizes are available for
DCN3.2.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Aric Cyr <Aric.Cyr@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>
4 months agodrm/amd/display: Allow reuse of of DCN4x code
Dmytro [Fri, 25 Oct 2024 14:31:18 +0000 (10:31 -0400)] 
drm/amd/display: Allow reuse of of DCN4x code

Remove the static qualifier to make it available for code sharing
with other components.

Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Signed-off-by: Dmytro <dmytro.laktyushkin@amd.com>
Signed-off-by: Charlene Liu <Charlene.Liu@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>
4 months agodrm/amd/display: Enable odm 4:1 when debug key is set
Muhammad Ahmed [Tue, 21 Jan 2025 21:24:04 +0000 (16:24 -0500)] 
drm/amd/display: Enable odm 4:1 when debug key is set

[WHAT]
odm 4to1 is enabled when debug key is set.

Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Muhammad Ahmed <muhammad.ahmed@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>
4 months agodrm/amdgpu: Add a func for core specific reg offset
Sathishkumar S [Thu, 16 Jan 2025 19:25:04 +0000 (00:55 +0530)] 
drm/amdgpu: Add a func for core specific reg offset

Add an inline function to calculate core specific register offsets for
JPEG v4.0.3 and reuse it, makes code more readable and easier to align.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Support multiple options during psr entry.
Martin Tsai [Mon, 20 Jan 2025 03:21:46 +0000 (11:21 +0800)] 
drm/amd/display: Support multiple options during psr entry.

[WHY]
Some panels may not handle idle pattern properly during PSR entry.

[HOW]
Add a condition to allow multiple options on power down
sequence during PSR1 entry.

Reviewed-by: Anthony Koo <anthony.koo@amd.com>
Signed-off-by: Martin Tsai <Martin.Tsai@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>
4 months agoRevert "drm/amd/display: Exit idle optimizations before attempt to access PHY"
Brandon Syu [Tue, 21 Jan 2025 05:29:51 +0000 (13:29 +0800)] 
Revert "drm/amd/display: Exit idle optimizations before attempt to access PHY"

This reverts commit de612738e9771bd66aeb20044486c457c512f684.

Reason to revert: screen flashes or gray screen appeared half of the
screen after resume from S4/S5.

Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Signed-off-by: Brandon Syu <Brandon.Syu@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>
4 months agodrm/amd/display: Fixes for mcache programming in DML21
Dillon Varone [Fri, 17 Jan 2025 22:49:41 +0000 (17:49 -0500)] 
drm/amd/display: Fixes for mcache programming in DML21

[WHY & HOW]
- Fix indexing phantom planes for mcache programming in the wrapper
- Fix phantom mcache allocations to align with HW guidance
- Fix mcache assignment for chroma plane for multi-planar formats

Reviewed-by: Austin Zheng <Austin.Zheng@amd.com>
Signed-off-by: Dillon Varone <dillon.varone@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>
4 months agodrm/amdgpu: Clean up IP version checks in gmcv9.0
Lijo Lazar [Tue, 28 Jan 2025 07:25:39 +0000 (12:55 +0530)] 
drm/amdgpu: Clean up IP version checks in gmcv9.0

Clean up some IP version checks in gmcv9.0

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Clean up GFX v9.4.3 IP version checks
Lijo Lazar [Tue, 28 Jan 2025 05:32:32 +0000 (11:02 +0530)] 
drm/amdgpu: Clean up GFX v9.4.3 IP version checks

Remove unnecessary IP version checks for GFX 9.4.3 and similar variants.
Wrap checks inside meaningful function.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Use version to figure out harvest info
Lijo Lazar [Tue, 28 Jan 2025 06:09:13 +0000 (11:39 +0530)] 
drm/amdgpu: Use version to figure out harvest info

IP tables with version <=2 may use harvest bit. For version 3 and above,
harvest bit is not applicable, instead uses harvest table. Fix the
logic accordingly.

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>
4 months agodrm/amdgpu: Pass IP instance/hwid as parameters
Lijo Lazar [Tue, 28 Jan 2025 05:54:36 +0000 (11:24 +0530)] 
drm/amdgpu: Pass IP instance/hwid as parameters

Use IP instance number and hwid as function args for validation checks.

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>
4 months agodrm/amdgpu/gfx10: Enable cleaner shader for GFX10.1.1/10.1.2 GPUs
Srinivasan Shanmugam [Fri, 24 Jan 2025 06:21:53 +0000 (11:51 +0530)] 
drm/amdgpu/gfx10: Enable cleaner shader for GFX10.1.1/10.1.2 GPUs

Enable the cleaner shader for GFX10.1.1/10.1.2 GPUs to provide data
isolation between GPU workloads. The cleaner shader is responsible for
clearing the Local Data Store (LDS), Vector General Purpose Registers
(VGPRs), and Scalar General Purpose Registers (SGPRs), which helps
prevent data leakage and ensures accurate computation results.

This update extends cleaner shader support to GFX10.1.1/10.1.2 GPUs,
previously available for GFX10.1.10. It enhances security by clearing
GPU memory between processes and maintains a consistent GPU state across
KGD and KFD workloads.

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: update and cleanup PM4 headers
Alex Deucher [Mon, 20 Jan 2025 19:30:59 +0000 (14:30 -0500)] 
drm/amdgpu: update and cleanup PM4 headers

Consolidate PM4 definitions.  Most of these were previously
only defined in UMDs.  Add them here as well and sync with
latest packets.  Also no need to include soc15d.h on gfx10+.

Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Suggested-by: Saurabh Verma <saurabh.verma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: 3.2.318
Aric Cyr [Mon, 20 Jan 2025 02:45:59 +0000 (21:45 -0500)] 
drm/amd/display: 3.2.318

This version brings along the following fixes:

- Fixes on psr_version, dcn35 register address, DCPG OP control sequences
- Imporvements to CR AUX RD interval interpretation, dio link encoder
- Disable PSR-SU on some OLED panels

Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: refactor dio link encoder assigning
Peichen Huang [Mon, 23 Dec 2024 03:09:52 +0000 (11:09 +0800)] 
drm/amd/display: refactor dio link encoder assigning

[WHY]
We would like to have new dio encoder assigning flow.
Which should be aligned with hpo assigning and have
simple logic and data representation.

[HOW}
1. A new config option to enable/disable the new code.
2. Encoder-link mapping is in res_ctx and assigned encoder.
is accessed through pipe_ctx.
3. assign dio encoder when add stream to ctx

Reviewed-by: Jun Lei <jun.lei@amd.com>
Reviewed-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Signed-off-by: Peichen Huang <PeiChen.Huang@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Guard Possible Null Pointer Dereference
Sung Lee [Thu, 16 Jan 2025 14:45:54 +0000 (09:45 -0500)] 
drm/amd/display: Guard Possible Null Pointer Dereference

[WHY]
In some situations, dc->res_pool may be null.

[HOW]
Check if pointer is null before dereference.

Reviewed-by: Joshua Aberback <joshua.aberback@amd.com>
Signed-off-by: Sung Lee <Sung.Lee@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Add boot option to reduce PHY SSC for HBR3
Hansen Dsouza [Wed, 15 Jan 2025 19:21:24 +0000 (14:21 -0500)] 
drm/amd/display: Add boot option to reduce PHY SSC for HBR3

[Why]
Spread on DPREFCLK by 0.3 percent can have a negative effect on sink
when PHY SSC is also spread by 0.3 percent
[How]
Add boot option for DMU to lower PHY SSC

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Hansen Dsouza <Hansen.Dsouza@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Ammend DCPG IP control sequences to align with HW guidance
Dillon Varone [Tue, 14 Jan 2025 17:14:26 +0000 (12:14 -0500)] 
drm/amd/display: Ammend DCPG IP control sequences to align with HW guidance

[WHY&HOW]
IP_REQUEST_CNTL should only be toggled off when it was originally, never
unconditionally.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Disable PSR-SU on some OLED panel
Tom Chung [Fri, 10 Jan 2025 08:09:45 +0000 (16:09 +0800)] 
drm/amd/display: Disable PSR-SU on some OLED panel

[Why]
PSR-SU may cause some glitching randomly on some OLED panel.

[How]
Disable the PSR-SU for certain PSR-SU OLED panel.

Reviewed-by: Sun peng Li <sunpeng.li@amd.com>
Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Account For OTO Prefetch Bandwidth When Calculating Urgent Bandwidth
Austin Zheng [Mon, 13 Jan 2025 19:13:51 +0000 (14:13 -0500)] 
drm/amd/display: Account For OTO Prefetch Bandwidth When Calculating Urgent Bandwidth

[Why]
1) The current calculations for OTO prefetch bandwidth do not consider the number of DPP pipes in use.
As a result, OTO prefetch bandwidth may be larger than the vactive bandwidth if multiple DPP pipes are used.
OTO prefetch bandwidth should never exceed the vactive bandwidth.

2) Mode programming may be mismatched with mode support
In cases where mode support has chosen to use the equalized (equ) prefetch schedule,
mode programming may end up using oto prefetch schedule instead.
The bandwidth required to do the oto schedule may end up being higher than the equ schedule.
This can cause the required urgent bandwidth to exceed the available urgent bandwidth.

[How]
Output the oto prefetch bandwidth and incorperate it into the urgent bandwidth calculations
even if the prefetch schedule being used is not the oto schedule.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Austin Zheng <Austin.Zheng@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Update Cursor request mode to the beginning prefetch always
Zhikai Zhai [Thu, 9 Jan 2025 08:11:48 +0000 (16:11 +0800)] 
drm/amd/display: Update Cursor request mode to the beginning prefetch always

[Why]
The double buffer cursor registers is updated by the cursor
vupdate event. There is a gap between vupdate and cursor data
fetch if cursor fetch data reletive to cursor position.
Cursor corruption will happen if we update the cursor surface
in this gap.

[How]
Modify the cursor request mode to the beginning prefetch always
and avoid wraparound calculation issues.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Zhikai Zhai <zhikai.zhai@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Update CR AUX RD interval interpretation
George Shen [Fri, 10 Jan 2025 16:35:46 +0000 (11:35 -0500)] 
drm/amd/display: Update CR AUX RD interval interpretation

[Why]
DP spec updated to have the CR AUX RD interval match the EQ AUX RD
interval interpretation of DPCD 0000Eh/0220Eh for 8b/10b non-LTTPR mode
and LTTPR transparent mode cases.

[How]
Update interpretation of DPCD 0000Eh/0220Eh for CR AUX RD interval
during 8b/10b link training.

Reviewed-by: Michael Strauss <michael.strauss@amd.com>
Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: George Shen <george.shen@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Initial psr_version with correct setting
Tom Chung [Mon, 13 Jan 2025 06:22:31 +0000 (14:22 +0800)] 
drm/amd/display: Initial psr_version with correct setting

[Why & How]
The initial setting for psr_version is not correct while
create a virtual link.

The default psr_version should be DC_PSR_VERSION_UNSUPPORTED.

Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu/gfx10: Add cleaner shader for GFX10.1.10
Srinivasan Shanmugam [Tue, 21 Jan 2025 07:02:07 +0000 (12:32 +0530)] 
drm/amdgpu/gfx10: Add cleaner shader for GFX10.1.10

This commit adds the cleaner shader microcode for GFX10.1.0 GPUs. The
cleaner shader is a piece of GPU code that is used to clear or
initialize certain GPU resources, such as Local Data Share (LDS), Vector
General Purpose Registers (VGPRs), and Scalar General Purpose Registers
(SGPRs).

Clearing these resources is important for ensuring data isolation
between different workloads running on the GPU. Without the cleaner
shader, residual data from a previous workload could potentially be
accessed by a subsequent workload, leading to data leaks and incorrect
computation results.

The cleaner shader microcode is represented as an array of 32-bit words
(`gfx_10_1_0_cleaner_shader_hex`). This array is the binary
representation of the cleaner shader code, which is written in a
low-level GPU instruction set.

When the cleaner shader feature is enabled, the AMDGPU driver loads this
array into a specific location in the GPU memory. The GPU then reads
this memory location to fetch and execute the cleaner shader
instructions.

The cleaner shader is executed automatically by the GPU at the end of
each workload, before the next workload starts. This ensures that all
GPU resources are in a clean state before the start of each workload.

This addition is part of the cleaner shader feature implementation. The
cleaner shader feature helps resource utilization by cleaning up GPU
resources after they are used. It also enhances security and reliability
by preventing data leaks between workloads.

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Skip err_count sysfs creation on VF unsupported RAS blocks
Victor Skvortsov [Tue, 21 Jan 2025 03:00:22 +0000 (22:00 -0500)] 
drm/amdgpu: Skip err_count sysfs creation on VF unsupported RAS blocks

VFs are not able to query error counts for all RAS blocks. Rather than
returning error for queries on these blocks, skip sysfs the creation
all together.

Signed-off-by: Victor Skvortsov <victor.skvortsov@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amdgpu: Update usage for bad page threshold
Hawking Zhang [Wed, 22 Jan 2025 11:34:33 +0000 (19:34 +0800)] 
drm/amdgpu: Update usage for bad page threshold

The driver's behavior varies based on
the configuration of amdgpu_bad_page_threshold setting

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>
4 months agodrm/amd/pm: Update pm attr for gc_9_5_0
Asad Kamal [Fri, 17 Jan 2025 09:08:33 +0000 (17:08 +0800)] 
drm/amd/pm: Update pm attr for gc_9_5_0

Update power management & clk attributes for gc_v_9_5_0

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/pm: Skip showing MCLK_OD level
Asad Kamal [Tue, 21 Jan 2025 14:40:28 +0000 (22:40 +0800)] 
drm/amd/pm: Skip showing MCLK_OD level

Skip showing MCLK_OD level if setting UCLK MAX is not supported

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/pm: Add metrics support for smuv13.0.12
Asad Kamal [Tue, 21 Jan 2025 14:23:21 +0000 (22:23 +0800)] 
drm/amd/pm: Add metrics support for smuv13.0.12

Add metrics table support for smuv13.0.12 to
fetch data from metrics version v2

v2: Update get metric field and get metric size macro (Lijo)

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/pm: Add SMUv13.0.12 PPT interface
Asad Kamal [Tue, 21 Jan 2025 12:34:53 +0000 (20:34 +0800)] 
drm/amd/pm: Add SMUv13.0.12 PPT interface

Add SMUv13.0.12 PPT interface to fetch dpm features

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/pm: Add metrics table header for smu_v13_0_12
Asad Kamal [Tue, 21 Jan 2025 12:00:18 +0000 (20:00 +0800)] 
drm/amd/pm: Add metrics table header for smu_v13_0_12

Add metrics table header for smu_v13_0_12 as metrics version V2

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/pm: Update metrics tbl struct for smu_v_13.0.6
Asad Kamal [Tue, 21 Jan 2025 11:35:05 +0000 (19:35 +0800)] 
drm/amd/pm: Update metrics tbl struct for smu_v_13.0.6

Update metrics table struct name for smu_v_13.0.6 and keep
it as version

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/pm: Update smu_v13_0_0 SRIOV VF flag in msg mapping table
Yifan Zha [Fri, 17 Jan 2025 10:56:53 +0000 (18:56 +0800)] 
drm/amd/pm: Update smu_v13_0_0 SRIOV VF flag in msg mapping table

[Why]
Under SRIOV VF, driver send a VF unsupportted smu message causing
a failure.

[How]
Update smu_v13_0_0 message mapping table based on PMFW.

Signed-off-by: Yifan Zha <Yifan.Zha@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Refactor mark_seamless_boot_stream()
Mario Limonciello [Mon, 20 Jan 2025 19:49:03 +0000 (13:49 -0600)] 
drm/amd/display: Refactor mark_seamless_boot_stream()

mark_seamless_boot_stream() can be called multiple times to run
the more expensive checks in dc_validate_boot_timing().

Refactor the function so that if those have already passed once
the function isn't called again.

Also add a message the first time that they have passed to let
the user know the stream will be used for seamless boot.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Link: https://lore.kernel.org/r/20250120194903.1048811-4-superm1@kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd: Mark amdgpu.gttsize parameter as deprecated and show warnings on use
Mario Limonciello [Thu, 16 Jan 2025 21:53:20 +0000 (15:53 -0600)] 
drm/amd: Mark amdgpu.gttsize parameter as deprecated and show warnings on use

When not set `gttsize` module parameter by default will get the
value to use for the GTT pool from the TTM page limit, which is
set by a separate module parameter.

This inevitably leads to people not sure which one to set when they
want more addressable memory for the GPU, and you'll end up seeing
instructions online saying to set both.

Add some messages to try to guide people both who are using or misusing
the parameters and mark the parameter as deprecated with the plan to
drop it after the next LTS kernel release.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 months agodrm/amd/display: Add new log type `DC_LOG_INFO`
Mario Limonciello [Mon, 20 Jan 2025 19:49:02 +0000 (13:49 -0600)] 
drm/amd/display: Add new log type `DC_LOG_INFO`

`DC_LOG_INFO` will wrap `drm_info()` and be used for the typical
`INFO` level printk messages but in DC code.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Link: https://lore.kernel.org/r/20250120194903.1048811-3-superm1@kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>