]> git.ipfire.org Git - thirdparty/kernel/stable.git/log
thirdparty/kernel/stable.git
5 weeks agodrm/amd/display: Allow RX6xxx & RX7700 to invoke amdgpu_irq_get/put
Ivan Lipski [Tue, 2 Sep 2025 20:20:09 +0000 (16:20 -0400)] 
drm/amd/display: Allow RX6xxx & RX7700 to invoke amdgpu_irq_get/put

[Why&How]
As reported on https://gitlab.freedesktop.org/drm/amd/-/issues/3936,
SMU hang can occur if the interrupts are not enabled appropriately,
causing a vblank timeout.

This patch reverts commit 5009628d8509 ("drm/amd/display: Remove unnecessary
amdgpu_irq_get/put"), but only for RX6xxx & RX7700 GPUs, on which the
issue was observed.

This will re-enable interrupts regardless of whether the user space needed
it or not.

Fixes: 5009628d8509 ("drm/amd/display: Remove unnecessary amdgpu_irq_get/put")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3936
Suggested-by: Sun peng Li <sunpeng.li@amd.com>
Reviewed-by: Sun peng Li <sunpeng.li@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@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>
5 weeks agodrm/amd/display: Rename header file link.h to link_service.h
Wesley Chalmers [Wed, 3 Sep 2025 01:47:39 +0000 (21:47 -0400)] 
drm/amd/display: Rename header file link.h to link_service.h

[WHY]
Header file name "link.h" collides with system header when dc is
compiled as a user-mode library

[WHAT]
Rename link.h to link_service.h to avoid name collision

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Wesley Chalmers <Wesley.Chalmers@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>
5 weeks agodrm/amd/display: Fix DMCUB loading sequence for DCN3.2
Nicholas Kazlauskas [Fri, 8 Aug 2025 14:26:22 +0000 (10:26 -0400)] 
drm/amd/display: Fix DMCUB loading sequence for DCN3.2

[Why]
New sequence from HW for reset and firmware reloading has been
provided that aims to stabilize the reload sequence in the case the
firmware is hung or has outstanding requests.

[How]
Update the sequence to remove the DMUIF reset and the redundant
writes in the release.

Reviewed-by: Sreeja Golui <sreeja.golui@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@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>
5 weeks agodrm/amd/display: prepare dml 2.1 for new asic
Dmytro Laktyushkin [Wed, 11 Jun 2025 20:51:21 +0000 (16:51 -0400)] 
drm/amd/display: prepare dml 2.1 for new asic

[Why&How]
prepare dml 2.1 for new asic

Acked-by: Wayne Lin <Wayne.Lin@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>
5 weeks agodrm/amd/display: Modify the link training policy
Zhikai Zhai [Tue, 29 Jul 2025 09:39:54 +0000 (17:39 +0800)] 
drm/amd/display: Modify the link training policy

[Why&How]
Currently fallback to low link rate if the link training
fails once on USB4. It may cause the bandwidth couldn't
satisfy the requirement of streams. Modify the policy
to do training retry in the previous few times, only
do fallback at the last time.

Reviewed-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Signed-off-by: Zhikai Zhai <zhikai.zhai@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>
5 weeks agoRevert "drm/amdgpu: Allocate psp fw private buffer in vram"
Hawking Zhang [Thu, 11 Sep 2025 15:22:04 +0000 (23:22 +0800)] 
Revert "drm/amdgpu: Allocate psp fw private buffer in vram"

This reverts commit 22dcb283d63d5677a5875d0002d04d2c61720f78.
Need to certain APU platforms and will proceed to rework
the patch accordingly

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Le Ma <Le.Ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu/gfx11: Add Cleaner Shader Support for GFX11.0.1/11.0.4 GPUs
Srinivasan Shanmugam [Wed, 10 Sep 2025 06:57:05 +0000 (12:27 +0530)] 
drm/amdgpu/gfx11: Add Cleaner Shader Support for GFX11.0.1/11.0.4 GPUs

Enable the cleaner shader for additional GFX11.0.1/11.0.4 series GPUs to
ensure data isolation among GPU tasks. The cleaner shader is tasked with
clearing the Local Data Store (LDS), Vector General Purpose Registers
(VGPRs), and Scalar General Purpose Registers (SGPRs), which helps avoid
data leakage and guarantees the accuracy of computational results.

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

Cc: Wasee Alam <wasee.alam@amd.com>
Cc: Mario Sopena-Novales <mario.novales@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>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd: Duplicate DC_FEATURE_MASK and DC_DEBUG_MASK enum values into kdoc
Mario Limonciello [Wed, 10 Sep 2025 18:40:30 +0000 (13:40 -0500)] 
drm/amd: Duplicate DC_FEATURE_MASK and DC_DEBUG_MASK enum values into kdoc

[Why]
When kernel documentation is generated the enum values themselves don't
end up in the documentation.  This makes browsing them in HTML a lot
less useful.

[How]
Copy DC_DEBUG_MASK and DC_FEATURE_MASK enum values into matching kdoc
comments.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/pm: unified smu feature cap interface
Yang Wang [Thu, 4 Sep 2025 00:52:53 +0000 (08:52 +0800)] 
drm/amd/pm: unified smu feature cap interface

add a unified interface to provide smu feature cap set.

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>
5 weeks agodrm/amd/pm: Allow to set power cap in vf mode
Asad Kamal [Mon, 25 Aug 2025 16:33:53 +0000 (00:33 +0800)] 
drm/amd/pm: Allow to set power cap in vf mode

Allow setting power cap for smu_v13_0_6 in 1vf mode

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Add virtual device capabilities
Lijo Lazar [Thu, 4 Sep 2025 12:17:20 +0000 (17:47 +0530)] 
drm/amdgpu: Add virtual device capabilities

Add a member to define the capabilities of virtual device.

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>
5 weeks agodrm/amdgpu: Add generic capability class
Lijo Lazar [Thu, 4 Sep 2025 12:13:44 +0000 (17:43 +0530)] 
drm/amdgpu: Add generic capability class

Define a utility macro for defining capabilities and their attributes.
Capability attributes are read-only, write-only, read-write.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Acked-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Read memory vendor information
Lijo Lazar [Wed, 10 Sep 2025 06:08:08 +0000 (11:38 +0530)] 
drm/amdgpu: Read memory vendor information

Read VRAM vendor information from scratch register for GC v9.4.3 and
GC v9.5.0 SOCs.

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>
5 weeks agodrm/amdgpu: wait pmfw polling mca bank info done
Stanley.Yang [Thu, 21 Aug 2025 08:05:42 +0000 (16:05 +0800)] 
drm/amdgpu: wait pmfw polling mca bank info done

wait 500ms to ensure pmfw polling mca bank info done.

Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Use memset32 for ring clearing
Tvrtko Ursulin [Tue, 9 Sep 2025 14:49:37 +0000 (16:49 +0200)] 
drm/amdgpu: Use memset32 for ring clearing

Use memset32 instead of open coding it, just because it is
a tiny bit nicer.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Fix allocating extra dwords for rings (v2)
Timur Kristóf [Tue, 9 Sep 2025 14:49:35 +0000 (16:49 +0200)] 
drm/amdgpu: Fix allocating extra dwords for rings (v2)

Rename extra_dw to extra_bytes and document what it's for.

The value is already used as if it were bytes in vcn_v4_0.c
and in amdgpu_ring_init. Just adjust the dword count in
jpeg_v1_0.c so that it becomes a byte count.

v2:
Rename extra_dw to extra_bytes as discussed during review.

Fixes: c8c1a1d2ef04 ("drm/amdgpu: define and add extra dword for jpeg ring")
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/pm: Remove unneeded legacy DPM related code.
Timur Kristóf [Tue, 9 Sep 2025 14:17:52 +0000 (16:17 +0200)] 
drm/amd/pm: Remove unneeded legacy DPM related code.

This code isn't needed anymore as we collect the same information
into pm_display_cfg instead.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/pm: Use pm_display_cfg in legacy DPM (v2)
Timur Kristóf [Tue, 9 Sep 2025 14:17:51 +0000 (16:17 +0200)] 
drm/amd/pm: Use pm_display_cfg in legacy DPM (v2)

This commit is necessary for DC to function well with chips
that use the legacy power management code, ie. SI and KV.
Communicate display information from DC to the legacy PM code.

Currently DC uses pm_display_cfg to communicate power management
requirements from the display code to the DPM code.
However, the legacy (non-DC) code path used different fields
and therefore could not take into account anything from DC.

Change the legacy display code to fill the same pm_display_cfg
struct as DC and use the same in the legacy DPM code.

To ease review and reduce churn, this commit does not yet
delete the now unneeded code, that is done in the next commit.

v2:
Rebase.
Fix single_display in amdgpu_dpm_pick_power_state.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/display: Add pixel_clock to amd_pp_display_configuration
Timur Kristóf [Tue, 9 Sep 2025 14:17:50 +0000 (16:17 +0200)] 
drm/amd/display: Add pixel_clock to amd_pp_display_configuration

This commit adds the pixel_clock field to the display config
struct so that power management (DPM) can use it.

We currently don't have a proper bandwidth calculation on old
GPUs with DCE 6-10 because dce_calcs only supports DCE 11+.
So the power management (DPM) on these GPUs may need to make
ad-hoc decisions for display based on the pixel clock.

Also rename sym_clock to pixel_clock in dm_pp_single_disp_config
to avoid confusion with other code where the sym_clock refers to
the DisplayPort symbol clock.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agoDocumentation/amdgpu: Add Ryzen AI 330 series processor
Mario Limonciello [Wed, 10 Sep 2025 04:22:54 +0000 (23:22 -0500)] 
Documentation/amdgpu: Add Ryzen AI 330 series processor

This has been announced so add to the table.

Link: https://www.amd.com/en/products/processors/laptop/ryzen/ai-300-series/amd-ryzen-ai-5-330.html
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>
5 weeks agodrm/amdgpu: Release hive reference properly
Lijo Lazar [Tue, 2 Sep 2025 06:07:37 +0000 (11:37 +0530)] 
drm/amdgpu: Release hive reference properly

xgmi hive reference is taken on function entry, but not released
correctly for all paths. Use __free() to release reference properly.

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>
5 weeks agodrm/amdgpu/ttm: Allocate/Free 4K MMIO_REMAP Singleton
Srinivasan Shanmugam [Thu, 28 Aug 2025 13:48:49 +0000 (19:18 +0530)] 
drm/amdgpu/ttm: Allocate/Free 4K MMIO_REMAP Singleton

Add mmio_remap bookkeeping to amdgpu_device and introduce
amdgpu_ttm_mmio_remap_bo_init()/fini() to manage a kernel-owned,
one-page (4K) BO in AMDGPU_GEM_DOMAIN_MMIO_REMAP.

Bookkeeping:
  - adev->rmmio_remap.bo : kernel-owned singleton BO

The BO is allocated during TTM init when a remap bus address is available
(adev->rmmio_remap.bus_addr) and PAGE_SIZE <= AMDGPU_GPU_PAGE_SIZE (4K),
and freed during TTM fini.

v2:
 - Check mmio_remap bus address (adev->rmmio_remap.bus_addr) instead of
   rmmio_base. (Alex)
 - Skip quietly if PAGE_SIZE > AMDGPU_GPU_PAGE_SIZE or no bus address
   (no warn). (Alex)
 - Use `amdgpu_bo_create()` (not *_kernel) - Only with this The object
   is stored in adev->mmio_remap.bo and will later be exposed to
   userspace via a GEM handle. (Christian)

v3:
 - Remove obvious comment before amdgpu_ttm_mmio_remap_bo_fini() call.
   (Alex)

v4:
 - Squash bookkeeping into this patch (Christian)

Suggested-by: Christian König <christian.koenig@amd.com>
Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: validate userq buffer virtual address and size
Prike Liang [Mon, 23 Jun 2025 08:29:38 +0000 (16:29 +0800)] 
drm/amdgpu: validate userq buffer virtual address and size

It needs to validate the userq object virtual address to
determine whether it is residented in a valid vm mapping.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amd/pm: make smu_set_temp_funcs() smu specific for smu v13.0.6
Yang Wang [Tue, 9 Sep 2025 02:10:40 +0000 (10:10 +0800)] 
drm/amd/pm: make smu_set_temp_funcs() smu specific for smu v13.0.6

move smu_set_temp_funcs() into smu_v13.0.6 ppt.c file to keep same code
layer in amdgpu_smu.c. (only set_ppt func in amdgpu_smu.c)

Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-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/amdgpu/ttm: Initialize AMDGPU_PL_MMIO_REMAP Heap
Srinivasan Shanmugam [Wed, 20 Aug 2025 11:09:38 +0000 (16:39 +0530)] 
drm/amdgpu/ttm: Initialize AMDGPU_PL_MMIO_REMAP Heap

Add a one-page TTM range manager for AMDGPU_PL_MMIO_REMAP via
amdgpu_ttm_init_on_chip(). This only registers the placement with TTM;
no BO is allocated in this patch.

The singleton 4K remap BO is created and freed in the following patch.

This split follows to separate heap bring-up from BO allocation.

Cc: Christian König <christian.koenig@amd.com>
Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@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>
5 weeks agodrm/amdgpu: Implement TTM handling for MMIO_REMAP placement
Srinivasan Shanmugam [Wed, 20 Aug 2025 10:51:16 +0000 (16:21 +0530)] 
drm/amdgpu: Implement TTM handling for MMIO_REMAP placement

Implement TTM-level behavior for AMDGPU_PL_MMIO_REMAP so it behaves as a
CPU-visible IO page:

* amdgpu_evict_flags(): mark as unmovable
* amdgpu_res_cpu_visible(): consider CPU-visible
* amdgpu_bo_move(): use null move when src/dst is MMIO_REMAP
* amdgpu_ttm_io_mem_reserve(): program base/is_iomem/caching using
  the device's mmio_remap_* metadata
* amdgpu_ttm_io_mem_pfn(): return PFN for the remapped HDP page
* amdgpu_ttm_tt_pde_flags(): set AMDGPU_PTE_SYSTEM for this mem type

v2:
- Drop HDP-specific comment; keep generic remap (Alex).

v3:
- Fix indentation in amdgpu_res_cpu_visible (Christian).
- Use adev->rmmio_remap.bus_addr for MMIO_REMAP bus/PFN calculations
  (Alex).

v4:
- Drop unnecessary (resource_size_t) casts in MMIO_REMAP io-mem paths
  (Alex)

Cc: Christian König <christian.koenig@amd.com>
Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@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>
5 weeks agodrm/amdgpu: Replace kzalloc + copy_from_user with memdup_user
Thorsten Blum [Mon, 8 Sep 2025 21:15:54 +0000 (23:15 +0200)] 
drm/amdgpu: Replace kzalloc + copy_from_user with memdup_user

Replace kzalloc() followed by copy_from_user() with memdup_user() to
improve and simplify ta_if_load_debugfs_write() and
ta_if_invoke_debugfs_write().

No functional changes intended.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdkfd: Replace kzalloc + copy_from_user with memdup_user
Thorsten Blum [Mon, 8 Sep 2025 21:31:56 +0000 (23:31 +0200)] 
drm/amdkfd: Replace kzalloc + copy_from_user with memdup_user

Replace kzalloc() followed by copy_from_user() with memdup_user() to
improve and simplify kfd_ioctl_set_cu_mask().

Return early if an error occurs and remove the obsolete 'out' label.

No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Use (v)memdup_array_user in amdgpu_cs_pass1
Tvrtko Ursulin [Thu, 12 Jun 2025 10:44:28 +0000 (11:44 +0100)] 
drm/amdgpu: Use (v)memdup_array_user in amdgpu_cs_pass1

Replace k(v)malloc_array() + copy_from_user() with (v)memdup_array_user().

This shrinks the source code and improves separation between the kernel
and userspace slabs.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Use memdup_array_user in amdgpu_cs_wait_fences_ioctl
Tvrtko Ursulin [Thu, 12 Jun 2025 10:44:27 +0000 (11:44 +0100)] 
drm/amdgpu: Use memdup_array_user in amdgpu_cs_wait_fences_ioctl

Replace kmalloc_array() + copy_from_user() with memdup_array_user().

This shrinks the source code and improves separation between the kernel
and userspace slabs.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Use vmemdup_array_user in amdgpu_bo_create_list_entry_array
Tvrtko Ursulin [Thu, 12 Jun 2025 10:44:26 +0000 (11:44 +0100)] 
drm/amdgpu: Use vmemdup_array_user in amdgpu_bo_create_list_entry_array

Replace kvmalloc_array() + copy_from_user() with vmemdup_array_user() on
the fast path.

This shrinks the source code and improves separation between the kernel
and userspace slabs.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Remove volatile references from VCN
Rodrigo Siqueira [Mon, 8 Sep 2025 23:15:40 +0000 (17:15 -0600)] 
drm/amdgpu: Remove volatile references from VCN

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Remove volatile from amdgpu and amdgpu_ih headers
Rodrigo Siqueira [Mon, 8 Sep 2025 23:15:39 +0000 (17:15 -0600)] 
drm/amdgpu: Remove volatile from amdgpu and amdgpu_ih headers

Remove the unnecessary use of volatile in some of the amdgpu.h and
amdgpu_ih.h headers.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Remove volatile from ring manipulation
Rodrigo Siqueira [Mon, 8 Sep 2025 23:15:38 +0000 (17:15 -0600)] 
drm/amdgpu: Remove volatile from ring manipulation

None of the pointer operations handled by the ring file requires
volatile, for this reason, this commit removes all occurrences of
volatile associated with rings.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Remove volatile from RLC files
Rodrigo Siqueira [Mon, 8 Sep 2025 23:15:37 +0000 (17:15 -0600)] 
drm/amdgpu: Remove volatile from RLC files

The RLC uses volatile with some pointers that are not directly related
to any of the situations where volatile is advised to be used [1]. For
this reason, this commit removes all the volatile occurrences associated
with RLC.

1. https://docs.kernel.org/process/volatile-considered-harmful.html

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 weeks agodrm/amdgpu: Remove volatile from CSB functions
Rodrigo Siqueira [Mon, 8 Sep 2025 23:15:36 +0000 (17:15 -0600)] 
drm/amdgpu: Remove volatile from CSB functions

The CSB buffer manipulation occurs in memory where the BO is mapped
during initialization, and some references to this buffer are handled
with volatile, which is incorrect in this scenario. There are a few
cases where the use of volatile is accepted, but none of them align with
CSB operations. Therefore, this commit removes all the volatile
variables associated with the CSB code.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amdgpu/vcn: Change amdgpu_vcn_sw_fini return to void
Rodrigo Siqueira [Mon, 25 Aug 2025 00:46:41 +0000 (18:46 -0600)] 
drm/amdgpu/vcn: Change amdgpu_vcn_sw_fini return to void

The function amdgpu_vcn_sw_fini() returns an integer, but this number is
always 0. This commit changes the amdgpu_vcn_sw_fini() return to void,
and eliminates all checks to this return across different VCNs.

Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amdgpu/vcn: Document IRQ per-instance irq behavior for VCN 4.0.3
Rodrigo Siqueira [Mon, 25 Aug 2025 00:46:40 +0000 (18:46 -0600)] 
drm/amdgpu/vcn: Document IRQ per-instance irq behavior for VCN 4.0.3

When examining the VCN function init, it is common to find a loop that
initializes VCN rings, which uses one IRQ per instance. However, VCN
4.0.3 deviates from this pattern, as it includes a distinct field to
differentiate instances, which results in a slightly different ring
init. This commit makes this difference explicit by using a fixed index
when initializing the ring buffer and also adds a comment.

Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amdgpu: validate userq hw unmap status for destroying userq
Prike Liang [Fri, 16 May 2025 08:20:54 +0000 (16:20 +0800)] 
drm/amdgpu: validate userq hw unmap status for destroying userq

Before destroying the userq buffer object, it requires validating
the userq HW unmap status and ensuring the userq is unmapped from
hardware. If the user HW unmap failed, then it needs to reset the
queue for reusing.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amdgpu: Wire up MMIO_REMAP placement and User-visible strings
Srinivasan Shanmugam [Wed, 20 Aug 2025 10:47:52 +0000 (16:17 +0530)] 
drm/amdgpu: Wire up MMIO_REMAP placement and User-visible strings

Wire up the conversions and strings for the new MMIO_REMAP placement:

* amdgpu_mem_type_to_domain() maps AMDGPU_PL_MMIO_REMAP -> domain
* amdgpu_bo_placement_from_domain() accepts the new domain
* amdgpu_bo_mem_stats_placement() and amdgpu_bo_print_info() report it
* res cursor supports the new placement
* fdinfo prints "mmioremap" for the new placement

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: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amdgpu/ttm: Add New AMDGPU_PL_MMIO_REMAP Placement
Srinivasan Shanmugam [Wed, 20 Aug 2025 07:18:50 +0000 (12:48 +0530)] 
drm/amdgpu/ttm: Add New AMDGPU_PL_MMIO_REMAP Placement

Introduce a kernel-internal TTM placement type AMDGPU_PL_MMIO_REMAP
for the HDP flush MMIO remap page

Plumbing added:
- amdgpu_res_cursor.{first,next}: treat MMIO_REMAP like DOORBELL
- amdgpu_ttm_io_mem_reserve(): return BAR bus address + offset
  for MMIO_REMAP, mark as uncached I/O
- amdgpu_ttm_io_mem_pfn(): PFN from register BAR
- amdgpu_res_cpu_visible(): visible to CPU
- amdgpu_evict_flags()/amdgpu_bo_move(): non-migratable
- amdgpu_ttm_tt_pde_flags(): map as SYSTEM
- amdgpu_bo_mem_stats_placement(): report AMDGPU_PL_MMIO_REMAP
- amdgpu_fdinfo: print “mmioremap” bucket label

Cc: Alex Deucher <alexander.deucher@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@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>
6 weeks agodrm/amdgpu/vcn: Allow limiting ctx to instance 0 for AV1 at any time
David Rosca [Mon, 18 Aug 2025 07:18:37 +0000 (09:18 +0200)] 
drm/amdgpu/vcn: Allow limiting ctx to instance 0 for AV1 at any time

There is no reason to require this to happen on first submitted IB only.
We need to wait for the queue to be idle, but it can be done at any
time (including when there are multiple video sessions active).

Signed-off-by: David Rosca <david.rosca@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amdgpu/vcn4: Fix IB parsing with multiple engine info packages
David Rosca [Mon, 18 Aug 2025 07:06:58 +0000 (09:06 +0200)] 
drm/amdgpu/vcn4: Fix IB parsing with multiple engine info packages

There can be multiple engine info packages in one IB and the first one
may be common engine, not decode/encode.
We need to parse the entire IB instead of stopping after finding first
engine info.

Signed-off-by: David Rosca <david.rosca@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amdgpu: clean up the amdgpu_userq_active()
Prike Liang [Tue, 17 Jun 2025 07:37:31 +0000 (15:37 +0800)] 
drm/amdgpu: clean up the amdgpu_userq_active()

This is no invocation for amdgpu_userq_active().

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amdgpu/jpeg: Move parse_cs to amdgpu_jpeg.c
Sathishkumar S [Tue, 19 Aug 2025 10:41:01 +0000 (16:11 +0530)] 
drm/amdgpu/jpeg: Move parse_cs to amdgpu_jpeg.c

Rename jpeg_v2_dec_ring_parse_cs to amdgpu_jpeg_dec_parse_cs
and move it to amdgpu_jpeg.c as it is shared among jpeg versions.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amd/display: Remove duplicated code
Ray Wu [Mon, 8 Sep 2025 09:21:27 +0000 (17:21 +0800)] 
drm/amd/display: Remove duplicated code

[Why&How]
Remove duplicated code

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amdgpu: validate userq input args
Prike Liang [Wed, 14 May 2025 04:43:57 +0000 (12:43 +0800)] 
drm/amdgpu: validate userq input args

This will help on validating the userq input args, and
rejecting for the invalid userq request at the IOCTLs
first place.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amdgpu/uapi: Introduce AMDGPU_GEM_DOMAIN_MMIO_REMAP
Srinivasan Shanmugam [Wed, 20 Aug 2025 07:03:29 +0000 (12:33 +0530)] 
drm/amdgpu/uapi: Introduce AMDGPU_GEM_DOMAIN_MMIO_REMAP

Add a new GEM domain bit AMDGPU_GEM_DOMAIN_MMIO_REMAP to allow
userspace to request the MMIO remap (HDP flush) page via GEM_CREATE.

- include/uapi/drm/amdgpu_drm.h:
  * define AMDGPU_GEM_DOMAIN_MMIO_REMAP
  * include the bit in AMDGPU_GEM_DOMAIN_MASK

v2: Add early reject in amdgpu_gem_create_ioctl() (Alex).

Cc: Christian König <christian.koenig@amd.com>
Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/ttm: Bump TTM_NUM_MEM_TYPES to 9 (Prep for AMDGPU_PL_MMIO_REMAP)
Srinivasan Shanmugam [Tue, 26 Aug 2025 10:19:20 +0000 (15:49 +0530)] 
drm/ttm: Bump TTM_NUM_MEM_TYPES to 9 (Prep for AMDGPU_PL_MMIO_REMAP)

Increase TTM_NUM_MEM_TYPES from 8 to 9 to accommodate the upcoming
AMDGPU_PL_MMIO_REMAP placement.

Cc: Alex Deucher <alexander.deucher@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amd/amdgpu: Declare isp firmware binary file
Pratap Nirujogi [Wed, 3 Sep 2025 20:00:24 +0000 (16:00 -0400)] 
drm/amd/amdgpu: Declare isp firmware binary file

Declare isp firmware file isp_4_1_1.bin required by isp4.1.1 device.

Suggested-by: Alexey Zagorodnikov <xglooom@gmail.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amd/display: use udelay rather than fsleep
Alex Deucher [Wed, 3 Sep 2025 13:11:12 +0000 (09:11 -0400)] 
drm/amd/display: use udelay rather than fsleep

This function can be called from an atomic context so we can't use
fsleep().

Fixes: 01f60348d8fb ("drm/amd/display: Fix 'failed to blank crtc!'")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4549
Cc: Wen Chen <Wen.Chen3@amd.com>
Cc: Fangzhi Zuo <jerry.zuo@amd.com>
Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amdgpu: Fix NULL ptr deref in amdgpu_device_cache_switch_state()
John Olender [Fri, 5 Sep 2025 10:11:28 +0000 (06:11 -0400)] 
drm/amdgpu: Fix NULL ptr deref in amdgpu_device_cache_switch_state()

Kaveri has no upstream bridge, therefore parent is NULL.

$ lspci -PP
...
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Kaveri [Radeon R7 Graphics] (rev d4)

For comparison, Raphael:

$ lspci -PP
...
00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Raphael/Granite Ridge Internal GPP Bridge to Bus [C:A]
...
00:08.1/0e:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Raphael (rev c5)

Fixes: 1dd2fa0e00f1 ("drm/amdgpu: Save and restore switch state")
Link: https://lore.kernel.org/amd-gfx/38fe6513-f8a9-4669-8e86-89c54c465611@gmail.com/
Reviewed-by: Candice Li <candice.li@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: John Olender <john.olender@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 weeks agodrm/amdgpu: fix a memory leak in fence cleanup when unloading
Alex Deucher [Thu, 4 Sep 2025 16:35:05 +0000 (12:35 -0400)] 
drm/amdgpu: fix a memory leak in fence cleanup when unloading

Commit b61badd20b44 ("drm/amdgpu: fix usage slab after free")
reordered when amdgpu_fence_driver_sw_fini() was called after
that patch, amdgpu_fence_driver_sw_fini() effectively became
a no-op as the sched entities we never freed because the
ring pointers were already set to NULL.  Remove the NULL
setting.

Reported-by: Lin.Cao <lincao12@amd.com>
Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Fixes: b61badd20b44 ("drm/amdgpu: fix usage slab after free")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amd/display: Drop dm_prepare_suspend() and dm_complete()
Mario Limonciello (AMD) [Fri, 5 Sep 2025 15:36:27 +0000 (10:36 -0500)] 
drm/amd/display: Drop dm_prepare_suspend() and dm_complete()

[Why]
dm_prepare_suspend() was added in commit 50e0bae34fa6b
("drm/amd/display: Add and use new dm_prepare_suspend() callback")
to allow display to turn off earlier in the suspend sequence.

This caused a regression that HDMI audio sometimes didn't work
properly after resume unless audio was playing during suspend.

[How]
Drop dm_prepare_suspend() callback. All code in it will still run
during dm_suspend(). Also drop unnecessary dm_complete() callback.
dm_complete() was used for failed prepare and also for any case
of successful resume.  The code in it already runs in dm_resume().

This change will introduce more time that the display is turned on
during suspend sequence. The compositor can turn it off sooner if
desired.

Cc: Harry Wentland <harry.wentland@amd.com>
Reported-by: Przemysław Kopa <prz.kopa@gmail.com>
Closes: https://lore.kernel.org/amd-gfx/1cea0d56-7739-4ad9-bf8e-c9330faea2bb@kernel.org/T/#m383d9c08397043a271b36c32b64bb80e524e4b0f
Reported-by: Kalvin <hikaph+oss@gmail.com>
Closes: https://github.com/alsa-project/alsa-lib/issues/465
Closes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4809
Fixes: 50e0bae34fa6b ("drm/amd/display: Add and use new dm_prepare_suspend() callback")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amdgpu: Fix error codes if copy_to_user() fails
Dan Carpenter [Thu, 4 Sep 2025 18:58:49 +0000 (21:58 +0300)] 
drm/amdgpu: Fix error codes if copy_to_user() fails

The copy_to_user() function returns the number of bytes that it wasn't
able to copy, but we should return -EFAULT to the user.

Fixes: 4d82724f7f2b ("drm/amdgpu: Add mapping info option for GEM_OP ioctl")
Fixes: f9db1fc52ceb ("drm/amdgpu: Add ioctl to get all gem handles for a process")
Reviewed-By: David Francis <David.Francis@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/radeon: use dev_warn_once() in CS parsers
Alex Deucher [Tue, 2 Sep 2025 16:45:34 +0000 (12:45 -0400)] 
drm/radeon: use dev_warn_once() in CS parsers

Older GPUs did not support memory protection, so the kernel
driver would validate the command submissions (CS) from userspace
to avoid the GPU accessing any memory it shouldn't.

Change any error messages in that validation to dev_warn_once() to
avoid spamming the kernel log in the event of a bad CS.  If users
see any of these messages they should report them to the user space
component, which in most cases is mesa
(https://gitlab.freedesktop.org/mesa/mesa/-/issues).

Cc: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20250829171655.GBaLHgh3VOvuM1UfJg@fat_crate.local
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amdgpu: Correct misnamed function in amdgpu_gem.c
Srinivasan Shanmugam [Sun, 31 Aug 2025 09:46:04 +0000 (15:16 +0530)] 
drm/amdgpu: Correct misnamed function in amdgpu_gem.c

The header comment above amdgpu_gem_list_handles_ioctl referenced
drm_amdgpu_gem_list_handles_ioctl. Update the comment to reflect the
actual function identifier to avoid misleading prototype warnings.

Fixes the below:
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:1106: warning: expecting prototype for drm_amdgpu_gem_list_handles_ioctl(). Prototype was for amdgpu_gem_list_handles_ioctl() instead

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amdgpu: print root PD address in PDE format instead of GPU
Sunil Khatri [Mon, 18 Aug 2025 07:21:25 +0000 (12:51 +0530)] 
drm/amdgpu: print root PD address in PDE format instead of GPU

Print PD address of VM root instead of GPU address in the debugfs.
On modern GPU's this is what UMR tool expects in the registers
as well.

Fixes: 719b378d3718 ("drm/amdgpu: add debugfs support for VM pagetable per client")
Signed-off-by: Sunil Khatri <sunil.khatri@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>
7 weeks agodrm/amd/display: Promote DC to 3.2.349
Taimur Hassan [Fri, 29 Aug 2025 14:45:27 +0000 (09:45 -0500)] 
drm/amd/display: Promote DC to 3.2.349

This version brings along following updates:

- Disable stutter when programming watermarks on dcn32
- Fix pbn_div Calculation Error
- Correct sequences and delays for DCN35 PG & RCG
- Define interfaces for hubbub perfmance monitoring support
- Extend to read eDP general capability 2
- Indicate when custom brightness curves are in use
- Dont wait for pipe update during medupdate/highirq
- Add HDCP retry_limit control parameter

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>
7 weeks agodrm/amd/display: Fix pbn_div Calculation Error
Fangzhi Zuo [Tue, 8 Apr 2025 19:11:43 +0000 (15:11 -0400)] 
drm/amd/display: Fix pbn_div Calculation Error

[Why]
dm_mst_get_pbn_divider() returns value integer coming from
the cast from fixed point, but the casted integer will then be used
in dfixed_const to be multiplied by 4096. The cast from fixed point to integer
causes the calculation error becomes bigger when multiplied by 4096.

That makes the calculated pbn_div value becomes smaller than
it should be, which leads to the req_slot number becomes bigger.

Such error is getting reflected in 8k30 timing,
where the correct and incorrect calculated req_slot 62.9 Vs 63.1.
That makes the wrong calculation failed to light up 8k30
after a dock under HBR3 x 4.

[How]
Restore the accuracy by keeping the fraction part
calculated for the left shift operation.

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Fangzhi Zuo <Jerry.Zuo@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>
7 weeks agodrm/amd/display: Correct sequences and delays for DCN35 PG & RCG
Ovidiu Bunea [Mon, 25 Aug 2025 18:45:33 +0000 (14:45 -0400)] 
drm/amd/display: Correct sequences and delays for DCN35 PG & RCG

[why]
The current PG & RCG programming in driver has some gaps and incorrect
sequences.

[how]
Added delays after ungating clocks to allow ramp up, increased polling
to allow more time for power up, and removed the incorrect sequences.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Signed-off-by: Ovidiu Bunea <ovidiu.bunea@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>
7 weeks agodrm/amd/display: Refine error message for vblank init failure
Roman Li [Thu, 21 Aug 2025 19:43:31 +0000 (15:43 -0400)] 
drm/amd/display: Refine error message for vblank init failure

[Why]
The error message "failed to initialize sw for display support" is used
for both DRM device and vblank initialization failures, making it difficult
to identify the specific failure during troubleshooting.

[How]
Update the vblank initialization error message to
"failed to initialize vblank for display support"
to distinguish it from the DRM device init failure.

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Roman Li <Roman.Li@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>
7 weeks agodrm/amd/display: Update dchubbub.h for hubbub perfmon support
Wenjing Liu [Wed, 13 Aug 2025 20:18:53 +0000 (16:18 -0400)] 
drm/amd/display: Update dchubbub.h for hubbub perfmon support

[why]
dchubbub supports performance monitoring for hubbub.
The interfaces define the performance monitoring events and their
attributes.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@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>
7 weeks agodrm/amd/display: Read DPCD to obtain eDP capability information.
Allen Li [Mon, 25 Aug 2025 06:23:14 +0000 (14:23 +0800)] 
drm/amd/display: Read DPCD to obtain eDP capability information.

[Why & How]
Extend to read eDP general capability 2 in detect_edp_sink_caps().

Reviewed-by: Robin Chen <robin.chen@amd.com>
Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Allen Li <wei-guang.li@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>
7 weeks agodrm/amd/display: Indicate when custom brightness curves are in use
Mario Limonciello [Sun, 24 Aug 2025 20:20:58 +0000 (15:20 -0500)] 
drm/amd/display: Indicate when custom brightness curves are in use

[Why]
There is a `scale` sysfs attribute that can be used to indicate when
non-linear brightness scaling is in use.  As Custom brightness curves
work by linear interpolation of points the scale is no longer linear.

[How]
Indicate non-linear scaling when custom brightness curves in use and
linear scaling otherwise.

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Mario Limonciello <superm1@kernel.org>
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>
7 weeks agodrm/amd/display: dont wait for pipe update during medupdate/highirq
Ausef Yousof [Thu, 21 Aug 2025 22:11:54 +0000 (18:11 -0400)] 
drm/amd/display: dont wait for pipe update during medupdate/highirq

[why&how]
control flag for the wait during pipe update wait for vupdate should
be set if update type is not fast or med to prevent an invalid sleep
operation

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Ausef Yousof <Ausef.Yousof@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>
7 weeks agodrm/amd/display: Add link index in AUX and dpms
Cruise Hung [Fri, 22 Aug 2025 07:45:03 +0000 (15:45 +0800)] 
drm/amd/display: Add link index in AUX and dpms

[Why & How]
Add the link index in DP AUX transfer and DPMS functions.

Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Cruise Hung <Cruise.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>
7 weeks agodrm/amd/display: Add HDCP policy control
Oleh Kuzhylnyi [Mon, 18 Aug 2025 11:19:29 +0000 (13:19 +0200)] 
drm/amd/display: Add HDCP policy control

[Why]
DM should be able to control HDCP retry limit via configurable
parameter.

[How]
Expose a retry_limit parameter for controlling the maximum number of
retries and lift the hardcode out to DM.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Oleh Kuzhylnyi <okuzhyln@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>
7 weeks agodrm/amdgpu: Add vbios build number interface
Lijo Lazar [Thu, 28 Aug 2025 07:20:09 +0000 (12:50 +0530)] 
drm/amdgpu: Add vbios build number interface

Fetch VBIOS build number from atom rom image. Add a sysfs interface to
read the build number.

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>
7 weeks agodrm/amd/display: Disable DPCD Probe Quirk
Fangzhi Zuo [Thu, 4 Sep 2025 19:13:51 +0000 (15:13 -0400)] 
drm/amd/display: Disable DPCD Probe Quirk

Disable dpcd probe quirk to native aux.

Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4500
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20250904191351.746707-1-Jerry.Zuo@amd.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amd/pm: Add caching for SystemMetrics table
Lijo Lazar [Thu, 28 Aug 2025 04:32:35 +0000 (10:02 +0530)] 
drm/amd/pm: Add caching for SystemMetrics table

Implement caching separately for SystemMetrics table from PMFW. The same
table could be used for multiple interfaces. Hence, cache it internally
to avoid multiple queries to the firmware. For SystemMetrics table, 5ms
cache interval is sufficient.

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>
7 weeks agodrm/amd/pm: refine amdgpu pm sysfs node error code
Yang Wang [Wed, 3 Sep 2025 06:29:12 +0000 (14:29 +0800)] 
drm/amd/pm: refine amdgpu pm sysfs node error code

v1:
Returns different error codes based on the scenario to help the user app understand
the AMDGPU device status when an exception occurs.

v2:
change -NODEV to -EBUSY.

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>
7 weeks agodrm/amd/pm: use int type to store negative error codes
Qianfeng Rong [Thu, 4 Sep 2025 14:58:00 +0000 (22:58 +0800)] 
drm/amd/pm: use int type to store negative error codes

Use int instead of uint32_t for 'ret' variable to store negative error
codes or zero returned by other functions.

Storing the negative error codes in unsigned type, doesn't cause an issue
at runtime but can be confusing. Additionally, assigning negative error
codes to unsigned type may trigger a GCC warning when the -Wsign-conversion
flag is enabled.

No effect on runtime.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/radeon/pm: Remove redundant ternary operators
Liao Yuanhong [Thu, 4 Sep 2025 11:32:00 +0000 (19:32 +0800)] 
drm/radeon/pm: Remove redundant ternary operators

For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/radeon/radeon_legacy_encoders: Remove redundant ternary operators
Liao Yuanhong [Thu, 4 Sep 2025 11:31:59 +0000 (19:31 +0800)] 
drm/radeon/radeon_legacy_encoders: Remove redundant ternary operators

For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/radeon/dpm: Remove redundant ternary operators
Liao Yuanhong [Thu, 4 Sep 2025 11:31:58 +0000 (19:31 +0800)] 
drm/radeon/dpm: Remove redundant ternary operators

For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/radeon/atom: Remove redundant ternary operators
Liao Yuanhong [Thu, 4 Sep 2025 11:31:57 +0000 (19:31 +0800)] 
drm/radeon/atom: Remove redundant ternary operators

For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amd/pm/powerplay/smumgr: remove redundant ternary operators
Liao Yuanhong [Thu, 4 Sep 2025 08:21:13 +0000 (16:21 +0800)] 
drm/amd/pm/powerplay/smumgr: remove redundant ternary operators

For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code. Swap variable positions
on either side of '==' to enhance readability.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amd/pm/powerplay/hwmgr/ppatomctrl: Remove redundant ternary operators
Liao Yuanhong [Thu, 4 Sep 2025 08:21:12 +0000 (16:21 +0800)] 
drm/amd/pm/powerplay/hwmgr/ppatomctrl: Remove redundant ternary operators

For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code. Swap variable positions
on either side of '!=' to enhance readability.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agoamdgpu/pm/legacy: remove redundant ternary operators
Liao Yuanhong [Thu, 4 Sep 2025 08:21:11 +0000 (16:21 +0800)] 
amdgpu/pm/legacy: remove redundant ternary operators

For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amd/display: Remove redundant ternary operators
Liao Yuanhong [Thu, 4 Sep 2025 07:10:15 +0000 (15:10 +0800)] 
drm/amd/display: Remove redundant ternary operators

For ternary operators in the form of "a ? true : false" or
"a ? false : true", if 'a' itself returns a boolean result, the ternary
operator can be omitted. Remove redundant ternary operators to clean up the
code.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amdgpu/userq: add a detect and reset callback
Jesse.Zhang [Thu, 4 Sep 2025 01:54:36 +0000 (09:54 +0800)] 
drm/amdgpu/userq: add a detect and reset callback

Add a detect and reset callback and add the implementation
for mes.  The callback will detect all hung queues of a
particular ip type (e.g., GFX or compute or SDMA) and
reset them.

v2: increase reset counter and set fence force completion
v3: Removed userq_mutex in mes_userq_detect_and_reset since the driver holds it when calling

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>
7 weeks agodrm/amdkfd: Fix error code sign for EINVAL in svm_ioctl()
Qianfeng Rong [Thu, 4 Sep 2025 12:36:46 +0000 (20:36 +0800)] 
drm/amdkfd: Fix error code sign for EINVAL in svm_ioctl()

Use negative error code -EINVAL instead of positive EINVAL in the default
case of svm_ioctl() to conform to Linux kernel error code conventions.

Fixes: 42de677f7999 ("drm/amdkfd: register svm range")
Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amdgpu: don't enable SMU on cyan skillfish
Alex Deucher [Fri, 27 Jun 2025 14:25:09 +0000 (10:25 -0400)] 
drm/amdgpu: don't enable SMU on cyan skillfish

Cyan skillfish uses different SMU firmware.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amdgpu: add support for cyan skillfish gpu_info
Alex Deucher [Fri, 27 Jun 2025 14:21:16 +0000 (10:21 -0400)] 
drm/amdgpu: add support for cyan skillfish gpu_info

Some SOCs which are part of the cyan skillfish family
rely on an explicit firmware for IP discovery.  Add support
for the gpu_info firmware.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amdgpu: add support for cyan skillfish without IP discovery
Alex Deucher [Fri, 27 Jun 2025 14:18:46 +0000 (10:18 -0400)] 
drm/amdgpu: add support for cyan skillfish without IP discovery

For platforms without an IP discovery table.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amdgpu: add ip offset support for cyan skillfish
Alex Deucher [Fri, 27 Jun 2025 14:12:36 +0000 (10:12 -0400)] 
drm/amdgpu: add ip offset support for cyan skillfish

For chips that don't have IP discovery tables.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amdgpu: Fix function header names in amdgpu_connectors.c
Srinivasan Shanmugam [Sun, 31 Aug 2025 09:59:56 +0000 (15:29 +0530)] 
drm/amdgpu: Fix function header names in amdgpu_connectors.c

Align the function headers for `amdgpu_max_hdmi_pixel_clock` and
`amdgpu_connector_dvi_mode_valid` with the function implementations so
they match the expected kdoc style.

Fixes the below:
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1199: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
 * Returns the maximum supported HDMI (TMDS) pixel clock in KHz.
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1212: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
 * Validates the given display mode on DVI and HDMI connectors.

Fixes: 585b2f685c56 ("drm/amdgpu: Respect max pixel clock for HDMI and DVI-D (v2)")
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agoamd/amdkfd: correct mem limit calculation for small APUs
Yifan Zhang [Wed, 20 Aug 2025 08:10:51 +0000 (16:10 +0800)] 
amd/amdkfd: correct mem limit calculation for small APUs

Current mem limit check leaks some GTT memory (reserved_for_pt
reserved_for_ras + adev->vram_pin_size) for small APUs.

Since carveout VRAM is tunable on APUs, there are three case
regarding the carveout VRAM size relative to GTT:

1. 0 < carveout < gtt
   apu_prefer_gtt = true, is_app_apu = false

2. carveout > gtt / 2
   apu_prefer_gtt = false, is_app_apu = false

3. 0 = carveout
   apu_prefer_gtt = true, is_app_apu = true

It doesn't make sense to check below limitation in case 1
(default case, small carveout) because the values in the below
expression are mixed with carveout and gtt.

adev->kfd.vram_used[xcp_id] + vram_needed >
    vram_size - reserved_for_pt - reserved_for_ras -
    atomic64_read(&adev->vram_pin_size)

gtt: kfd.vram_used, vram_needed, vram_size
carveout: reserved_for_pt, reserved_for_ras, adev->vram_pin_size

In case 1, vram allocation will go to gtt domain, skip vram check
since ttm_mem_limit check already cover this allocation.

Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amd/display: remove oem i2c adapter on finish
Geoffrey McRae [Thu, 28 Aug 2025 12:26:22 +0000 (22:26 +1000)] 
drm/amd/display: remove oem i2c adapter on finish

Fixes a bug where unbinding of the GPU would leave the oem i2c adapter
registered resulting in a null pointer dereference when applications try
to access the invalid device.

Fixes: 3d5470c97314 ("drm/amd/display/dm: add support for OEM i2c bus")
Cc: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Geoffrey McRae <geoffrey.mcrae@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amdgpu/userq: add force completion helpers
Alex Deucher [Fri, 18 Apr 2025 15:35:49 +0000 (11:35 -0400)] 
drm/amdgpu/userq: add force completion helpers

Add support for forcing completion of userq fences.
This is needed for userq resets and asic resets so that we
can set the error on the fence and force completion.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amdgpu: add user queue reset source
Alex Deucher [Wed, 16 Apr 2025 17:12:40 +0000 (13:12 -0400)] 
drm/amdgpu: add user queue reset source

Track resets from user queues.

Reviewed-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>
7 weeks agodrm/amdgpu/mes12: implement detect and reset callback
Jesse.Zhang [Thu, 4 Sep 2025 01:50:00 +0000 (09:50 +0800)] 
drm/amdgpu/mes12: implement detect and reset callback

Implement support for the hung queue detect and reset
functionality.

v2: Always use AMDGPU_MES_SCHED_PIPE

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>
7 weeks agodrm/amdgpu/mes11: implement detect and reset callback
Jesse.Zhang [Thu, 4 Sep 2025 01:44:51 +0000 (09:44 +0800)] 
drm/amdgpu/mes11: implement detect and reset callback

Implement support for the hung queue detect and reset
functionality.

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>
7 weeks agodrm/amdgpu/mes: add front end for detect and reset hung queue
Jesse.Zhang [Thu, 4 Sep 2025 01:39:34 +0000 (09:39 +0800)] 
drm/amdgpu/mes: add front end for detect and reset hung queue

Helper function to detect and reset hung queues.  MES will
return an array of doorbell indices of which queues are hung
and were optionally reset.

v2:  Clear the doorbell array before detection

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>
7 weeks agodrm/amd/amdgpu: Implement MES suspend/resume gang functionality for v12
Jesse.Zhang [Sun, 3 Aug 2025 13:21:42 +0000 (21:21 +0800)] 
drm/amd/amdgpu: Implement MES suspend/resume gang functionality for v12

This commit implements the actual MES (Micro Engine Scheduler) suspend
and resume gang operations for version 12 hardware. Previously these
functions were just stubs returning success.

v2: Always use AMDGPU_MES_SCHED_PIPE

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
7 weeks agodrm/amdgpu: Add preempt and restore callbacks to userq funcs
Jesse.Zhang [Tue, 5 Aug 2025 03:26:15 +0000 (11:26 +0800)] 
drm/amdgpu: Add preempt and restore callbacks to userq funcs

Add two new function pointers to struct amdgpu_userq_funcs:
- preempt: To handle preemption of user mode queues
- restore: To restore preempted user mode queues

These callbacks will allow the driver to properly manage queue
preemption and restoration when needed, such as during context
switching or priority changes.

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>
7 weeks agodrm/amdgpu: fix the formating for debugfs print
Sunil Khatri [Thu, 14 Aug 2025 07:59:04 +0000 (13:29 +0530)] 
drm/amdgpu: fix the formating for debugfs print

Fix the format of debugfs print in the mqd. Need to
add a colon so parser can parse it properly.

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>
7 weeks agodrm/amd: add more cyan skillfish PCI ids
Alex Deucher [Fri, 27 Jun 2025 14:09:06 +0000 (10:09 -0400)] 
drm/amd: add more cyan skillfish PCI ids

Add additional PCI IDs to the cyan skillfish family.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 weeks agodrm/amdgpu: add more information in debugfs to pagetable dump
Sunil Khatri [Thu, 14 Aug 2025 07:53:32 +0000 (13:23 +0530)] 
drm/amdgpu: add more information in debugfs to pagetable dump

Add more information in the debugfs which is needed to dump
a pagetable correctly for userqueues where vmid is not known
in the kernel.

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>