]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
2 months agodrm/amdgpu: Move register access functions
Lijo Lazar [Mon, 8 Dec 2025 10:11:07 +0000 (15:41 +0530)] 
drm/amdgpu: Move register access functions

Move register access methods from amdgpu_device.c to a dedicated file.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Enable DPG support for VCN5
sguttula [Sat, 21 Feb 2026 05:17:59 +0000 (10:47 +0530)] 
drm/amdgpu: Enable DPG support for VCN5

This will set DPG flags for enabling power gating on GFX11_5_4

Signed-off-by: sguttula <suresh.guttula@amd.com>
Reviewed-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Enable DEGAMMA and reject COLOR_PIPELINE+DEGAMMA_LUT
Alex Hung [Fri, 27 Feb 2026 19:30:38 +0000 (12:30 -0700)] 
drm/amd/display: Enable DEGAMMA and reject COLOR_PIPELINE+DEGAMMA_LUT

[WHAT]
Create DEGAMMA properties even if color pipeline is enabled, and enforce
the mutual exclusion in atomic check by rejecting any commit that
attempts to enable both COLOR_PIPELINE on the plane and DEGAMMA_LUT on
the CRTC simultaneously.

Fixes: 18a4127e9315 ("drm/amd/display: Disable CRTC degamma when color pipeline is enabled")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4963
Reviewed-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Use mpc.preblend flag to indicate 3D LUT
Alex Hung [Fri, 27 Feb 2026 19:26:04 +0000 (12:26 -0700)] 
drm/amd/display: Use mpc.preblend flag to indicate 3D LUT

[WHAT]
New ASIC's 3D LUT is indicated by mpc.preblend.

Fixes: 0de2b1afea8d ("drm/amd/display: add 3D LUT colorop")
Reviewed-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdkfd: fix CWSR trap handler
Alex Deucher [Thu, 26 Feb 2026 16:18:29 +0000 (11:18 -0500)] 
drm/amdkfd: fix CWSR trap handler

Fix up what looks like a bad merge.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd: Disable MES LR compute W/A
Mario Limonciello [Wed, 25 Feb 2026 16:51:16 +0000 (10:51 -0600)] 
drm/amd: Disable MES LR compute W/A

A workaround was introduced in commit 1fb710793ce2 ("drm/amdgpu: Enable
MES lr_compute_wa by default") to help with some hangs observed in gfx1151.

This WA didn't fully fix the issue.  It was actually fixed by adjusting
the VGPR size to the correct value that matched the hardware in commit
b42f3bf9536c ("drm/amdkfd: bump minimum vgpr size for gfx1151").

There are reports of instability on other products with newer GC microcode
versions, and I believe they're caused by this workaround. As we don't
need the workaround any more, remove it.

Fixes: b42f3bf9536c ("drm/amdkfd: bump minimum vgpr size for gfx1151")
Acked-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>
3 months agodrm/amdgpu: Fix error handling in slot reset
Lijo Lazar [Tue, 24 Feb 2026 04:48:51 +0000 (10:18 +0530)] 
drm/amdgpu: Fix error handling in slot reset

If the device has not recovered after slot reset is called, it goes to
out label for error handling. There it could make decision based on
uninitialized hive pointer and could result in accessing an uninitialized
list.

Initialize the list and hive properly so that it handles the error
situation and also releases the reset domain lock which is acquired
during error_detected callback.

Fixes: 732c6cefc1ec ("drm/amdgpu: Replace tmp_adev with hive in amdgpu_pci_slot_reset")
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Ce Sun <cesun102@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/ras: Handle check address validity in SR-IOV
Jinzhou Su [Tue, 10 Feb 2026 06:49:35 +0000 (14:49 +0800)] 
drm/amd/ras: Handle check address validity in SR-IOV

Handle check address validity command in SR-IOV
guest.

Signed-off-by: Jinzhou Su <jinzhou.su@amd.com>
Reviewed-by: YiPeng Chai <YiPeng.Chai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/vcn5: Add SMU dpm interface type
sguttula [Sat, 21 Feb 2026 04:33:32 +0000 (10:03 +0530)] 
drm/amdgpu/vcn5: Add SMU dpm interface type

This will set AMDGPU_VCN_SMU_DPM_INTERFACE_* smu_type
based on soc type and fixing ring timeout issue seen
for DPM enabled case.

Signed-off-by: sguttula <suresh.guttula@amd.com>
Reviewed-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/ras: Add function to convert retired address
Jinzhou Su [Tue, 10 Feb 2026 06:36:48 +0000 (14:36 +0800)] 
drm/amd/ras: Add function to convert retired address

Add function to convert retired address in SR-IOV
guest.

Signed-off-by: Jinzhou Su <jinzhou.su@amd.com>
Reviewed-by: YiPeng Chai <YiPeng.Chai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/ras: Handle address check in SR-IOV guest
Jinzhou Su [Tue, 10 Feb 2026 06:32:40 +0000 (14:32 +0800)] 
drm/amd/ras: Handle address check in SR-IOV guest

Handle address check validity command in SR-IOV guest

Signed-off-by: Jinzhou Su <jinzhou.su@amd.com>
Reviewed-by: YiPeng Chai <YiPeng.Chai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/ras: Add convert retired address structure
Jinzhou Su [Mon, 9 Feb 2026 07:42:25 +0000 (15:42 +0800)] 
drm/amd/ras: Add convert retired address structure

Add convert retired address command and structure
for uniras.

Signed-off-by: Jinzhou Su <jinzhou.su@amd.com>
Reviewed-by: YiPeng Chai <YiPeng.Chai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/ras: Add address check structure
Jinzhou Su [Tue, 10 Feb 2026 07:46:13 +0000 (15:46 +0800)] 
drm/amd/ras: Add address check structure

Add address check command and data structure
for uniras.

Signed-off-by: Jinzhou Su <jinzhou.su@amd.com>
Reviewed-by: YiPeng Chai <YiPeng.Chai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: Fix locking bugs in error paths
Bart Van Assche [Mon, 23 Feb 2026 21:50:23 +0000 (13:50 -0800)] 
drm/amdgpu: Fix locking bugs in error paths

Do not unlock psp->ras_context.mutex if it has not been locked. This has
been detected by the Clang thread-safety analyzer.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: YiPeng Chai <YiPeng.Chai@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Fixes: b3fb79cda568 ("drm/amdgpu: add mutex to protect ras shared memory")
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: Unlock a mutex before destroying it
Bart Van Assche [Mon, 23 Feb 2026 22:00:07 +0000 (14:00 -0800)] 
drm/amdgpu: Unlock a mutex before destroying it

Mutexes must be unlocked before these are destroyed. This has been detected
by the Clang thread-safety analyzer.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Yang Wang <kevinyang.wang@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Fixes: f5e4cc8461c4 ("drm/amdgpu: implement RAS ACA driver framework")
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Use GFP_ATOMIC in dc_create_stream_for_sink
Natalie Vock [Mon, 23 Feb 2026 11:45:37 +0000 (12:45 +0100)] 
drm/amd/display: Use GFP_ATOMIC in dc_create_stream_for_sink

This can be called while preemption is disabled, for example by
dcn32_internal_validate_bw which is called with the FPU active.

Fixes "BUG: scheduling while atomic" messages I encounter on my Navi31
machine.

Signed-off-by: Natalie Vock <natalie.vock@gmx.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: add upper bound check on user inputs in wait ioctl
Sunil Khatri [Tue, 24 Feb 2026 06:43:09 +0000 (12:13 +0530)] 
drm/amdgpu: add upper bound check on user inputs in wait ioctl

Huge input values in amdgpu_userq_wait_ioctl can lead to a OOM and
could be exploited.

So check these input value against AMDGPU_USERQ_MAX_HANDLES
which is big enough value for genuine use cases and could
potentially avoid OOM.

v2: squash in Srini's fix

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: add upper bound check on user inputs in signal ioctl
Sunil Khatri [Fri, 20 Feb 2026 08:17:58 +0000 (13:47 +0530)] 
drm/amdgpu: add upper bound check on user inputs in signal ioctl

Huge input values in amdgpu_userq_signal_ioctl can lead to a OOM and
could be exploited.

So check these input value against AMDGPU_USERQ_MAX_HANDLES
which is big enough value for genuine use cases and could
potentially avoid OOM.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/userq: Use drm_gem_objects_lookup in amdgpu_userq_wait_ioctl
Tvrtko Ursulin [Mon, 23 Feb 2026 12:41:34 +0000 (12:41 +0000)] 
drm/amdgpu/userq: Use drm_gem_objects_lookup in amdgpu_userq_wait_ioctl

Use the existing helper instead of open coding it

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Sunil Khatri <sunil.khatrti@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/userq: Use drm_gem_objects_lookup in amdgpu_userq_signal_ioctl
Tvrtko Ursulin [Mon, 23 Feb 2026 12:41:33 +0000 (12:41 +0000)] 
drm/amdgpu/userq: Use drm_gem_objects_lookup in amdgpu_userq_signal_ioctl

Use the existing helper instead of open coding it.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Sunil Khatri <sunil.khatrti@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/ras: use dedicated memory as vf ras command buffer
YiPeng Chai [Mon, 9 Feb 2026 08:29:57 +0000 (16:29 +0800)] 
drm/amd/ras: use dedicated memory as vf ras command buffer

Use dedicated memory as vf ras command buffer.

V2:
  Add lock to ensure serialization of sending vf ras commands.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Jinzhou Su <jinzhou.su@amd.com>
Tested-by: Jinzhou Su <jinzhou.su@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdkfd: Removed commented line for MQD queue priority
Andrew Martin [Mon, 23 Feb 2026 21:08:16 +0000 (16:08 -0500)] 
drm/amdkfd: Removed commented line for MQD queue priority

Missed deleting the commented line in the original patch.

Fixes: 73463e26f7e2 ("drm/amdkfd: Disable MQD queue priority")
Signed-off-by: Andrew Martin <andrew.martin@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/userq: Consolidate wait ioctl exit path
Tvrtko Ursulin [Mon, 23 Feb 2026 12:41:32 +0000 (12:41 +0000)] 
drm/amdgpu/userq: Consolidate wait ioctl exit path

If we gate the fence destruction with a check telling us whether there are
valid pointers in there we can eliminate the need for dual, basically
identical, exit paths.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/userq: Do not allow userspace to trivially triger kernel warnings
Tvrtko Ursulin [Mon, 23 Feb 2026 12:41:31 +0000 (12:41 +0000)] 
drm/amdgpu/userq: Do not allow userspace to trivially triger kernel warnings

Userspace can either deliberately pass in the too small num_fences, or the
required number can legitimately grow between the two calls to the userq
wait ioctl. In both cases we do not want the emit the kernel warning
backtrace since nothing is wrong with the kernel and userspace will simply
get an errno reported back. So lets simply drop the WARN_ONs.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Fixes: a292fdecd728 ("drm/amdgpu: Implement userqueue signal/wait IOCTL")
Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/userq: Fix reference leak in amdgpu_userq_wait_ioctl
Tvrtko Ursulin [Mon, 23 Feb 2026 12:41:30 +0000 (12:41 +0000)] 
drm/amdgpu/userq: Fix reference leak in amdgpu_userq_wait_ioctl

Drop reference to syncobj and timeline fence when aborting the ioctl due
output array being too small.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Fixes: a292fdecd728 ("drm/amdgpu: Implement userqueue signal/wait IOCTL")
Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Fix kdoc formatting in dcn42_hwseq.c
Srinivasan Shanmugam [Mon, 23 Feb 2026 13:44:41 +0000 (19:14 +0530)] 
drm/amd/display: Fix kdoc formatting in dcn42_hwseq.c

Kernel-doc requires all lines within a documentation
comment to start with " *". The previous empty line
caused a "bad line" warning during build.

Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Mario Limonciello <superm1@kernel.org>
Cc: Alex Hung <alex.hung@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: ChiaHsuan Chung <chiahsuan.chung@amd.com>
Cc: Roman Li <roman.li@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/userq: Use memdup_array_user in amdgpu_userq_signal_ioctl
Tvrtko Ursulin [Fri, 5 Dec 2025 13:40:30 +0000 (13:40 +0000)] 
drm/amdgpu/userq: Use memdup_array_user in amdgpu_userq_signal_ioctl

Use the existing helper instead of multiplying the size.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/userq: Use memdup_array_user in amdgpu_userq_wait_ioctl
Tvrtko Ursulin [Fri, 5 Dec 2025 13:40:29 +0000 (13:40 +0000)] 
drm/amdgpu/userq: Use memdup_array_user in amdgpu_userq_wait_ioctl

Use the existing helper instead of multiplying the size.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/sdma7.1: adjust SDMA limits
Alex Deucher [Thu, 19 Feb 2026 15:48:39 +0000 (10:48 -0500)] 
drm/amdgpu/sdma7.1: adjust SDMA limits

SDMA 7.1 has increased transfer limits.

Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/sdma7.0: adjust SDMA limits
Alex Deucher [Thu, 11 Sep 2025 14:34:59 +0000 (10:34 -0400)] 
drm/amdgpu/sdma7.0: adjust SDMA limits

SDMA 7.0 has increased transfer limits.

v2: fix harder, use shifts to make it more obvious

Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/sdma6.0: adjust SDMA limits
Alex Deucher [Thu, 11 Sep 2025 14:34:11 +0000 (10:34 -0400)] 
drm/amdgpu/sdma6.0: adjust SDMA limits

SDMA 6.x has increased transfer limits.

v2: fix harder, use shifts to make it more obvious

Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/sdma5.2: adjust SDMA limits
Alex Deucher [Thu, 11 Sep 2025 14:33:39 +0000 (10:33 -0400)] 
drm/amdgpu/sdma5.2: adjust SDMA limits

SDMA 5.2.x has increased transfer limits.

v2: fix harder, use shifts to make it more obvious
v3: align const fill with PAL limits
v4: re-align with hw limits

Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/sdma4.4: adjust SDMA limits
Alex Deucher [Thu, 11 Sep 2025 14:38:57 +0000 (10:38 -0400)] 
drm/amdgpu/sdma4.4: adjust SDMA limits

SDMA 4.4.x has increased transfer limits.

v2: fix harder, use shifts to make it more obvious

Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/sdma4.0: adjust SDMA limits
Alex Deucher [Thu, 11 Sep 2025 14:32:34 +0000 (10:32 -0400)] 
drm/amdgpu/sdma4.0: adjust SDMA limits

SDMA 4.4.x has increased transfer limits.

v2: fix harder, use shifts to make it more obvious

Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Promote DC to 3.2.371
Taimur Hassan [Thu, 12 Feb 2026 23:12:35 +0000 (18:12 -0500)] 
drm/amd/display: Promote DC to 3.2.371

This version brings along the follwing updates:

- Add visualconfirm support for refresh rate change testing.
- Fix IPS exit with DC helper for all dc_set_power_state cases.
- Fix cursor position at overlay plane edges on DCN4.
- Introduce DMUB IHC command.
- Add missing dprefclk and dtbclk clock types and fix formatting.
- Fix DPIA number and driver ID field sizes per spec.
- Minor code fixes.

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: [FW Promotion] Release 0.1.48.0
Taimur Hassan [Thu, 12 Feb 2026 21:49:15 +0000 (16:49 -0500)] 
drm/amd/display: [FW Promotion] Release 0.1.48.0

[Why&How]
Introduce DMUB IHC command.

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Add Visual Confirm Support for Testing
Muaaz Nisar [Thu, 18 Dec 2025 21:03:44 +0000 (16:03 -0500)] 
drm/amd/display: Add Visual Confirm Support for Testing

[WHY+HOW]
Adding visual confirm to visually track changes in refresh rate.

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Muaaz Nisar <muanisar@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Add missing clock types & fix formatting
Ovidiu Bunea [Tue, 3 Feb 2026 00:14:23 +0000 (19:14 -0500)] 
drm/amd/display: Add missing clock types & fix formatting

[why & how]
Add the missing dprefclk and dtbclk clock types to the enum.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Ovidiu Bunea <ovidiu.bunea@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Fix dcn401_optimize_bandwidth
Charlene Liu [Wed, 11 Feb 2026 21:53:44 +0000 (16:53 -0500)] 
drm/amd/display: Fix dcn401_optimize_bandwidth

[Why&How]
We should check for != zstate disallow and programming extend blank from a
different struct.

Reviewed-by: Leo Chen <leo.chen@amd.com>
Reviewed-by: Dmytro Laktyushkin <dmytro.laktyushkin@amd.com>
Signed-off-by: Charlene Liu <Charlene.Liu@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Silence type mismatch warning
Gaghik Khachatrian [Mon, 16 Feb 2026 16:26:58 +0000 (11:26 -0500)] 
drm/amd/display: Silence type mismatch warning

[Why&How]
Resolve type mismatch warnings by ensuring loop counters and compared
values use matching unsigned types (size_t or int) in array iteration.

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Gaghik Khachatrian <gaghik.khachatrian@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Fix DPIA number and driver ID field issue
Cruise Hung [Tue, 10 Feb 2026 09:40:42 +0000 (17:40 +0800)] 
drm/amd/display: Fix DPIA number and driver ID field issue

[Why]
The DPIA number field is 6 bits in the spec.
In dp_type, it only defines 5 bits.
The driver ID is only 4 bits in the spec.

[How]
Set DPIA number field size to 6.
And only update 4 bits for driver id.

Reviewed-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Signed-off-by: Cruise Hung <Cruise.Hung@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Fix cursor pos at overlay plane edges on DCN4
Ivan Lipski [Mon, 2 Feb 2026 20:57:19 +0000 (15:57 -0500)] 
drm/amd/display: Fix cursor pos at overlay plane edges on DCN4

[Why&How]
On DCN4, when cursor straddles the left/top edge of an overlay plane, the
recout-relative position becomes negative. These negative values wrap
to large positive numbers when cast to uint32_t, causing the cursor on the
the overlay plane to disappear.

Fix by adding hotspot adjustment and position clamping after the
recout-relative calculation, matching the existing ODM/MPC slice
boundary handling.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Exit IPS w/ DC helper for all dc_set_power_state cases
Ovidiu Bunea [Wed, 4 Feb 2026 22:08:01 +0000 (17:08 -0500)] 
drm/amd/display: Exit IPS w/ DC helper for all dc_set_power_state cases

[why & how]
On D3 path during dc_set_power_state, we may be in idle_allowed=true,
at which point we will exit idle via dc_wake_and_execute_dmub_cmd_list
which doesn't update dc->idle_optimizations_allowed to false. This
would cause any future attempts to allow idle optimizations via the DC
helper to get skipped because the value is stale and not reflective of
the actual HW state.

Move dc_exit_ips_for_hw_access() to the top of the function.
Additionally ensure that dc_power_down_on_boot thread holds the DC
lock and only runs if there are 0 streams.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Ovidiu Bunea <ovidiu.bunea@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: Add xgmi link status for VFs
Simon Louis [Tue, 3 Feb 2026 15:42:00 +0000 (15:42 +0000)] 
drm/amdgpu: Add xgmi link status for VFs

Xgmi link status is unavailable in guest. This patch returns
AMDGPU_XGMI_LINK_NA for VFs.

Signed-off-by: Simon Louis <simon.louis@amd.com>
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>
3 months agodrm/amd/display: Add atomfirmware cap for DP++ Type2
Aurabindo Pillai [Wed, 18 Feb 2026 20:42:08 +0000 (15:42 -0500)] 
drm/amd/display: Add atomfirmware cap for DP++ Type2

Add ATOM_CONNECTOR_CAP_DP_PLUS_PLUS_TYPE2_ONLY in atom connector caps definitions.

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Nevenko Stupar <nevenko.stupar@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: Print full vbios info
Lijo Lazar [Wed, 18 Feb 2026 10:51:23 +0000 (16:21 +0530)] 
drm/amdgpu: Print full vbios info

Add build number, version and date to the existing part number print.

Example:

[drm] ATOM BIOS: 113-PN000108-103, build: 00159017, ver: 022.040.003.043.000001, 2025/07/27

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>
3 months agodrm/amdgpu: rework ring reset backup and reemit v9
Alex Deucher [Fri, 16 Jan 2026 03:01:15 +0000 (22:01 -0500)] 
drm/amdgpu: rework ring reset backup and reemit v9

Store the start wptr and ib size in the IB fence. On queue
reset, save the ring contents of all IBs.

For reemit, reemit the entire IB state for non-guilty contexts.
For guilty contexts, replace the IB submission with nops, but reemit
the rest.  Split the reemit per fence and when we reemit, update the
wptr with the new values from reemit.  This allows us to reemit jobs
repeatedly as the wptrs get properly updated each time.

v2: further simplify the logic
v3: reemit vm state, not just vm fence
v4: just nop the IB and possibly the VM portion of the submission
v5: simplify the vm fence check
v6: split the vm and ib fences
v7: fix commit message
v8: use wptr rather than count_dw to calculate offsets
v9: fix missing documenation update spotted by the kernel test robot

Reviewed-by: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/discovery: Enable DM for DCN42
Roman Li [Wed, 18 Feb 2026 15:29:46 +0000 (10:29 -0500)] 
drm/amdgpu/discovery: Enable DM for DCN42

Add DM ipblock for DCN 4.2.0

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Enable dcn42 in DM
Roman Li [Tue, 3 Feb 2026 00:45:35 +0000 (19:45 -0500)] 
drm/amd/display: Enable dcn42 in DM

Add support for DCN 4.2 in Display Manager

Signed-off-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Enable dcn42 DC
Roman Li [Mon, 2 Feb 2026 23:47:34 +0000 (18:47 -0500)] 
drm/amd/display: Enable dcn42 DC

Add support for DCN 4.2 in Display Core

Signed-off-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Enable dcn42 DMUB
Roman Li [Mon, 2 Feb 2026 23:40:41 +0000 (18:40 -0500)] 
drm/amd/display: Enable dcn42 DMUB

Enable DMUB support for DCN 4.2

Signed-off-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Add DMUB support for dcn42
Roman Li [Mon, 2 Feb 2026 23:35:37 +0000 (18:35 -0500)] 
drm/amd/display: Add DMUB support for dcn42

DMUB support for DCN 4.2

Signed-off-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Add dcn42 DC resources
Roman Li [Mon, 2 Feb 2026 23:06:17 +0000 (18:06 -0500)] 
drm/amd/display: Add dcn42 DC resources

Display Core resources for DCN 4.2:
- CLK_MGR
- DCCG
- DIO
- DPP
- GPIO
- HPO
- HUBBUB
- HUBP
- HWSS
- IRQ
- MMHUBBUB
- MPC
- OPTC
- PG

Signed-off-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Add dcn42 register headers
Roman Li [Mon, 2 Feb 2026 22:11:43 +0000 (17:11 -0500)] 
drm/amd/display: Add dcn42 register headers

Register headers for the following IPs:
- DCN  4.2.0
- DPCS 4.0.0

Signed-off-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: Use DC by default on CIK APUs
Timur Kristóf [Mon, 26 Jan 2026 21:08:37 +0000 (22:08 +0100)] 
drm/amdgpu: Use DC by default on CIK APUs

Now that DC supports external DP bridge encoders,
it has reached feature parity with the legacy non-DC display
driver on CIK APUs: Kaveri, Kabini, Mullins.

Use the DC display driver by default on SI APUs, unless it is
explicitly disabled using the amdgpu.dc=0 module parameter.

DC brings proper support for DP/HDMI audio, DP MST, VRR,
10-bit colors, some HDR features, atomic modesetting, etc.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Implement DAC load detection on external DP bridge encoders
Timur Kristóf [Mon, 26 Jan 2026 21:08:36 +0000 (22:08 +0100)] 
drm/amd/display: Implement DAC load detection on external DP bridge encoders

Use the pre-existing implementation in the BIOS parser, but call
the ExternalEncoderControl function for external encoders instead
of the built-in DAC load detection function.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Use external DP bridge encoders
Timur Kristóf [Mon, 26 Jan 2026 21:08:35 +0000 (22:08 +0100)] 
drm/amd/display: Use external DP bridge encoders

Implement link creation for external DP bridge encoders
such as NUTMEG and TRAVIS used with CIK APUs such as
Kaveri for supporting analog and LVDS connections.
Typically found in CIK APU based laptops or on FM2
motherboards that have analog connectors.

When we query connector information from the VBIOS and
discover a connector using such an encoder, let's find the
real DisplayPort encoder and use that. Set the connector
signal type to DP, so the pre-existing DP code paths can
work with it without refactoring every signal type check
in the DC code base.

In the DM, make sure to report correct connector type and
also to initialize DP specifics such as the AUX channel.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Link detection for external DP bridge encoders
Timur Kristóf [Mon, 26 Jan 2026 21:08:34 +0000 (22:08 +0100)] 
drm/amd/display: Link detection for external DP bridge encoders

Deal with some minor idiosyncracies of TRAVIS and NUTMEG chips.

- Always use DP signal type with these chips so that the
  normal DP code paths can work with them without a major
  refactor of the code base. Properly set this.

- NUTMEG seems to only work with HBR, not RBR, so set a
  preferred link rate for this chip.
  See amdgpu_atombios_dp_get_dp_link_config() for reference.

- NUTMEG is recognized as a DP branch device but reports 0 sinks,
  which is wrong and confuses DC (it hits an early return).
  Fix that by hardcoding the sink count to 1.

- Fixup old DC code selecting a special panel mode necessary
  for NUTMEG and TRAVIS.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Add DCE HWSS support for external DP bridge encoders
Timur Kristóf [Mon, 26 Jan 2026 21:08:33 +0000 (22:08 +0100)] 
drm/amd/display: Add DCE HWSS support for external DP bridge encoders

Some GPUs use external DP bridge encoders NUTMEG and TRAVIS
to implement analog and/or LVDS connections. Typically found in
CIK APU based laptops or on FM2 motherboards that have analog
connectors. These were necessary at the time because Kaveri
didn't have a built-in DAC nor LVDS support.

These devices sadly don't work transparently and need to be
controlled by the driver. Implement the necessary control for
the NUTMEG and TRAVIS encoders in the DCE HWSS.

For reference, see the legacy non-DC amdgpu display code:
amdgpu_atombios_encoder_setup_external_encoder()
amdgpu_atombios_encoder_setup_dig()
amdgpu_atombios_encoder_setup_ext_encoder_ddc()

- Prepare DDC before using it:
  Call the EXTERNAL_ENCODER_CONTROL_DDC_SETUP action so that
  the encoder knows to set up DDC over the AUX channel.

- When a stream is enabled or disabled:
  Call the EXTERNAL_ENCODER_CONTROL_ENABLE/DISABLE actions.

- Before enabling the DP link:
  Call the EXTERNAL_ENCODER_CONTROL_SETUP action.

This commit just hooks up the HWSS support.
Detecting the external DP bridge encoders will be done in
a subsequent commit.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Use preferred DP link rate if specified
Timur Kristóf [Mon, 26 Jan 2026 21:08:32 +0000 (22:08 +0100)] 
drm/amd/display: Use preferred DP link rate if specified

The DisplayPort code already has the concept of preferred link
settings, but it only allows setting a preferred lane count and
link width at the same time. It does not consider the possiblity
that some devices may not work on lower link rates but may
support various lane counts.

Allow specifying a preferred link rate which will be used as
the initial link rate when deciding the DP link settings.

This is necessary to support NUTMEG which only works with HBR
but not with RBR.

For reference, see the legacy non-DC amdgpu display code:
amdgpu_atombios_dp_get_dp_link_config()

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Add ability for HWSS to prepare the DDC before use
Timur Kristóf [Mon, 26 Jan 2026 21:08:31 +0000 (22:08 +0100)] 
drm/amd/display: Add ability for HWSS to prepare the DDC before use

Make it possible to add a HWSS function to prepare the DDC
before trying to use it. This is going to be necessary for
external DP bridge encoders.

This commit just adds the function to common DC code.
The actual implementation of this function for DCE is
done in a subsequent commit.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Implement DDC probe over AUX channel
Timur Kristóf [Mon, 26 Jan 2026 21:08:30 +0000 (22:08 +0100)] 
drm/amd/display: Implement DDC probe over AUX channel

DDC probe means that we use the DDC (Display Data Channel) to
verify whether a display is connected or not.

This was written with mainly analog connectors in mind, so it
didn't work over the AUX channel. However, in order to support
external DP bridge encoders found in CIK APUs, it needs to work
over the AUX channel too.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Implement BIOS parser external encoder control
Timur Kristóf [Mon, 26 Jan 2026 21:08:29 +0000 (22:08 +0100)] 
drm/amd/display: Implement BIOS parser external encoder control

The VBIOS has a function called ExternalEncoderControl which
controls the DP bridge encoders that some GPUs use for analog
and LVDS output. Fixup this old functionality.

For reference, see the legacy non-DC amdgpu display code:
amdgpu_atombios_encoder_setup_external_encoder()

- Set same parameters for the ENABLE action as the SETUP action
- Add missing enum values for DDC setup and DAC load detection
- Fix the bits per color field
- Clarify the code that sets the link rate
- Expose the function so that it can be called by rest of DC

A subsequent commit will call this function from DCE HWSS.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Refactor DAC load detection, move to HWSS
Timur Kristóf [Mon, 26 Jan 2026 21:08:28 +0000 (22:08 +0100)] 
drm/amd/display: Refactor DAC load detection, move to HWSS

Slightly refactor and simplify DAC load detection.
This prepares the code to be used for also executing DAC
load detection on external DP bridge encoders.

DAC load detection belongs better in the hardware sequencer
code because the implementation is HW dependent and not all
chips support the functionality. The code is cleaner when
link detection probably doesn't call the VBIOS directly.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Add color depth helper function to BIOS parser
Timur Kristóf [Mon, 26 Jan 2026 21:08:27 +0000 (22:08 +0100)] 
drm/amd/display: Add color depth helper function to BIOS parser

To improve consistency and avoid duplicating the same code.
Also, properly handle all enum values where they weren't
handled correctly before.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Handle DCE 6 in dce110_register_irq_handlers
Timur Kristóf [Sun, 18 Jan 2026 17:31:50 +0000 (18:31 +0100)] 
drm/amd/display: Handle DCE 6 in dce110_register_irq_handlers

The dce60_register_irq_handlers function was basically identical
to dce110_register_irq_handlers. They can use the same function,
reducing duplicated code and easing the maintenance burden for
old DCE versions.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Handle DCE 6 in dce_clk_mgr.c
Timur Kristóf [Sun, 18 Jan 2026 17:31:49 +0000 (18:31 +0100)] 
drm/amd/display: Handle DCE 6 in dce_clk_mgr.c

dce60_clk_mgr was basically identical to dce_clk_mgr other than
a few minor details. They can be all handled in the same file,
reducing duplicated code and easing the maintenance burden for
old DCE versions.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Remove unused dce60_clk_mgr register definitions
Timur Kristóf [Sun, 18 Jan 2026 17:31:48 +0000 (18:31 +0100)] 
drm/amd/display: Remove unused dce60_clk_mgr register definitions

It turned out that these were actually not necessary.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Delete unused dce_clk_mgr.c
Timur Kristóf [Sun, 18 Jan 2026 17:31:47 +0000 (18:31 +0100)] 
drm/amd/display: Delete unused dce_clk_mgr.c

This file was not compiled or included anywhere and not
modified for years. And it has duplicate function
definitions of many functions that are defined in
other files.

That leads to a lot of confusion (for both developers
and for code editors), eg. when searching for a definition
of a function it can end up on one of the functions in
this file instead of the real implementations.

I suspect that it was forgotten that this should be
deleted after the various clock manager functions were
split into hardware generation specific files.
Delete it now.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Use dce_audio_create for DCE 6
Timur Kristóf [Sun, 18 Jan 2026 17:31:46 +0000 (18:31 +0100)] 
drm/amd/display: Use dce_audio_create for DCE 6

The only difference between DCE 6 and other DCE versions is
that DCE 6 doesn't support DCCG_AUDIO_DTO2_USE_512FBR_DTO.
Recently a check was added to dce_aud_wall_dto_setup() to
check that. So now DCE 6 can just use dce_aud_wall_dto_setup()
just like other DCE versions.

Clean up DCE 6 specific audio functions which were otherwise
identical to the rest.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Add dcn42 version identifiers
Roman Li [Mon, 2 Feb 2026 23:18:39 +0000 (18:18 -0500)] 
drm/amd/display: Add dcn42 version identifiers

Add DCN 4.2 asic version identifiers.

Signed-off-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: Make amdgpu_vm_flush() non-failing in submission path
Srinivasan Shanmugam [Thu, 12 Feb 2026 16:00:50 +0000 (21:30 +0530)] 
drm/amdgpu: Make amdgpu_vm_flush() non-failing in submission path

amdgpu_vm_flush() is used during job submission and is not expected to
fail. Convert it to return void and simplify the caller.

Initialize the COND_EXEC patch location to 0 so it is safe to call
amdgpu_ring_patch_cond_exec() when init_cond_exec is not supported.

Suggested-by: 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>
3 months agodrm/amdgpu: Make amdgpu_fence_emit() non-failing v2
Srinivasan Shanmugam [Tue, 10 Feb 2026 14:55:05 +0000 (20:25 +0530)] 
drm/amdgpu: Make amdgpu_fence_emit() non-failing v2

dma_fence_wait(old, false) is not interruptible and cannot return an
error. Drop the unreachable error handling in amdgpu_fence_emit().

Since the function can no longer fail, convert amdgpu_fence_emit() to
return void and remove return value handling from all callers.

v2:
- Add comment explaining why dma_fence_wait(..., false)
  return value is ignored (Alex)

Suggested-by: 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>
3 months agodrm/amdgpu: reorder IB schedule sequence
Alex Deucher [Fri, 23 Jan 2026 14:27:23 +0000 (09:27 -0500)] 
drm/amdgpu: reorder IB schedule sequence

This reorders the IB schedule sequence to cleanly
separate the vm operation from the IB submission.
This makes the two independent so we can cleanly
associate each one with its respective fence.

v2: fixes for VCN

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: Remove duplicate struct member
Tvrtko Ursulin [Mon, 12 Jan 2026 10:22:38 +0000 (10:22 +0000)] 
drm/amdgpu: Remove duplicate struct member

Struct amdgpu_ctx contains two copies of the pointer to the context
manager. Remove one.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: add a helper to calculate ring distance
Alex Deucher [Thu, 29 Jan 2026 19:49:13 +0000 (14:49 -0500)] 
drm/amdgpu: add a helper to calculate ring distance

Add a helper to calculate the distance in DWs between
two wptrs.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: remove some retired module parameters
Alex Deucher [Mon, 9 Feb 2026 16:59:40 +0000 (11:59 -0500)] 
drm/amdgpu: remove some retired module parameters

The mes and mes_kiq parameters we originally added for
mes bring up.  However, mes is required for operation
on gfx11 and newer so these parameters aren't actually
used by the driver anymore. Remove them.

Reviewed-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: don't call drm_sched_stop/start() in asic reset
Alex Deucher [Sat, 3 Jan 2026 18:29:19 +0000 (13:29 -0500)] 
drm/amdgpu: don't call drm_sched_stop/start() in asic reset

We only want to stop the work queues, not mess with the
fences, etc.

v2: add the job back to the pending list.
v3: return the proper job status so scheduler adds the
    job back to the pending list

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: Remove a few holes from struct amdgpu_ctx
Tvrtko Ursulin [Mon, 12 Jan 2026 10:22:37 +0000 (10:22 +0000)] 
drm/amdgpu: Remove a few holes from struct amdgpu_ctx

Re-order the struct members a bit to avoid some holes:

 /* size: 408, cachelines: 7, members: 15 */
 /* sum members: 393, holes: 4, sum holes: 15 */
 /* last cacheline: 24 bytes */

 /* size: 400, cachelines: 7, members: 15 */
 /* sum members: 393, holes: 1, sum holes: 7 */
 /* last cacheline: 16 bytes */

While doing so we notice a duplicate but will address than in the
following patch.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/gfx12: add CU mask support for compute MQD initialization
Jesse.Zhang [Fri, 23 Jan 2026 05:05:29 +0000 (13:05 +0800)] 
drm/amdgpu/gfx12: add CU mask support for compute MQD initialization

Extend the GFX12 compute MQD initialization to support
Compute Unit (CU) masking for fine-grained resource allocation.
This allows compute queues to be limited to specific CUs for
performance isolation and debugging purposes.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu/gfx11: add CU mask support for compute MQD initialization
Jesse.Zhang [Fri, 23 Jan 2026 05:00:13 +0000 (13:00 +0800)] 
drm/amdgpu/gfx11: add CU mask support for compute MQD initialization

Extend the GFX11 compute MQD initialization to support
Compute Unit (CU) masking for fine-grained resource allocation.
This allows compute queues to be limited to specific CUs for
performance isolation and debugging purposes.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: Add CU mask support for MQD properties
Jesse.Zhang [Fri, 23 Jan 2026 08:39:20 +0000 (16:39 +0800)] 
drm/amdgpu: Add CU mask support for MQD properties

Add new fields to the amdgpu_mqd_prop structure to track CU (Compute Unit)
mask information, including the mask itself, count, flags, and a flag to
indicate if user-specified CU masking is active.

v2: Create a generic function amdgpu_gfx_mqd_symmetrically_map_cu_mask()

Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: add mqd_update callback to AMDGPU user queue interface
Jesse.Zhang [Fri, 23 Jan 2026 07:37:49 +0000 (15:37 +0800)] 
drm/amdgpu: add mqd_update callback to AMDGPU user queue interface

Extend the AMDGPU user queue function interface to support MQD
updates by adding an mqd_update callback.

v2: add the input paramter struct drm_amdgpu_userq_in in mqd_update

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: move sched status check inside amdgpu_ttm_set_buffer_funcs_status
Pierre-Eric Pelloux-Prayer [Wed, 19 Nov 2025 13:13:00 +0000 (14:13 +0100)] 
drm/amdgpu: move sched status check inside amdgpu_ttm_set_buffer_funcs_status

It avoids duplicated code and allows to output a warning.

---
v4: move check inside the existing if (enable) test
---

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: introduce amdgpu_sdma_set_vm_pte_scheds
Pierre-Eric Pelloux-Prayer [Tue, 9 Sep 2025 13:39:24 +0000 (15:39 +0200)] 
drm/amdgpu: introduce amdgpu_sdma_set_vm_pte_scheds

All sdma versions used the same logic, so add a helper and move the
common code to a single place.

---
v2: pass amdgpu_vm_pte_funcs as well
v3: drop all the *_set_vm_pte_funcs one liners
v5: rebased
---

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: double AMDGPU_GTT_MAX_TRANSFER_SIZE
Pierre-Eric Pelloux-Prayer [Fri, 19 Sep 2025 08:35:27 +0000 (10:35 +0200)] 
drm/amdgpu: double AMDGPU_GTT_MAX_TRANSFER_SIZE

Makes copies/evictions faster when gart windows are required.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: check entity lock is held in amdgpu_ttm_job_submit
Pierre-Eric Pelloux-Prayer [Tue, 18 Nov 2025 14:09:14 +0000 (15:09 +0100)] 
drm/amdgpu: check entity lock is held in amdgpu_ttm_job_submit

drm_sched_job_arm and drm_sched_entity_push_job must be called
under the same lock to guarantee the order of execution.

This commit adds a check in amdgpu_ttm_job_submit and fix the
places where the lock was missing.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: add missing lock in amdgpu_benchmark_do_move
Pierre-Eric Pelloux-Prayer [Tue, 18 Nov 2025 14:15:04 +0000 (15:15 +0100)] 
drm/amdgpu: add missing lock in amdgpu_benchmark_do_move

Taking the entity lock is required to guarantee the ordering of
execution. The next commit will add a check that the lock is
held.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agoamdgpu/gtt: remove AMDGPU_GTT_NUM_TRANSFER_WINDOWS
Pierre-Eric Pelloux-Prayer [Mon, 26 Jan 2026 09:17:43 +0000 (10:17 +0100)] 
amdgpu/gtt: remove AMDGPU_GTT_NUM_TRANSFER_WINDOWS

It's not needed anymore.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agoamdgpu/ttm: use amdgpu_gtt_mgr_alloc_entries
Pierre-Eric Pelloux-Prayer [Mon, 26 Jan 2026 09:17:24 +0000 (10:17 +0100)] 
amdgpu/ttm: use amdgpu_gtt_mgr_alloc_entries

Use amdgpu_gtt_mgr_alloc_entries for each entity instead
of reserving a fixed number of pages.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agoamdgpu/vce: use amdgpu_gtt_mgr_alloc_entries
Pierre-Eric Pelloux-Prayer [Mon, 26 Jan 2026 08:48:16 +0000 (09:48 +0100)] 
amdgpu/vce: use amdgpu_gtt_mgr_alloc_entries

Instead of reserving a number of GTT pages for VCE 1.0 this
commit now uses amdgpu_gtt_mgr_alloc_entries to allocate
the pages when initializing vce 1.0.

While at it remove the "does the VCPU BO already have a
32-bit address" check as suggested by Timur.

This decouples vce init from gtt init.

---
v7: renamed variables (Christian)
---

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: add amdgpu_gtt_node_to_byte_offset helper
Pierre-Eric Pelloux-Prayer [Wed, 28 Jan 2026 15:47:01 +0000 (16:47 +0100)] 
drm/amdgpu: add amdgpu_gtt_node_to_byte_offset helper

Having a helper avoids code duplication.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: add amdgpu_ttm_buffer_entity_fini func
Pierre-Eric Pelloux-Prayer [Fri, 9 Jan 2026 15:19:10 +0000 (16:19 +0100)] 
drm/amdgpu: add amdgpu_ttm_buffer_entity_fini func

This allows to have init/fini functions to hold all the init and
teardown code for amdgpu_ttm_buffer_entity.
For now only drm_sched_entity init/destroy function calls are moved
here, but as entities gain new members it will make code simpler.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: statically assign gart windows to ttm entities
Pierre-Eric Pelloux-Prayer [Tue, 18 Nov 2025 13:58:43 +0000 (14:58 +0100)] 
drm/amdgpu: statically assign gart windows to ttm entities

If multiple entities share the same window we must make sure
that jobs using them are executed sequentially.

This commit gives separate windows to each entity, so jobs
from multiple entities could execute in parallel if needed.
(for now they all use the first sdma engine, so it makes no
difference yet).
The entity stores the gart window offsets to centralize the
"window id" to "window offset" in a single place.

default_entity doesn't get any windows reserved since there is
no use for them.

---
v3:
- renamed gart_window_lock -> lock (Christian)
- added amdgpu_ttm_buffer_entity_init (Christian)
- fixed gart_addr in svm_migrate_gart_map (Felix)
- renamed gart_window_idX -> gart_window_offs[]
- added amdgpu_compute_gart_address
v4:
- u32 -> u64
- added kerneldoc
v5:
- removed gtt_window_lock
- simplified gart window creation and use: entities using a
  single window now uses window #0 instead of #1
- fix dst_addr calculation in kfd_migrate.c
---

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amdgpu: remove gart_window_lock usage from gmc v12_1
Pierre-Eric Pelloux-Prayer [Thu, 8 Jan 2026 16:08:06 +0000 (17:08 +0100)] 
drm/amdgpu: remove gart_window_lock usage from gmc v12_1

Same as what was done in commit c79cf5a7d903
("drm/amdgpu: remove gart_window_lock usage from gmc v12") for v12.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Promote DC to 3.2.370
Taimur Hassan [Fri, 6 Feb 2026 23:06:54 +0000 (18:06 -0500)] 
drm/amd/display: Promote DC to 3.2.370

This version brings along the following updates:

 - Add static keyword for sharpness tables.
 - Refactor fams2 calculations.
 - Add gpuvm and hvm params to dml21.
 - Expose functions of other dcn use.
 - Disable SR feature on eDP1 by default.
 - Implement ramless idle mouse trigger.
 - Migrate DCCG register access from hwseq to dccg component.
 - Revert "Add Handling for gfxversion DcGfxBase".
 - Revert changes to Gfx Linear Tiling handling.
 - Skip eDP detection when no sink.
 - Refactor and fix link_dpms I2C.
 - Refactor and fix link_dpms info.
 - Correct logic check error for fast boot.
 - Check return of shaper curve to HW format.
 - Remove conditional for shaper 3DLUT power-on.

Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Refactor and fix link_dpms info
Dominik Kaszewski [Thu, 29 Jan 2026 10:53:29 +0000 (11:53 +0100)] 
drm/amd/display: Refactor and fix link_dpms info

[Why]
get_ext_hdmi_settings contained a copy-paste error, assigning
both reg_num_6g and reg_num from dp0_ext_hdmi_6g_reg_num.

[How]
* Correctly assign reg_num from dp0_ext_hdmi_reg_num.
* Refactor and clean the function.

Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Dominik Kaszewski <dominik.kaszewski@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Refactor and fix link_dpms I2C
Dominik Kaszewski [Thu, 29 Jan 2026 10:26:13 +0000 (11:26 +0100)] 
drm/amd/display: Refactor and fix link_dpms I2C

[Why]
link_dpms.c issues I2C writes during HDMI link enablement. Current
implementation contains a lot of duplicated code with copy-paste
errors.

[How]
* Refactor common logic into helper functions.
* Invert logic with early returns to decrease indentation.
* Sequence writes by looping over data arrays.
* Fix write_i2c_retimer_setting is_over_340mhz checking reg_settings
instead of reg_settings_6g in the i2c_reg_index <= 0x20 check.

Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Dominik Kaszewski <dominik.kaszewski@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Add gpuvm and hvm params to dml21
Dmytro Laktyushkin [Fri, 23 Jan 2026 14:52:40 +0000 (09:52 -0500)] 
drm/amd/display: Add gpuvm and hvm params to dml21

[Why & How]
Add missing params to display configuration for dml21

Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Signed-off-by: Dmytro Laktyushkin <dmytro.laktyushkin@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 months agodrm/amd/display: Refactor fams2 calculations
Dillon Varone [Tue, 9 Dec 2025 21:20:26 +0000 (16:20 -0500)] 
drm/amd/display: Refactor fams2 calculations

[WHY&HOW]
Cleanup calculations based on version to improve for future
expansion.

Reviewed-by: Austin Zheng <austin.zheng@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@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>