]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
4 weeks agodrm/amd/pm: Use gpu metrics 1.9 for SMUv13.0.12
Lijo Lazar [Thu, 14 Aug 2025 11:05:39 +0000 (16:35 +0530)] 
drm/amd/pm: Use gpu metrics 1.9 for SMUv13.0.12

Fill and publish GPU metrics in v1.9 format for SMUv13.0.12 SOCs

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 weeks agodrm/amdgpu: validate the bo from done list for NULL
Sunil Khatri [Fri, 31 Oct 2025 08:40:13 +0000 (14:10 +0530)] 
drm/amdgpu: validate the bo from done list for NULL

Make sure the bo is valid before using it.

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>
4 weeks agodrm/amdgpu: lock bo before calling amdgpu_vm_bo_update_shared
Pierre-Eric Pelloux-Prayer [Tue, 28 Oct 2025 13:09:05 +0000 (14:09 +0100)] 
drm/amdgpu: lock bo before calling amdgpu_vm_bo_update_shared

BO's reservation object must be locked before using
amdgpu_vm_bo_update_shared otherwise dma_resv_assert_held will
complain in amdgpu_vm_update_shared.

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>
4 weeks agodrm/amdgpu: grab a BO reference in vm_lock_done_list.
Christian König [Fri, 31 Oct 2025 08:21:36 +0000 (09:21 +0100)] 
drm/amdgpu: grab a BO reference in vm_lock_done_list.

Otherwise it is possible that between dropping the status lock and
locking the BO that the BO is freed up.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/ras: Fix format truncation
Xiang Liu [Thu, 30 Oct 2025 14:38:49 +0000 (22:38 +0800)] 
drm/amd/ras: Fix format truncation

../ras/rascore/ras_cper.c: In function ‘cper_generate_fatal_record.isra’:
../ras/rascore/ras_cper.c:75:36: error: ‘%llX’ directive output may be truncated writing between 1 and 14 bytes into a region of size between 0 and 7 [-Werror=format-truncation=]
   75 |         snprintf(record_id, 9, "%d:%llX", dev_info.socket_id,
      |                                    ^~~~
../ras/rascore/ras_cper.c:75:32: note: directive argument in the range [0, 72057594037927935]
   75 |         snprintf(record_id, 9, "%d:%llX", dev_info.socket_id,
      |                                ^~~~~~~~~
../ras/rascore/ras_cper.c:75:9: note: ‘snprintf’ output between 4 and 27 bytes into a destination of size 9
   75 |         snprintf(record_id, 9, "%d:%llX", dev_info.socket_id,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   76 |                     RAS_LOG_SEQNO_TO_BATCH_IDX(trace->seqno));
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../ras/rascore/ras_cper.c: In function ‘cper_generate_runtime_record.isra’:
../ras/rascore/ras_cper.c:75:36: error: ‘%llX’ directive output may be truncated writing between 1 and 14 bytes into a region of size between 0 and 7 [-Werror=format-truncation=]
   75 |         snprintf(record_id, 9, "%d:%llX", dev_info.socket_id,
      |                                    ^~~~
../ras/rascore/ras_cper.c:75:32: note: directive argument in the range [0, 72057594037927935]
   75 |         snprintf(record_id, 9, "%d:%llX", dev_info.socket_id,
      |                                ^~~~~~~~~
../ras/rascore/ras_cper.c:75:9: note: ‘snprintf’ output between 4 and 27 bytes into a destination of size 9
   75 |         snprintf(record_id, 9, "%d:%llX", dev_info.socket_id,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   76 |                     RAS_LOG_SEQNO_TO_BATCH_IDX(trace->seqno));
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Xiang Liu <xiang.liu@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/display: Promote DC to 3.2.357
Taimur Hassan [Sat, 25 Oct 2025 00:38:14 +0000 (19:38 -0500)] 
drm/amd/display: Promote DC to 3.2.357

This version brings along following update:

- HDCP2 FW locality check refactors
- Fix black screen issue with HDMI output
- Increase IB mem size
- Revert max buffered cursor size to 64
- Extend inbox0 lock to run Replay / PSR
- Refactor VActive implementation
- Add Pstate viewport reduction
- Persist stream refcount through restore

Acked-by: Wayne Lin <Wayne.Lin@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>
4 weeks agodrm/amd/display: [FW Promotion] Release 0.1.34.0
Taimur Hassan [Fri, 24 Oct 2025 22:42:39 +0000 (18:42 -0400)] 
drm/amd/display: [FW Promotion] Release 0.1.34.0

Release hightlights

DCN35/36
    * Dynamically clock gate before and after prefetch

Acked-by: Wayne Lin <Wayne.Lin@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>
4 weeks agodrm/amd/display: Fix black screen with HDMI outputs
Alex Hung [Wed, 22 Oct 2025 22:19:34 +0000 (16:19 -0600)] 
drm/amd/display: Fix black screen with HDMI outputs

[Why & How]
This fixes the black screen issue on certain APUs with HDMI,
accompanied by the following messages:

amdgpu 0000:c4:00.0: amdgpu: [drm] Failed to setup vendor info
                     frame on connector DP-1: -22
amdgpu 0000:c4:00.0: [drm] Cannot find any crtc or sizes [drm]
                     Cannot find any crtc or sizes

Fixes: 489f0f600ce2 ("drm/amd/display: Fix DVI-D/HDMI adapters")
Suggested-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Hung <alex.hung@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>
4 weeks agodrm/amd/display: Increase IB mem size
Alvin Lee [Thu, 23 Oct 2025 17:56:32 +0000 (13:56 -0400)] 
drm/amd/display: Increase IB mem size

[Why & How]
Increase IB mem size to match size of largest structure that will
use IB transfer between driver and DMU.

Reviewed-by: Oleh Kuzhylnyi <oleh.kuzhylnyi@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@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>
4 weeks agodrm/amd/display: Revert DCN4 max buffered cursor size to 64
Dillon Varone [Thu, 23 Oct 2025 21:07:04 +0000 (17:07 -0400)] 
drm/amd/display: Revert DCN4 max buffered cursor size to 64

[Why & How]
The buffered cursor cap is expressed assuming a square cursor, and usage
of the cursor buffer is limited by the request size. For greater than 32
pixels, the request size is fixed at 256 bytes, so the maximum width
must be floored to the nearest 256th byte. At 4bpp this means even with
24kB DCN4 can only hold a 64x64 cursor in the buffer as even 65 pixels
would require 512 bytes per line instead of 256.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@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>
4 weeks agodrm/amd/display: Persist stream refcount through restore
Joshua Aberback [Thu, 23 Oct 2025 20:43:56 +0000 (16:43 -0400)] 
drm/amd/display: Persist stream refcount through restore

[Why & How]
Overwriting the refcount on stream restore can lead to double-free errors
or memory leaks if an unbalanced number of retains and releases occurs
between a backup and restore.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Joshua Aberback <joshua.aberback@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>
4 weeks agodrm/amd/display: Add Pstate viewport reduction
Austin Zheng [Tue, 30 Sep 2025 19:32:03 +0000 (14:32 -0500)] 
drm/amd/display: Add Pstate viewport reduction

[Why/How]
Add struct to hold calculated reduced viewport pstate
recout reduction lines per plane

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Austin Zheng <Austin.Zheng@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>
4 weeks agodrm/amd/display: Refactor VActive implementation
Austin Zheng [Fri, 3 Oct 2025 14:39:49 +0000 (10:39 -0400)] 
drm/amd/display: Refactor VActive implementation

[Why & How]
Refactors VActive accounting in PMO, and breaks down fill time
requirement by P-State type as it can result in drasitcally different
bandwidth requirements depending on the blackout length.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Austin Zheng <Austin.Zheng@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>
4 weeks agodrm/amd/display: Update P-state naming for clarity.
Austin Zheng [Wed, 24 Sep 2025 14:23:24 +0000 (10:23 -0400)] 
drm/amd/display: Update P-state naming for clarity.

[Why & How]
P-state can refer to different things like UCLK P-state, PPT, or temp read
Update naming for clarity

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Austin Zheng <Austin.Zheng@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>
4 weeks agodrm/amd/display: Remove old PMO options
Austin Zheng [Wed, 17 Sep 2025 16:56:00 +0000 (12:56 -0400)] 
drm/amd/display: Remove old PMO options

[Why & How]
Removes deprecated or unused PMO options.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Austin Zheng <Austin.Zheng@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>
4 weeks agodrm/amd/display: Add pte_buffer_mode and force_one_row_for_frame in dchub reg
Austin Zheng [Wed, 17 Sep 2025 15:38:37 +0000 (10:38 -0500)] 
drm/amd/display: Add pte_buffer_mode and force_one_row_for_frame in dchub reg

[Why & How]
Update structs for rq regs

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Austin Zheng <Austin.Zheng@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>
4 weeks agodrm/amd/display: Extend inbox0 lock to run Replay/PSR
Andrew Mazour [Wed, 15 Oct 2025 16:19:49 +0000 (12:19 -0400)] 
drm/amd/display: Extend inbox0 lock to run Replay/PSR

[Why]
The inbox1 infrastructure is deprecated, so to support display
power features requiring a DMUB interlock moving forward extend
the inbox0 locking conditions to also include Replay or PSR.

[How]
Implemented a series of changes to improve HW lock handling:
- Deprecated should_use_dmub_inbox1_lock() and guarded it with
  DCN401 flag.
- Migrated lock checks into inbox0 helpers and added PSR/Replay
  enablement checks to ensure correct behavior.
- Updated HWSS fast update path to acquire HW lock as needed
  using the new helpers.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Andrew Mazour <Andrew.Mazour@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>
4 weeks agodrm/amd/display: fw locality check refactors
Wenjing Liu [Fri, 3 Oct 2025 15:59:39 +0000 (11:59 -0400)] 
drm/amd/display: fw locality check refactors

[why]
There are some new changes for HDCP2 firmware locality check. The
implementation doesn't perfectly fit the intended design and clarity.

1. Clarify and consolidate variable responsibilities.
The previous implementation introduced the following variables:
- config.ddc.funcs.atomic_write_poll_read_i2c (optional pointer)
- hdcp->config.ddc.funcs.atomic_write_poll_read_aux (optional pointer)
- hdcp->connection.link.adjust.hdcp2.force_sw_locality_check (bool)
- hdcp->config.debug.lc_enable_sw_fallback (bool)
- use_fw (bool)
They will be used together to determine two operations:
- Whether to use FW locality check
- Whether to use SW fallback on FW locality check failure
The refactor streamlines this by introducing two variables in the hdcp2
link adjustment, while ensuring function pointers are always assigned
and remain independent from policy decisions:
- use_fw_locality_check (bool) -> true if fw locality should be used.
- use_sw_locality_fallback (bool) -> true to reset use_fw_locality_check
back to false and retry on fw locality check failure.

2. Mixed meanings of l_prime_read transition input
l_prime_read originally means if l_prime is read when sw locality check
is used. When FW locality check is used, l_prime_read means if lc init
write, l prime poll and l_prime read combo operation is successful. The
mix of meanings is confusing. The refactor introduces a new variable
l_prime_combo_read to isolate the second meaning into its own variable.

3. Missing specific error code on firmware locality error.
The original change reuses the generic DDC failure error code when
firmware fails to return locality check result. This is not ideal as
DDC failure indicates an error occurred during an I2C/AUX transaction.
FW locality failure could be caused by polling timeout in firmware or
failure to acquire firmware access. Which sits at a higher level of
abstraction above DDC hardware. An incorrect error code could mislead
the debug into a wrong direction.

4. Correcting misplaced comments. The previous implementation of the
firmware locality check resulted in some comments in hdcp2_transition
being incorrectly positioned. This refactor relocates those comments to
their appropriate locations for better clarity.

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@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>
4 weeks agodrm/amdgpu: Implement user queue reset functionality
Jesse.Zhang [Fri, 24 Oct 2025 02:51:52 +0000 (10:51 +0800)] 
drm/amdgpu: Implement user queue reset functionality

This patch adds robust reset handling for user queues (userq) to improve
recovery from queue failures. The key components include:

1. Queue detection and reset logic:
   - amdgpu_userq_detect_and_reset_queues() identifies failed queues
   - Per-IP detect_and_reset callbacks for targeted recovery
   - Falls back to full GPU reset when needed

2. Reset infrastructure:
   - Adds userq_reset_work workqueue for async reset handling
   - Implements pre/post reset handlers for queue state management
   - Integrates with existing GPU reset framework

3. Error handling improvements:
   - Enhanced state tracking with HUNG state
   - Automatic reset triggering on critical failures
   - VRAM loss handling during recovery

4. Integration points:
   - Added to device init/reset paths
   - Called during queue destroy, suspend, and isolation events
   - Handles both individual queue and full GPU resets

The reset functionality works with both gfx/compute and sdma queues,
providing better resilience against queue failures while minimizing
disruption to unaffected queues.

v2: add detection and reset calls when preemption/unmaped fails.
    add a per device userq counter for each user queue type.(Alex)
v3: make sure we hold the adev->userq_mutex when we call amdgpu_userq_detect_and_reset_queues. (Alex)
   warn if the adev->userq_mutex is not held.
v4: make sure we have all of the uqm->userq_mutex held.
   warn if the uqm->userq_mutex is not held.

v5: Use array for user queue type counters.(Alex)
    all of the uqm->userq_mutex need to be held when calling detect and reset.  (Alex)

v6: fix lock dep warning in amdgpu_userq_fence_dence_driver_process

v7: add the queue types in an array and use a loop in amdgpu_userq_detect_and_reset_queues (Lijo)
v8: remove atomic_set(&userq_mgr->userq_count[i], 0).
   it should already be 0 since we kzalloc the structure (Alex)
v9: For consistency with kernel queues, We may want something like:
   amdgpu_userq_is_reset_type_supported (Alex)

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>
4 weeks agodrm/amd/display: Don't stretch non-native images by default in eDP
Mario Limonciello (AMD) [Thu, 30 Oct 2025 19:39:43 +0000 (14:39 -0500)] 
drm/amd/display: Don't stretch non-native images by default in eDP

commit 978fa2f6d0b12 ("drm/amd/display: Use scaling for non-native
resolutions on eDP") started using the GPU scaler hardware to scale
when a non-native resolution was picked on eDP. This scaling was done
to fill the screen instead of maintain aspect ratio.

The idea was supposed to be that if a different scaling behavior is
preferred then the compositor would request it.  The not following
aspect ratio behavior however isn't desirable, so adjust it to follow
aspect ratio and still try to fill screen.

Note: This will lead to black bars in some cases for non-native
resolutions. Compositors can request the previous behavior if desired.

Fixes: 978fa2f6d0b1 ("drm/amd/display: Use scaling for non-native resolutions on eDP")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4538
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amdkfd: Fix Unchecked Return Values
Sunday Clement [Mon, 27 Oct 2025 18:00:59 +0000 (14:00 -0400)] 
drm/amdkfd: Fix Unchecked Return Values

Properly Check for return values from calls to debug functions in
runtime_disable().

v2: storing the last non zero returned value from the loop.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>
Reviewed-by: Jonathan Kim <Jonathan.Kim@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd: Unwind for failed device suspend
Mario Limonciello (AMD) [Sun, 26 Oct 2025 04:29:39 +0000 (23:29 -0500)] 
drm/amd: Unwind for failed device suspend

If device suspend has failed, add a recovery flow that will attempt
to unwind the suspend and get things back up and running.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4627
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd: Add an unwind for failures in amdgpu_device_ip_suspend_phase2()
Mario Limonciello (AMD) [Sun, 26 Oct 2025 04:29:38 +0000 (23:29 -0500)] 
drm/amd: Add an unwind for failures in amdgpu_device_ip_suspend_phase2()

If any hardware IPs involved with the second phase of suspend fail, unwind
all steps to restore back to original state.

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd: Add an unwind for failures in amdgpu_device_ip_suspend_phase1()
Mario Limonciello (AMD) [Sun, 26 Oct 2025 04:29:37 +0000 (23:29 -0500)] 
drm/amd: Add an unwind for failures in amdgpu_device_ip_suspend_phase1()

If any hardware IPs involved with the first phase of suspend fail, unwind
all steps to restore back to original state.

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amdgpu: Drop PMFW RLC notifier from amdgpu_device_suspend()
Alex Deucher [Sun, 26 Oct 2025 04:29:36 +0000 (23:29 -0500)] 
drm/amdgpu: Drop PMFW RLC notifier from amdgpu_device_suspend()

For S3 on vangogh, PMFW needs to be notified before the
driver powers down RLC.  This already happens in smu_disable_dpms()
so drop the superfluous call in amdgpu_device_suspend().

Co-developed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/ras: Use correct severity for BP threshold exceed event
Xiang Liu [Thu, 23 Oct 2025 02:10:02 +0000 (10:10 +0800)] 
drm/amd/ras: Use correct severity for BP threshold exceed event

The severity of CPER for BP threshold exceed event should be set as
FATAL to match the OOB implementation.

Signed-off-by: Xiang Liu <xiang.liu@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/ras: Correct info field of bad page threshold exceed CPER
Xiang Liu [Mon, 20 Oct 2025 08:44:29 +0000 (16:44 +0800)] 
drm/amd/ras: Correct info field of bad page threshold exceed CPER

Correct valid_bits and ms_chk_bits of section info field for bad page
threshold exceed CPER to match OOB's behavior.

Signed-off-by: Xiang Liu <xiang.liu@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agoMAINTAINERS: adjust file entry in AMD DISPLAY CORE - DML
Lukas Bulwahn [Thu, 30 Oct 2025 14:37:37 +0000 (15:37 +0100)] 
MAINTAINERS: adjust file entry in AMD DISPLAY CORE - DML

Commit e6a8a000cfe6 ("drm/amd/display: Rename dml2 to dml2_0 folder")
renames the directory dml2 to dml2_0 in ./drivers/gpu/drm/amd/display/dc,
but misses to adjust the file entry in AMD DISPLAY CORE - DML.

Adjust the file entry after this directory renaming.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/display: remove unneeded semicolon
Jiapeng Chong [Thu, 30 Oct 2025 01:56:29 +0000 (09:56 +0800)] 
drm/amd/display: remove unneeded semicolon

No functional modification involved.

./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:7392:3-4: Unneeded semicolon.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=26821
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/display: remove unneeded semicolon
Jiapeng Chong [Thu, 30 Oct 2025 01:56:30 +0000 (09:56 +0800)] 
drm/amd/display: remove unneeded semicolon

No functional modification involved.

./drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c:1850:3-4: Unneeded semicolon.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=26821
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/display: remove unneeded semicolon
Jiapeng Chong [Thu, 30 Oct 2025 01:56:31 +0000 (09:56 +0800)] 
drm/amd/display: remove unneeded semicolon

No functional modification involved.

./drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c:1674:3-4: Unneeded semicolon.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=26821
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/pm/si: Delete unused structs and fields
Timur Kristóf [Thu, 30 Oct 2025 09:15:56 +0000 (10:15 +0100)] 
drm/amd/pm/si: Delete unused structs and fields

The contents of si_dpm.h seem to have been copied from the
old radeon driver, including a lot of structs and fields which
were only relevant to GPU generations even older than SI.

A lot of these can be deleted without causing much churn to the
actual SI DPM code. Let's delete them to make the code easier
to understand.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/pm: Use gpu metrics 1.9 for SMUv13.0.6
Lijo Lazar [Tue, 12 Aug 2025 12:56:59 +0000 (18:26 +0530)] 
drm/amd/pm: Use gpu metrics 1.9 for SMUv13.0.6

Fill and publish GPU metrics in v1.9 format for SMUv13.0.6 SOCs

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 weeks agodrm/amd/pm: Add helper functions for gpu metrics
Lijo Lazar [Mon, 11 Aug 2025 13:37:05 +0000 (19:07 +0530)] 
drm/amd/pm: Add helper functions for gpu metrics

Add helper macros to define metrics struct definitions. It will define
structs with field type followed by actual field. A helper macro is also
added to initialize the field encoding for all fields and to initialize
the field members to 0xFFs.

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 weeks agodrm/amd/pm: fix missing device_attr cleanup in amdgpu_pm_sysfs_init()
Yang Wang [Thu, 30 Oct 2025 05:06:24 +0000 (13:06 +0800)] 
drm/amd/pm: fix missing device_attr cleanup in amdgpu_pm_sysfs_init()

Use the correct label to complete all cleanup work.

Fixes: 4d154b1ca580 ("drm/amd/pm: Add support for DPM policies")
Fixes: 25e82f2e2c59 ("drm/amd/pm: Add temperature metrics sysfs entry")
Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/pm: fix the issue of size calculation error for smu 13.0.6
Yang Wang [Mon, 27 Oct 2025 07:22:54 +0000 (15:22 +0800)] 
drm/amd/pm: fix the issue of size calculation error for smu 13.0.6

v1:
the driver should handle return value of smu_v13_0_6_printk_clk_levels()
to return the correct size for sysfs reads.

v2:
fix the issue of size calculation error in smu_v13_0_6_print_clks()

Fixes: cdfdec6f1608 ("drm/amd/pm: Avoid writing nulls into `pp_od_clk_voltage`")
Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/ras: Update IPID value for bad page threshold CPER
Xiang Liu [Mon, 20 Oct 2025 07:45:23 +0000 (15:45 +0800)] 
drm/amd/ras: Update IPID value for bad page threshold CPER

The IPID register value for bad page threshold CPER holds socket_id info
now according to the latest definition.

Signed-off-by: Xiang Liu <xiang.liu@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/display: Fix null pointer on analog detection
Harry Wentland [Wed, 29 Oct 2025 14:28:14 +0000 (10:28 -0400)] 
drm/amd/display: Fix null pointer on analog detection

Check if we have an amdgpu_dm_connector->dc_sink first before
adding common modes for analog outputs. If we don't have a
sink yet we can safely skip this.

Fixes: 70181ad96ec2 ("drm/amd/display: Add common modes to analog displays without EDID")
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amdgpu: Fix error injection parameter error
YiPeng Chai [Tue, 28 Oct 2025 08:30:12 +0000 (16:30 +0800)] 
drm/amdgpu: Fix error injection parameter error

Fix error injection parameter error.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/ras: Fix the error of undefined reference to `__udivdi3'
YiPeng Chai [Tue, 28 Oct 2025 08:34:34 +0000 (16:34 +0800)] 
drm/amd/ras: Fix the error of undefined reference to `__udivdi3'

Fix the error:
drivers/gpu/drm/amd/amdgpu/../ras/ras_mgr/amdgpu_ras_mgr.c:132:undefined reference to `__udivdi3'

Fixes: fa0b203cd902 ("drm/amd/ras: Add amdgpu ras management function.")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202510272144.6SUHUoWx-lkp@intel.com/
Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amdgpu: Remove invalidate and flush hdp macros
Asad Kamal [Tue, 28 Oct 2025 14:08:28 +0000 (22:08 +0800)] 
drm/amdgpu: Remove invalidate and flush hdp macros

Remove amdgpu_asic_flush_hdp & amdgpu_asic_invalidate_hdp functions and
directly use the mapped ones

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amd/ras: Add CPER ring read for uniras
Xiang Liu [Wed, 22 Oct 2025 07:11:42 +0000 (15:11 +0800)] 
drm/amd/ras: Add CPER ring read for uniras

Read CPER raw data from debugfs node "/sys/kernel/debug/dri/*/
amdgpu_ring_cper".

Signed-off-by: Xiang Liu <xiang.liu@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amdgpu: move reset debug disable handling
Alex Deucher [Tue, 14 Oct 2025 21:01:05 +0000 (17:01 -0400)] 
drm/amdgpu: move reset debug disable handling

Move everything to the supported resets masks rather than
having an explicit misc checks for this.

Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amdgpu: Update invalidate and flush hdp function
Asad Kamal [Mon, 27 Oct 2025 10:11:52 +0000 (18:11 +0800)] 
drm/amdgpu: Update invalidate and flush hdp function

Update asic_invalidate_hdp and asic_flush_hdp function to check if ip
function exist, if not return void

v2: Use else/if (Kevin)
    Update function name (Lijo)

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amdgpu: caller should make sure not to double free
Sunil Khatri [Tue, 28 Oct 2025 12:09:27 +0000 (17:39 +0530)] 
drm/amdgpu: caller should make sure not to double free

Remove the NULL check from amdgpu_hmm_range_free for hmm_pfns
as caller is responsible not to call amdgpu_hmm_range_free
more than once.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amdgpu: set default gfx reset masks for gfx6-8
Alex Deucher [Tue, 14 Oct 2025 20:45:17 +0000 (16:45 -0400)] 
drm/amdgpu: set default gfx reset masks for gfx6-8

These were not set so soft recovery was inadvertantly
disabled.

Fixes: 6ac55eab4fc4 ("drm/amdgpu: move reset support type checks into the caller")
Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agodrm/amdkfd: clean up the code to free hmm_range
Sunil Khatri [Tue, 28 Oct 2025 08:19:24 +0000 (13:49 +0530)] 
drm/amdkfd: clean up the code to free hmm_range

a. hmm_range is either NULL or a valid pointer so we
do not need to set range to NULL ever.

b. keep the hmm_range_free in the end irrespective of
the other conditions to avoid some additional checks
and also avoid double free issue.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 weeks agoMerge tag 'amd-drm-next-6.19-2025-10-29' of https://gitlab.freedesktop.org/agd5f...
Simona Vetter [Fri, 31 Oct 2025 21:08:23 +0000 (22:08 +0100)] 
Merge tag 'amd-drm-next-6.19-2025-10-29' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.19-2025-10-29:

amdgpu:
- VPE idle handler fix
- Re-enable DM idle optimizations
- DCN3.0 fix
- SMU fix
- Powerplay fixes for fiji/iceland
- License copy-pasta fixes
- HDP eDP panel fix
- Vblank fix
- RAS fixes
- SR-IOV updates
- SMU 13 VCN reset fix
- DMUB fixes
- DC frame limit fix
- Additional DC underflow logging
- DCN 3.1.5 fixes
- DC Analog encoders support
- Enable DC on bonaire by default
- UserQ fixes
- Remove redundant pm_runtime_mark_last_busy() calls

amdkfd:
- Process cleanup fix
- Misc fixes

radeon:
- devm migration fixes
- Remove redundant pm_runtime_mark_last_busy() calls

UAPI
- Add ABM KMS property
  Proposed kwin changes: https://invent.kde.org/plasma/kwin/-/merge_requests/6028

Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patch.msgid.link/20251029205713.9480-1-alexander.deucher@amd.com
4 weeks agoMerge tag 'drm-intel-gt-next-2025-10-29' of https://gitlab.freedesktop.org/drm/i915...
Simona Vetter [Fri, 31 Oct 2025 17:57:54 +0000 (18:57 +0100)] 
Merge tag 'drm-intel-gt-next-2025-10-29' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next

Driver Changes:

Fixes/improvements/new stuff:

- Set O_LARGEFILE in __create_shmem() (Taotao Chen)
- Fix incorrect error handling in shmem_pwrite() (Taotao Chen)
- Skip GuC communication warning on reset in progress [guc] (Zhanjun Dong)
- Fix conversion between clock ticks and nanoseconds [guc] (Umesh Nerlige Ramappa)

Miscellaneous:

- Avoid accessing uninitialized context in emit_rpcs_query() [selftests] (Krzysztof Karas)
- Fix typo in comment (I915_EXEC_NO_RELOC) [gem] (Marlon Henrique Sanches)

Backmerges:

- Merge drm/drm-next into drm-intel-gt-next (Joonas Lahtinen)

Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
From: Tvrtko Ursulin <tursulin@igalia.com>
Link: https://patch.msgid.link/aQH994lQI_iVPzTI@linux
4 weeks agoMerge tag 'drm-misc-next-2025-10-28' of https://gitlab.freedesktop.org/drm/misc/kerne...
Simona Vetter [Fri, 31 Oct 2025 17:47:16 +0000 (18:47 +0100)] 
Merge tag 'drm-misc-next-2025-10-28' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next

drm-misc-next for v6.19-rc1:

UAPI Changes:

Cross-subsystem Changes:
- Update DT bindings for renesas and powervr-rogue.
- Update MAINTAINERS email and add spsc_queue.

Core Changes:
- Allow ttm page protection flags on risc-v.
- Move freeing of drm client memory to driver.

Driver Changes:
- Assorted small fixes and updates to qaic, ivpu, st7571-i2c, gud,
  amdxdna.
- Allow configuration of vkms' display through configfs.
- Add Arm Ethos-U65/U85 accel driver.

Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
From: Maarten Lankhorst <dev@lankhorst.se>
Link: https://patch.msgid.link/32b43261-3c99-49d9-92ee-615ada1d01e8@lankhorst.se
4 weeks agoMerge tag 'drm-xe-next-2025-10-28' of https://gitlab.freedesktop.org/drm/xe/kernel...
Simona Vetter [Fri, 31 Oct 2025 17:40:53 +0000 (18:40 +0100)] 
Merge tag 'drm-xe-next-2025-10-28' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next

Driver Changes:
More xe3p support (Harish, Brian, Balasubramani, Matt Roper)
Make panic support work on VRAM for display (Maarten)
Fix stolen size check (Shuicheng)
xe_pci_test update (Gustavo)
VF migration updates (Tomasz)
A couple of fixes around allocation and PM references (Matt Brost)
Migration update for the MEM_COPY instruction (Matt Auld)
Initial CRI support (Balasubramani, Matt Roper)
Use SVM range helpers in PT layer (Matt Brost)
Drop MAX_GT_TYPE_CHARS constant (Matt Roper)
Fix spelling and typos (Sanjay)
Fix VF FLR synchronization between all GTs (Michal)
Add a Workaround (Nitin)
Access VF's register using dedicated MMIO view (Michal)

Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Link: https://patch.msgid.link/aQCl9uJxN6CWJ8Vg@fedora
4 weeks agoMerge tag 'amd-drm-next-6.19-2025-10-24' of https://gitlab.freedesktop.org/agd5f...
Simona Vetter [Fri, 31 Oct 2025 17:33:43 +0000 (18:33 +0100)] 
Merge tag 'amd-drm-next-6.19-2025-10-24' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.19-2025-10-24:

amdgpu:
- HMM cleanup
- Add new RAS framework
- DML2.1 updates
- YCbCr420 fixes
- DC FP fixes
- DMUB fixes
- LTTPR fixes
- DTBCLK fixes
- DMU cursor offload handling
- Userq validation improvements
- Misc code cleanups
- Unify shutdown callback handling
- Suspend improvements
- Power limit code cleanup
- Fence cleanup
- IP Discovery cleanup
- SR-IOV fixes
- AUX backlight fixes
- DCN 3.5 fixes
- HDMI compliance fixes
- DCN 4.0.1 cursor updates
- DCN interrupt fix
- DC KMS full update improvements
- Add additional HDCP traces
- DCN 3.2 fixes
- DP MST fixes
- Add support for new SR-IOV mailbox interface

Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://lore.kernel.org/r/20251024175249.58099-1-alexander.deucher@amd.com
5 weeks agodrm/radeon: Remove redundant pm_runtime_mark_last_busy() calls
Sakari Ailus [Mon, 27 Oct 2025 13:14:40 +0000 (15:14 +0200)] 
drm/radeon: Remove redundant pm_runtime_mark_last_busy() calls

pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
to pm_runtime_mark_last_busy(). Remove the now-redundant explicit call to
pm_runtime_mark_last_busy().

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd: Remove redundant pm_runtime_mark_last_busy() calls
Sakari Ailus [Mon, 27 Oct 2025 13:14:38 +0000 (15:14 +0200)] 
drm/amd: Remove redundant pm_runtime_mark_last_busy() calls

pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
to pm_runtime_mark_last_busy(). Remove the now-redundant explicit call to
pm_runtime_mark_last_busy().

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu/pm: Add definition for gpu_metrics v1.9
Lijo Lazar [Mon, 11 Aug 2025 12:00:40 +0000 (17:30 +0530)] 
drm/amdgpu/pm: Add definition for gpu_metrics v1.9

Add gpu metrics definition which is only a set of gpu metrics
attributes. A field is encoded by its id, type and number of instances.

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>
5 weeks agodrm/amdkfd: Fix Unchecked Return Value
Sunday Clement [Fri, 17 Oct 2025 14:15:50 +0000 (10:15 -0400)] 
drm/amdkfd: Fix Unchecked Return Value

Properly check the return values for function, as done elsewhere.

Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>
Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Use DC by default for Bonaire
Timur Kristóf [Fri, 26 Sep 2025 18:02:03 +0000 (20:02 +0200)] 
drm/amdgpu: Use DC by default for Bonaire

Now that DC supports analog connectors, there is nothing stopping
us from using it by default on Bonaire.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Don't add freesync modes to analog displays (v2)
Timur Kristóf [Fri, 26 Sep 2025 18:02:02 +0000 (20:02 +0200)] 
drm/amd/display: Don't add freesync modes to analog displays (v2)

VRR is not supported on analog signals.
Don't add freesync modes to analog displays or when
VRR is unsupported by DC.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Add common modes to analog displays without EDID
Timur Kristóf [Fri, 26 Sep 2025 18:02:01 +0000 (20:02 +0200)] 
drm/amd/display: Add common modes to analog displays without EDID

When the EDID of an analog display is not available, we can't
know the possible modes supported by the display. However, we
still need to offer the user to select from a variety of common
modes. It will be up to the user to select the best one, though.

This is how it works on other operating systems as well as the
legacy display code path in amdgpu.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Use DAC load detection on analog connectors (v2)
Timur Kristóf [Fri, 26 Sep 2025 18:02:00 +0000 (20:02 +0200)] 
drm/amd/display: Use DAC load detection on analog connectors (v2)

This feature is useful for analog connections without EDID:
- Really old monitors with a VGA connector
- Cheap DVI/VGA adapters that don't connect DDC pins

When a connection is established through DAC load detection,
the driver is supposed to fill in the supported modes for the
display, which we already do in amdgpu_dm_connector_get_modes.

Also, because the load detection causes visible glitches, do not
attempt to poll the connector again after it was detected this
way. Note that it will still be polled after sleep/resume or
when force is enabled, which is okay.

v2:
Add dc_connection_dac_load connection type.
Properly release sink when no display is connected.
Don't print error when EDID isn't read from an analog display.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Add DAC_LoadDetection to BIOS parser (v2)
Timur Kristóf [Fri, 26 Sep 2025 18:01:59 +0000 (20:01 +0200)] 
drm/amd/display: Add DAC_LoadDetection to BIOS parser (v2)

DAC_LoadDetection can be used to determine whether something
is connected to an analog connector by determining if there is
an analog load. This causes visible flickering on displays, so
we only resort to using this when the connected display doesn't
have an EDID.

For reference, see the legacy display code:
amdgpu_atombios_encoder_dac_load_detect

v2:
Only clear corresponding bit from BIOS_SCRATCH_0.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Make get_support_mask_for_device_id reusable
Timur Kristóf [Fri, 26 Sep 2025 18:01:58 +0000 (20:01 +0200)] 
drm/amd/display: Make get_support_mask_for_device_id reusable

This will be reused by DAC load detection.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Add DCE BIOS_SCRATCH_0 register
Timur Kristóf [Fri, 26 Sep 2025 18:01:57 +0000 (20:01 +0200)] 
drm/amd/display: Add DCE BIOS_SCRATCH_0 register

The BIOS uses this register to write the results of the
DAC_LoadDetection command, so we'll need to read this
in order to make DAC load detection work.

As a reference, I used the mmBIOS_SCRATCH_0 definition from
the amdgpu legacy display code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Poll analog connectors (v3)
Timur Kristóf [Fri, 26 Sep 2025 18:01:56 +0000 (20:01 +0200)] 
drm/amd/display: Poll analog connectors (v3)

VGA connectors don't support any hotplug detection, so the kernel
needs to periodically poll them to see if a display is connected.

DVI-I connectors have hotplug detection for digital signals, and
some analog DVI cables pull up that pin to work with that.
However, in general not all DVI cables do this so we can't rely on
this feature, therefore we need to poll DVI-I connectors as well.

v2:
Call drm_kms_helper_poll_fini in amdgpu_dm_hpd_fini.
Disable/enable polling on suspend/resume.
Don't call full link detection when already connected.

v3:
Encounter CLANG build failure. Remove unused variable:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c:980:7:
error: variable 'use_polling' set but not used [-Werror,-Wunused-but-
set-variable]
980 |         bool use_polling = false;

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Refactor amdgpu_dm_connector_detect (v2)
Timur Kristóf [Fri, 26 Sep 2025 18:01:55 +0000 (20:01 +0200)] 
drm/amd/display: Refactor amdgpu_dm_connector_detect (v2)

Prepare for polling analog connectors.
Document the function better.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Add analog link detection (v2)
Timur Kristóf [Fri, 26 Sep 2025 18:01:54 +0000 (20:01 +0200)] 
drm/amd/display: Add analog link detection (v2)

Analog displays typically have a DDC connection which can be
used by the GPU to read EDID. This commit adds the capability
to probe analog displays using DDC, reading the EDID header and
deciding whether the analog link is connected based on the data
that was read.

Note that VGA has no HPD (hotplug detection), so we need to
to do analog link detection for VGA before checking HPD.

In case of DVI-I, while the connector supports HPD, not all
analog cables connect the HPD pins, so we can't rely on HPD
either.

For reference, see the legacy display code:
amdgpu_connector_vga_detect
amdgpu_display_ddc_probe

DAC load detection will be implemented in a separate commit.

v2:
Fix crash / black screen on newer GPUs during link detection.
Ignore HPD pin for analog connectors.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Support DAC in dce110_hwseq
Timur Kristóf [Fri, 26 Sep 2025 18:01:53 +0000 (20:01 +0200)] 
drm/amd/display: Support DAC in dce110_hwseq

The dce110_hwseq is used by all DCE hardware,
so add the DAC support here.

When enabling/disabling a stream for a RGB signal,
this will call the VBIOS to enable/disable the DAC.
Additionally, when applying the controller context,
call SelectCRTC_Source from VBIOS in order to
direct the CRTC output to the DAC.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Implement DCE analog link encoders (v2)
Timur Kristóf [Fri, 26 Sep 2025 18:01:52 +0000 (20:01 +0200)] 
drm/amd/display: Implement DCE analog link encoders (v2)

We support two kinds of analog connections:

1. DVI-I, which allows both digital and analog signals:
The DC code base only allows 1 encoder per connector, and the
preferred engine type is still going to be digital. So, for DVI-I
to work, we need to make sure the pre-existing link encoder can
also work with analog signals.

1. VGA, which only supports analog signals:
For VGA, we need to create a link encoder that only works with the
DAC without perturbing any digital transmitter functionality.
Since dce110_link_encoder already supports analog DVI-I,
just reuse that code for VGA as well.

v2:
Reduce code churn by reusing same link encoder for VGA and DVI-I.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Implement DCE analog stream encoders
Timur Kristóf [Fri, 26 Sep 2025 18:01:51 +0000 (20:01 +0200)] 
drm/amd/display: Implement DCE analog stream encoders

Add analog stream encoders for DCE which will be used when
connecting an analog display through VGA or DVI-I.

Considering that all stream encoder functions currently deal
with digital streams, there is nothing for an analog stream
encoder to do, making them basically a no-op.
That being said, we still need some kind of stream encoder to
represent an analog stream, and it is beneficial to split them
from digital stream encoders in the code to make sure they
don't accidentally write any DIG* registers.

On supported chips there is currently up to 1 analog encoder,
which is DACA. There are references to DACB in some code such
as VBIOS commands and register files but it seems to be
not present on DCE 6 and newer.

Set num_analog_stream_encoder = 1 so that we can support
the analog connectors on DCE 6-10, for now.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Add concept of analog encoders (v2)
Timur Kristóf [Fri, 26 Sep 2025 18:01:50 +0000 (20:01 +0200)] 
drm/amd/display: Add concept of analog encoders (v2)

Add a num_analog_stream_encoders field to indicate how many
analog stream encoders are present. When analog stream encoders
are present, create them.

Additionally, add an analog_engine field to link encoders and
search for supported analog encoders in the BIOS for each link.
When connecting an RGB signal, search for analog stream encoders.

The actual DCE analog link and stream encoder is going to be
added in a subsequent commit.

v2:
Add check to see if an analog engine is really supported.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Determine early if a link has supported encoders (v2)
Timur Kristóf [Fri, 26 Sep 2025 18:01:49 +0000 (20:01 +0200)] 
drm/amd/display: Determine early if a link has supported encoders (v2)

Avoid initializing DDC, HPD, etc. when we know that the link is
not going to be constructed because it has no supported encoders.

This is mainly useful for old GPUs which may have encoders such
as TRAVIS and NUTMEG that are not yet supported by DC.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Don't try to enable/disable HPD when unavailable
Timur Kristóf [Fri, 26 Sep 2025 18:01:48 +0000 (20:01 +0200)] 
drm/amd/display: Don't try to enable/disable HPD when unavailable

VGA connectors don't have HPD (hotplug detection), so don't
touch any HPD related registers for VGA.

Determine whether hotplug detection is available by checking that
the interrupt source is invalid.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Don't use stereo sync and audio on RGB signals (v2)
Timur Kristóf [Fri, 26 Sep 2025 18:01:47 +0000 (20:01 +0200)] 
drm/amd/display: Don't use stereo sync and audio on RGB signals (v2)

Analog video signals on VGA or DVI-A (analog part of DVI-I)
don't support audio, so avoid calling any audio related
functions on analog signals.

Stereo sync was not set up for analog signals in the legacy
display code either, so there is no loss of functionality if
we omit it from DC for now.

Also add a dc_is_rgb_signal similar to other dc_is_*_signal.

v2:
Added comment to clarify what we mean by RGB in this context.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Get maximum pixel clock from VBIOS
Timur Kristóf [Fri, 26 Sep 2025 18:01:46 +0000 (20:01 +0200)] 
drm/amd/display: Get maximum pixel clock from VBIOS

We will use this for validating the pixel clock when
an analog monitor is connected to VGA or DVI-I connectors.

For reference, see the legacy display code:
amdgpu_connector_vga_mode_valid

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Add SelectCRTC_Source to BIOS parser
Timur Kristóf [Fri, 26 Sep 2025 18:01:45 +0000 (20:01 +0200)] 
drm/amd/display: Add SelectCRTC_Source to BIOS parser

The SelectCRTC_Source command will be used to change which CRTC
should be connected to which encoder.

For reference, see the legacy display code:
amdgpu_atombios_encoder_set_crtc_source

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Hook up DAC to bios_parser_encoder_control
Timur Kristóf [Fri, 26 Sep 2025 18:01:44 +0000 (20:01 +0200)] 
drm/amd/display: Hook up DAC to bios_parser_encoder_control

Enable the codebase to use encoder_control()
when the encoder engine is one of the DACs.

The BIOS parser already supports calling the DAC1EncoderControl
function from the VBIOS, but it was not exposed anywhere.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Introduce MAX_LINK_ENCODERS (v2)
Timur Kristóf [Fri, 26 Sep 2025 18:01:43 +0000 (20:01 +0200)] 
drm/amd/display: Introduce MAX_LINK_ENCODERS (v2)

We are going to support analog encoders as well, not just digital,
so we need to make space for them in various arrays.

v2: Fix typo.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Add analog bit to edid_caps (v2)
Timur Kristóf [Fri, 26 Sep 2025 18:01:42 +0000 (20:01 +0200)] 
drm/amd/display: Add analog bit to edid_caps (v2)

The new analog bit will be used with DVI-I connectors.

DVI-I connectors can connect to both digital and analog monitors
and this bit will help distinguish between those.

v2:
Sanitize analog bit based on connector type.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdkfd: Fix use-after-free of HMM range in svm_range_validate_and_map()
Srinivasan Shanmugam [Thu, 23 Oct 2025 14:24:16 +0000 (19:54 +0530)] 
drm/amdkfd: Fix use-after-free of HMM range in svm_range_validate_and_map()

The function svm_range_validate_and_map() was freeing `range` when
amdgpu_hmm_range_get_pages() failed. But later, the code still used the
same `range` pointer and freed it again. This could cause a
use-after-free and double-free issue.

The fix sets `range = NULL` right after it is freed and checks for
`range` before using or freeing it again.

v2: Removed duplicate !r check in the condition for clarity.

v3: In amdgpu_hmm_range_get_pages(), when hmm_range_fault() fails, we
kvfree(pfns) but leave the pointer in hmm_range->hmm_pfns still pointing
to freed memory. The caller (or amdgpu_hmm_range_free(range)) may try to
free range->hmm_range.hmm_pfns again, causing a double free, Setting
hmm_range->hmm_pfns = NULL immediately after kvfree(pfns) prevents both
double free. (Philip)

In svm_range_validate_and_map(), When r == 0, it means success → range
is not NULL.  When r != 0, it means failure → already made range = NULL.
So checking both (!r && range) is unnecessary because the moment r == 0,
we automatically know range exists and is safe to use. (Philip)

Fixes: 737da5363cc0 ("drm/amdgpu: update the functions to use amdgpu version of hmm")
Reported by: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Philip Yang <Philip.Yang@amd.com>
Cc: Sunil Khatri <sunil.khatri@amd.com>
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: Philip Yang<Philip.Yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdkfd: fix the clean up when amdgpu_hmm_range_alloc fails
Sunil Khatri [Fri, 24 Oct 2025 16:59:00 +0000 (22:29 +0530)] 
drm/amdkfd: fix the clean up when amdgpu_hmm_range_alloc fails

we need to unreserve the bo's too during clean up along
with freeing the memory of context.

Fixes: 7bb02a34c2ba ("drm/amdkfd: add missing return value check for range")
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu/userq: fix SDMA and compute validation
Alex Deucher [Fri, 10 Oct 2025 19:21:02 +0000 (15:21 -0400)] 
drm/amdgpu/userq: fix SDMA and compute validation

The CSA and EOP buffers have different alignement requirements.
Hardcode them for now as a bug fix.  A proper query will be added in
a subsequent patch.

v2: verify gfx shadow helper callback (Prike)

Fixes: 9e46b8bb0539 ("drm/amdgpu: validate userq buffer virtual address and size")
Reviewed-by: Prike Liang <Prike.Liang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdkfd: Dequeue user queues when process mm released
Philip Yang [Wed, 15 Oct 2025 19:17:54 +0000 (15:17 -0400)] 
drm/amdkfd: Dequeue user queues when process mm released

Move dequeue user queues and destroy user queues from
kfd_process_wq_release to mmu notifier release callback, to ensure no
system memory access from GPU because the process memory is going to
free from CPU after mmu release notifier callback returns.

Destroy queue releases the svm prange queue_refcount, this also removes
fake flase positive warning message "Freeing queue vital buffer" message
if application crash or killed.

Suggested-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdkfd: add missing return value check for range
Sunil Khatri [Fri, 24 Oct 2025 04:44:56 +0000 (10:14 +0530)] 
drm/amdkfd: add missing return value check for range

amdgpu_hmm_range_alloc could fails in case of low
memory condition and hence we should have a check
for the return value.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Shirish S <shirish.s@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Determine DVI-I connector type (v2)
Timur Kristóf [Fri, 26 Sep 2025 18:01:41 +0000 (20:01 +0200)] 
drm/amd/display: Determine DVI-I connector type (v2)

DC determines the DRM connector type based on the
signal type, which becomes problematic when a connector may
support different signal types, such as DVI-I.
With this patch, it is now determined according to the actual
connector type for DVI-D and DVI-I connectors.

Also set the HPD (hotplug detection) flag for DVI-I connectors
to prevent regressing their digital functionality, which has
been already working.

A subsequent commit will also implement polling for DVI-I.

v2:
Only use connector type for DVI to prevent regressions
for other signal types.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Convert amdgpu userqueue management from IDR to XArray
Jesse.Zhang [Tue, 21 Oct 2025 05:01:06 +0000 (13:01 +0800)] 
drm/amdgpu: Convert amdgpu userqueue management from IDR to XArray

This commit refactors the AMDGPU userqueue management subsystem to replace
IDR (ID Allocation) with XArray for improved performance, scalability, and
maintainability. The changes address several issues with the previous IDR
implementation and provide better locking semantics.

Key changes:

1. **Global XArray Introduction**:
   - Added `userq_doorbell_xa` to `struct amdgpu_device` for global queue tracking
   - Uses doorbell_index as key for efficient global lookup
   - Replaces the previous `userq_mgr_list` linked list approach

2. **Per-process XArray Conversion**:
   - Replaced `userq_idr` with `userq_mgr_xa` in `struct amdgpu_userq_mgr`
   - Maintains per-process queue tracking with queue_id as key
   - Uses XA_FLAGS_ALLOC for automatic ID allocation

3. **Locking Improvements**:
   - Removed global `userq_mutex` from `struct amdgpu_device`
   - Replaced with fine-grained XArray locking using XArray's internal spinlocks

4. **Runtime Idle Check Optimization**:
   - Updated `amdgpu_runtime_idle_check_userq()` to use xa_empty

5. **Queue Management Functions**:
   - Converted all IDR operations to equivalent XArray functions:
     - `idr_alloc()` → `xa_alloc()`
     - `idr_find()` → `xa_load()`
     - `idr_remove()` → `xa_erase()`
     - `idr_for_each()` → `xa_for_each()`

Benefits:
- **Performance**: XArray provides better scalability for large numbers of queues
- **Memory Efficiency**: Reduced memory overhead compared to IDR
- **Thread Safety**: Improved locking semantics with XArray's internal spinlocks

v2: rename userq_global_xa/userq_xa to userq_doorbell_xa/userq_mgr_xa
    Remove xa_lock and use its own lock.

v3: Set queue->userq_mgr = uq_mgr in amdgpu_userq_create()
v4: use xa_store_irq (Christian)
    hold the read side of the reset lock while creating/destroying queues and the manager data structure. (Chritian)

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Promote DC to 3.2.356
Taimur Hassan [Sat, 18 Oct 2025 00:22:02 +0000 (19:22 -0500)] 
drm/amd/display: Promote DC to 3.2.356

This version brings along following update:

- Fix incorrect return of vblank enable on unconfigured crtc
- Add HDR workaround for a specific eDP
- Make observers const-correct
- Add lock descriptor to check_update
- Update cursor offload assignments
- Add dc interface to log pre os firmware information
- Init dispclk from bootup clock for DCN315
- Remove dc param from check_update
- Update link encoder assignment
- Add more DC HW state info to underflow logging
- Rename dml2 to dml2_0 folder
- Fix notification of vtotal to DMU for cursor offload
- Fix wrong index for DCN401 cursor offload
- Add opp count validation to dml2.1
- Fix DMUB reset sequence for DCN32
- Bump minimum for frame_warn_limit

Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: [FW Promotion] Release 0.1.33.0
Taimur Hassan [Fri, 17 Oct 2025 21:20:46 +0000 (17:20 -0400)] 
drm/amd/display: [FW Promotion] Release 0.1.33.0

[Why & How]
- Extend reply debug flags, define a new bit as debug_log_enabled
- Replace the padding to frame_skip_number in struct
  dmub_cmd_replay_set_coasting_vtotal_data

Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Fix incorrect return of vblank enable on unconfigured crtc
Ivan Lipski [Wed, 17 Sep 2025 15:00:02 +0000 (11:00 -0400)] 
drm/amd/display: Fix incorrect return of vblank enable on unconfigured crtc

[Why&How]
Return -EINVAL when userspace asks us to enable vblank on a crtc that is
not yet enabled.

Suggested-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1856
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Add HDR workaround for a specific eDP
Alex Hung [Fri, 17 Oct 2025 02:08:10 +0000 (20:08 -0600)] 
drm/amd/display: Add HDR workaround for a specific eDP

[WHY & HOW]
Some eDP panels suffer from flicking when HDR is enabled in KDE or
Gnome.

This add another quirk to worksaround to skip VSC that is incompatible
with an eDP panel.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/4452
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Make observers const-correct
Dominik Kaszewski [Thu, 16 Oct 2025 11:46:25 +0000 (13:46 +0200)] 
drm/amd/display: Make observers const-correct

[Why]
Observers which do not modify their pointer arguments should take
them as const. This clearly signals their intent to the caller,
making it clear that the function is safe to call multiple times,
or remove the call if the result is no longer necessary.

[How]
Made const-correct all of the functions below:
* full_update_required[_weak]
* fast_updates_exist
* fast_update_only
* dc_can_clear_cursor_limit
* dc_stream_get_status (added const named overload)

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Dominik Kaszewski <dominik.kaszewski@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Add lock descriptor to check_update
Dominik Kaszewski [Wed, 30 Jul 2025 13:16:15 +0000 (15:16 +0200)] 
drm/amd/display: Add lock descriptor to check_update

[Why]
DM locks the global DC lock during all updates, even if multiple
updates touch different resources and could be run in parallel.

[How]
Add extra enum specifying which kind of resources should be locked.

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Dominik Kaszewski <dominik.kaszewski@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Update cursor offload assignments
Alvin Lee [Thu, 2 Oct 2025 16:44:19 +0000 (12:44 -0400)] 
drm/amd/display: Update cursor offload assignments

[Why & How]
- Cursor lines per chunk must be assigned from hubp->att and not
  hubp->pos (the one in hubp->pos is unassigned)
- In DCN401 DPP, cur0_enable in attribute struct must be assigned
  as this is the field passed to DMU
- DCN401 should not program position in driver if offload is enabled

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Add dc interface to log pre os firmware information
Meenakshikumar Somasundaram [Wed, 15 Oct 2025 18:45:43 +0000 (14:45 -0400)] 
drm/amd/display: Add dc interface to log pre os firmware information

[Why]
Pre os firmware information is useful to debug pre os to post os fw
transition issues.

[How]
Add dc interface dc_log_preos_dmcub_info() to log pre os firmware
information.

Reviewed-by: Cruise Hung <cruise.hung@amd.com>
Signed-off-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: init dispclk from bootup clock for DCN315
Zhongwei Zhang [Tue, 14 Oct 2025 02:46:49 +0000 (10:46 +0800)] 
drm/amd/display: init dispclk from bootup clock for DCN315

[Why]
Driver does not pick up and save vbios's clocks during init clocks,
the dispclk in clk_mgr will keep 0.
OS might change the timing (lower the pixel clock) after boot.
Then driver will set the dispclk to lower when safe_to_lower is false,
for in clk_mgr dispclk is zero, it's illegal and causes garbage.

[How]
Dump and save the vbios's clocks, and init the dispclk in
dcn315_init_clocks.

Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Signed-off-by: Zhongwei Zhang <Zhongwei.Zhang@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Remove dc param from check_update
Dominik Kaszewski [Thu, 16 Oct 2025 06:44:08 +0000 (08:44 +0200)] 
drm/amd/display: Remove dc param from check_update

[Why]
dc_check_update_surfaces_for_stream should not have access to entire
DC, especially not a mutable one. Concurrent checks should be able
to run independently of one another, without risk of changing state.

[How]
* Replace dc and stream_status structs with new dc_check_config.
* Move required fields from dc_debug and dc_caps to dc_check_config.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Dominik Kaszewski <dominik.kaszewski@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: update link encoder assignment
Meenakshikumar Somasundaram [Thu, 9 Oct 2025 13:13:49 +0000 (09:13 -0400)] 
drm/amd/display: update link encoder assignment

[Why]
Map a link encoder instance matching stream encoder instance
if possible.

[How]
Get the stream encoder instance and assign the same link
encoder instance if available.

Reviewed-by: PeiChen Huang <peichen.huang@amd.com>
Signed-off-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Add more DC HW state info to underflow logging
Karen Chen [Wed, 15 Oct 2025 15:13:07 +0000 (11:13 -0400)] 
drm/amd/display: Add more DC HW state info to underflow logging

[Why]
Debugging underflow issues frequently requires knowing the
HW state at the time of underflow. To enable capturing this
HW state information, interface functions are needed for the
various DC HW blocks.

[How]
This change adds the interface functions to read HW state for
the following DC HW blocks:
- HUBBUB
- HUBP
- DPP
- MPC
- OPP
- DSC
- OPTC
- DCCG

Reviewed-by: George Shen <george.shen@amd.com>
Signed-off-by: Karen Chen <Karen.Chen@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Rename dml2 to dml2_0 folder
Austin Zheng [Tue, 21 Oct 2025 05:52:58 +0000 (13:52 +0800)] 
drm/amd/display: Rename dml2 to dml2_0 folder

[Why]
dml2 folder contains all logic for all versions of DML2
This is currently DML2.0 and DML2.1.
Rename dml2 to dml2_0 folder to reflect this better (dml2_0
for DML2.0).

[How]
Rename dml2 to dml2_0 folder and update dml2 references to
use dml2_0 folder.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Austin Zheng <Austin.Zheng@amd.com>
Signed-off-by: waynelin <Wayne.Lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Fix notification of vtotal to DMU for cursor offload
Nicholas Kazlauskas [Tue, 7 Oct 2025 14:39:07 +0000 (10:39 -0400)] 
drm/amd/display: Fix notification of vtotal to DMU for cursor offload

[Why]
It was placed after the early return and the notification is never sent.

[How]
Place it after .set_drr and before the return.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Fix wrong index for DCN401 cursor offload
Nicholas Kazlauskas [Tue, 7 Oct 2025 14:40:26 +0000 (10:40 -0400)] 
drm/amd/display: Fix wrong index for DCN401 cursor offload

[Why]
Payloads are ignored because the wrong index is written as part of the
pipe update implementation for DCN401.

[How]
Align it to the DCN35 implementation and ensure the + 1 is added.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>