]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
2 months agodrm/amdgpu: add amdgpu_ttm_job_submit helper
Pierre-Eric Pelloux-Prayer [Tue, 18 Nov 2025 13:41:50 +0000 (14:41 +0100)] 
drm/amdgpu: add amdgpu_ttm_job_submit helper

Deduplicate the IB padding code and will also be used
later to check locking.

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>
2 months agodrm/amdgpu: introduce amdgpu_ttm_buffer_entity
Pierre-Eric Pelloux-Prayer [Fri, 19 Sep 2025 07:35:03 +0000 (09:35 +0200)] 
drm/amdgpu: introduce amdgpu_ttm_buffer_entity

No functional change for now, but this struct will have more
fields added in the next commit.

This change would introduce synchronisation issue, because
dependencies between successive jobs are not taken care of
properly. For instance, amdgpu_ttm_clear_buffer uses
amdgpu_ttm_map_buffer then amdgpu_ttm_fill_mem which should
use different entities (default_entity then move/clear entity).
To prevent failures for this commit, we limit ourselves to
2 entities: default_entity (which replaces high_pr usages) and
clear_entity (which replaces low_pr usages).

The next commits will deal with these dependencies correctly,
and then we'll be able to use move_entity.

---
v2: renamed amdgpu_ttm_buffer_entity
v4: don't use move_entity in ttm yet
---

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com> (v3)
Acked-by: Felix Kuehling <felix.kuehling@amd.com> (v3)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: add imu support for gc 12_1
Likun Gao [Tue, 13 May 2025 06:03:46 +0000 (14:03 +0800)] 
drm/amdgpu: add imu support for gc 12_1

Add IMU support for gc version 12.1.0.
Only support imu fw loading for imu 12.1.0.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: fix mes code error for muti-xcc
Likun Gao [Fri, 18 Apr 2025 03:11:24 +0000 (11:11 +0800)] 
drm/amdgpu: fix mes code error for muti-xcc

Fix some code error for muti-xcc on mes v12_1.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gmc12: set MMHUBs based on aid_mask
Likun Gao [Tue, 11 Nov 2025 03:43:05 +0000 (11:43 +0800)] 
drm/amdgpu/gmc12: set MMHUBs based on aid_mask

Update number of mmhub and mid_mask via reuse aid_mask.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Le Ma <le.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: set gfxhub according xcc_mask for gfx 12_1
Likun Gao [Fri, 18 Apr 2025 03:06:51 +0000 (11:06 +0800)] 
drm/amdgpu: set gfxhub according xcc_mask for gfx 12_1

Set GFXHUB accodring to xcc_mask for gfx version 12_1.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: add xcc info for compute ring name
Likun Gao [Fri, 18 Apr 2025 03:04:12 +0000 (11:04 +0800)] 
drm/amdgpu: add xcc info for compute ring name

Add XCC id info for compute ring name on gfx version 12.1.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdkfd: bump minimum vgpr size for gfx1151
Jonathan Kim [Fri, 5 Dec 2025 19:41:08 +0000 (14:41 -0500)] 
drm/amdkfd: bump minimum vgpr size for gfx1151

GFX1151 has 1.5x the number of available physical VGPRs per SIMD.
Bump total memory availability for acquire checks on queue creation.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Revert retry based thrashing prevention on GFX 12.1.0
Mukul Joshi [Thu, 15 May 2025 02:07:47 +0000 (22:07 -0400)] 
drm/amdgpu: Revert retry based thrashing prevention on GFX 12.1.0

Revert the change to enable retry based thrashing prevention on GFX 12.1.0
for now as its causing data mismatch and slowness issues with multiple HIP
tests.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Init single mes instance if xcc_mask is unset
Hawking Zhang [Tue, 6 May 2025 06:43:36 +0000 (14:43 +0800)] 
drm/amdgpu: Init single mes instance if xcc_mask is unset

Configure a single mes instance if the xcc_mask remains
uninitialized.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Jack Xiao <Jack.Xiao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Setup MTYPEs for GFX 12.1.0
Mukul Joshi [Sat, 29 Mar 2025 02:21:28 +0000 (22:21 -0400)] 
drm/amdgpu: Setup MTYPEs for GFX 12.1.0

For GFX 12.1.0, setup correct MTYPE for a BO depending on
its current location relative to the mapping GPU.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Alex Sierra <alex.sierra@amd.com>
Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: update sh mem base offsets for gfx 12.1
Alex Sierra [Thu, 3 Apr 2025 21:49:54 +0000 (16:49 -0500)] 
drm/amdgpu: update sh mem base offsets for gfx 12.1

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Reviewed-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/ras: Reduce stack usage in ras_umc_handle_bad_pages()
Srinivasan Shanmugam [Fri, 5 Dec 2025 12:07:57 +0000 (17:37 +0530)] 
drm/amd/ras: Reduce stack usage in ras_umc_handle_bad_pages()

ras_umc_handle_bad_pages() function used a large local array:
  struct eeprom_umc_record records[MAX_ECC_NUM_PER_RETIREMENT];

Move this array off the stack by allocating it with kcalloc()
and freeing it before return.

This reduces the stack frame size of ras_umc_handle_bad_pages()
and avoids the frame size warning.

Fixes the below:
drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_umc.c:498:5: warning: stack frame size (1208) exceeds limit (1024) in 'ras_umc_handle_bad_pages' [-Wframe-larger-than]

v2: Removed the duplicate ras_umc_get_new_records() invocation. (Lijo)

Cc: Tao Zhou <tao.zhou1@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@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: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Fix SHMEM alignment mode for GFX 12.1.0
Mukul Joshi [Thu, 27 Mar 2025 21:17:06 +0000 (17:17 -0400)] 
drm/amdgpu: Fix SHMEM alignment mode for GFX 12.1.0

Alignment mode in SHMEM config register is only a single bit
value on GFX 12.1.0 instead of 2 bits in previous asics.
Add a new enum and use the correct value of SHMEM alignment mode
when programming the SHMEM config register.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: shrink struct members
Rosen Penev [Sat, 8 Nov 2025 17:40:47 +0000 (09:40 -0800)] 
drm/amd/display: shrink struct members

On a 32-bit ARM system, the audio_decoder struct ends up being too large
for dp_retrain_link_dp_test.

link_dp_cts.c:157:1: error: the frame size of 1328 bytes is larger than
1280 bytes [-Werror=frame-larger-than=]

This is mitigated by shrinking the members of the struct and avoids
having to deal with dynamic allocation.

feed_back_divider is assigned but otherwise unused. Remove both.

pixel_repetition looks like it should be a bool since it's only ever
assigned to 1. But there are checks for 2 and 4. Reduce to uint8_t.

Remove ss_percentage_divider. Unused.

Shrink refresh_rate as it gets assigned to at most a 3 digit integer
value.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdkfd: Export the cwsr_size and ctl_stack_size to userspace
Mario Limonciello [Fri, 5 Dec 2025 18:41:58 +0000 (12:41 -0600)] 
drm/amdkfd: Export the cwsr_size and ctl_stack_size to userspace

This is important for userspace to avoid hardcoding VGPR size.

Reviewed-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoamdkfd: Bump ABI to indicate presence of Trap handler support for expert scheduling
Mario Limonciello [Fri, 5 Dec 2025 14:04:41 +0000 (08:04 -0600)] 
amdkfd: Bump ABI to indicate presence of Trap handler support for expert scheduling

commit 0f0c8a6983db ("drm/amdkfd: Trap handler support for expert
scheduling mode") introduced support for a trap handler when expert
scheduling mode. However userspace needs to know whether or not a trap
handler support is present.

Bump the KFD IOCTL API so that userspace can key off this to decide.

Suggested-by: Stella Laurenzo <stella.laurenzo@amd.com>
Fixes: 423888879412 ("drm/amdkfd: Trap handler support for expert scheduling mode")
Reviewed-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Promote DC to 3.2.362
Taimur Hassan [Sat, 29 Nov 2025 01:15:43 +0000 (20:15 -0500)] 
drm/amd/display: Promote DC to 3.2.362

This version brings along the following updates:

 - Defer transitions from minimal state to final state
 - Remove periodic detection callbacks from dcn35+
 - Fixes for S0i3 exit
 - Refactor dml_core_mode_support to reduce stack frame
 - Add additional info from DML for DMU

Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Additional info from DML for DMU
Nevenko Stupar [Mon, 17 Nov 2025 21:47:21 +0000 (16:47 -0500)] 
drm/amd/display: Additional info from DML for DMU

[WHAT]
Add additional info from DML for DMU when applicable
on future platforms.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Nevenko Stupar <Nevenko.Stupar@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Refactor dml_core_mode_support to reduce stack frame
Alex Hung [Wed, 26 Nov 2025 18:44:35 +0000 (11:44 -0700)] 
drm/amd/display: Refactor dml_core_mode_support to reduce stack frame

[WHAT]
When compiling Linux kernel with clang, the following warning / error
messages pops up:

drivers/gpu/drm/amd/amdgpu/../dal-dev/dc/dml2_0/display_mode_core.c:6853:12:
error: stack frame size (2120) exceeds limit (2056) in
'dml_core_mode_support' [-Werror,-Wframe-larger-than]
 6853 | dml_bool_t dml_core_mode_support(struct display_mode_lib_st
*mode_lib)

[HOW]
Refactoring CalculateVMRowAndSwath_params assignments to a new function
helps reduce the stack frame size in dml_core_mode_support.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4733
Reviewed-by: Austin Zheng <austin.zheng@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Fixes for S0i3 exit
Ovidiu Bunea [Thu, 27 Nov 2025 23:10:02 +0000 (18:10 -0500)] 
drm/amd/display: Fixes for S0i3 exit

[why & how]
Add debug flag "ignore_pg" to dcn32 PG functions.
Update default z10 support status.
Temp disable RFB features for ASIC.
Remove legacy code path.

Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Signed-off-by: Ovidiu Bunea <ovidiu.bunea@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Remove periodic detection callbacks from dcn35+
Dillon Varone [Wed, 26 Nov 2025 14:25:50 +0000 (09:25 -0500)] 
drm/amd/display: Remove periodic detection callbacks from dcn35+

[WHY&HOW]
These will not be needed going forward as DMU will communicate to the
driver when detection may be needed after a power saving event.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Defer transitions from minimal state to final state
Joshua Aberback [Fri, 21 Nov 2025 20:46:17 +0000 (15:46 -0500)] 
drm/amd/display: Defer transitions from minimal state to final state

[Why]
In non-seamless pipe transitions, it can take several frames to process
a single flip. One of the reasons is the 2-step transition implementation
where first the minimal transition state is applied, then the final state
is applied, all within the same flip. This delay is noticeable to the user
in some video playback scenarios, which makes for a bad user experience.

[How]
 - in applicable non-seamless cases, complete the flip with the minimal
   state applied, start a counter, and create all new contexts as minimal
 - if another pipe transition occurs while counting, reset the counter
 - when the counter finishes, promote the current flip to a full update
   and restore creation of optimized contexts
 - when creating minimal states from new context, apply stream updates

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Joshua Aberback <joshua.aberback@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: don't attach the tlb fence for SI
Alex Deucher [Tue, 2 Dec 2025 19:24:03 +0000 (14:24 -0500)] 
drm/amdgpu: don't attach the tlb fence for SI

SI hardware doesn't support pasids, user mode queues, or
KIQ/MES so there is no need for this.  Doing so results in
a segfault as these callbacks are non-existent for SI.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4744
Fixes: f3854e04b708 ("drm/amdgpu: attach tlb fence to the PTs update")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Use GFP_ATOMIC in dc_create_plane_state()
Alex Deucher [Tue, 11 Nov 2025 16:17:22 +0000 (11:17 -0500)] 
drm/amd/display: Use GFP_ATOMIC in dc_create_plane_state()

This can get called from an atomic context.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4470
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdkfd: Trap handler support for expert scheduling mode
Jay Cornwall [Fri, 14 Nov 2025 20:32:42 +0000 (14:32 -0600)] 
drm/amdkfd: Trap handler support for expert scheduling mode

The trap may be entered with dependency checking disabled.
Wait for dependency counters and save/restore scheduling mode.

v2:

Use ttmp1 instead of ttmp11. ttmp11 is not zero-initialized.
While the trap handler does zero this field before use, a user-mode
second-level trap handler could not rely on this being zero when
using an older kernel mode driver.

v3:

Use ttmp11 primarily but copy to ttmp1 before jumping to the
second level trap handler. ttmp1 is inspectable by a debugger.
Unexpected bits in the unused space may regress existing software.

Signed-off-by: Jay Cornwall <jay.cornwall@amd.com>
Reviewed-by: Lancelot Six <lancelot.six@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/sdma_v7_1: Add missing inst_mask entry in sdma_v7_1_inst_gfx_resume()
Srinivasan Shanmugam [Tue, 2 Dec 2025 10:02:04 +0000 (15:32 +0530)] 
drm/amdgpu/sdma_v7_1: Add missing inst_mask entry in sdma_v7_1_inst_gfx_resume()

The comment for sdma_v7_1_inst_gfx_resume() did not include the
inst_mask parameter, even though the function takes it as an argument.

Update the comment to document inst_mask as the mask of SDMA engine
instances to be enabled.

Fixes the below with gcc W=1:
drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c:644 function parameter 'inst_mask' not described in 'sdma_v7_1_inst_gfx_resume'

Cc: Likun Gao <Likun.Gao@amd.com>
Cc: Le Ma <le.ma@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@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>
2 months agodrm/amd/pm: Use common helper for smuv14.0.2 dpm
Lijo Lazar [Thu, 27 Nov 2025 11:15:52 +0000 (16:45 +0530)] 
drm/amd/pm: Use common helper for smuv14.0.2 dpm

Use helper function to print smuv14.0.2 dpm tables to sysfs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use common helper for smuv13.0.7 dpm
Lijo Lazar [Thu, 27 Nov 2025 10:41:46 +0000 (16:11 +0530)] 
drm/amd/pm: Use common helper for smuv13.0.7 dpm

Use helper function to print smuv13.0.7 dpm tables to sysfs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use common helper for smuv13.0.6 dpm
Lijo Lazar [Thu, 27 Nov 2025 10:35:42 +0000 (16:05 +0530)] 
drm/amd/pm: Use common helper for smuv13.0.6 dpm

Use helper function to print navi10 dpm tables to sysfs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use common helper for smuv13.0.0 dpm
Lijo Lazar [Thu, 27 Nov 2025 10:27:22 +0000 (15:57 +0530)] 
drm/amd/pm: Use common helper for smuv13.0.0 dpm

Use helper function to print smuv13.0.0 dpm tables to sysfs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use common helper for aldebaran dpm table
Lijo Lazar [Thu, 27 Nov 2025 10:00:43 +0000 (15:30 +0530)] 
drm/amd/pm: Use common helper for aldebaran dpm table

Use helper function to print aldebaran dpm tables to sysfs. Remove
unused functions.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use common helper for sienna dpm table
Lijo Lazar [Thu, 27 Nov 2025 09:48:23 +0000 (15:18 +0530)] 
drm/amd/pm: Use common helper for sienna dpm table

Use helper function to print sienna cichlid dpm tables to sysfs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use common helper for navi10 dpm table
Lijo Lazar [Thu, 27 Nov 2025 08:35:27 +0000 (14:05 +0530)] 
drm/amd/pm: Use common helper for navi10 dpm table

Use helper function to print navi10 dpm tables to sysfs. Also, remove
FCLK table as it is not supported in navi10.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use common helper for arcturus dpm
Lijo Lazar [Wed, 26 Nov 2025 05:17:10 +0000 (10:47 +0530)] 
drm/amd/pm: Use common helper for arcturus dpm

Use the helper function to print DPM clock levels to sysfs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Add a helper to show dpm table
Lijo Lazar [Tue, 25 Nov 2025 15:24:58 +0000 (20:54 +0530)] 
drm/amd/pm: Add a helper to show dpm table

Add a helper function to print clock and pcie dpm levels through sysfs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use generic pcie dpm table for SMUv14
Lijo Lazar [Tue, 25 Nov 2025 12:33:30 +0000 (18:03 +0530)] 
drm/amd/pm: Use generic pcie dpm table for SMUv14

Use smu_pcie_table for SMUv14 SOCs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use generic pcie dpm table for SMUv13
Lijo Lazar [Tue, 25 Nov 2025 12:18:48 +0000 (17:48 +0530)] 
drm/amd/pm: Use generic pcie dpm table for SMUv13

Use smu_pcie_table for SMUv13 SOCs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use generic pcie dpm table for SMUv11
Lijo Lazar [Tue, 25 Nov 2025 11:52:34 +0000 (17:22 +0530)] 
drm/amd/pm: Use generic pcie dpm table for SMUv11

Use smu_pcie_table for SMUv11 SOCs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Add generic pcie dpm table
Lijo Lazar [Tue, 25 Nov 2025 11:06:08 +0000 (16:36 +0530)] 
drm/amd/pm: Add generic pcie dpm table

Add a generic pcie dpm table which contains the number of link clock
levels and link clock, pcie gen speed/width corresponding to each level.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use generic dpm table for SMUv14 SOCs
Lijo Lazar [Tue, 25 Nov 2025 10:23:25 +0000 (15:53 +0530)] 
drm/amd/pm: Use generic dpm table for SMUv14 SOCs

Use the generic dpm table structure instead of SMUv14 specific table.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use generic dpm table for SMUv13 SOCs
Lijo Lazar [Tue, 25 Nov 2025 10:10:05 +0000 (15:40 +0530)] 
drm/amd/pm: Use generic dpm table for SMUv13 SOCs

Use the generic dpm table structure instead of SMUv13 specific table.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoamdkfd: introduce new ioctl AMDKFD_IOC_CREATE_PROCESS
Zhu Lingshan [Thu, 21 Aug 2025 09:22:44 +0000 (17:22 +0800)] 
amdkfd: introduce new ioctl AMDKFD_IOC_CREATE_PROCESS

This commit implemetns a new ioctl AMDKFD_IOC_CREATE_PROCESS
that creates a new secondary kfd_progress on the FD.

To keep backward compatibility, userspace programs need to invoke
this ioctl explicitly on a FD to create a secondary
kfd_process which replacing its primary kfd_process.

This commit bumps ioctl minor version.

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoamdkfd: process debug trap ioctl only on a primary context
Zhu Lingshan [Mon, 13 Oct 2025 07:58:31 +0000 (15:58 +0800)] 
amdkfd: process debug trap ioctl only on a primary context

Set_debug_trap ioctl should work on a specific kfd_process
even when multiple contexts feature is implemented.

For consistency, this commit allow set_debug_trap ioctl only work on the
primary kfd process of a user space program

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use generic dpm table for SMUv11 SOCs
Lijo Lazar [Tue, 25 Nov 2025 07:22:10 +0000 (12:52 +0530)] 
drm/amd/pm: Use generic dpm table for SMUv11 SOCs

Remove SMUv11 specific DPM table and use the generic dpm table
structure.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Add clock table structure
Lijo Lazar [Tue, 25 Nov 2025 06:43:51 +0000 (12:13 +0530)] 
drm/amd/pm: Add clock table structure

Add a common clock table structure to represent dpm levels for different
clocks.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdkfd: Use huge page size to check split svm range alignment
Xiaogang Chen [Mon, 1 Dec 2025 20:12:29 +0000 (14:12 -0600)] 
drm/amdkfd: Use huge page size to check split svm range alignment

When split svm ranges that have been mapped using huge page should use huge
page size(2MB) to check split range alignment, not prange->granularity that
means migration granularity.

Fixes: 7ef6b2d4b7e5 ("drm/amdkfd: remap unaligned svm ranges that have split")
Signed-off-by: Xiaogang Chen <xiaogang.chen@amd.com>
Reviewed-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: add a helper for processing recoverable GPUVM faults
Alex Deucher [Mon, 1 Dec 2025 19:46:53 +0000 (14:46 -0500)] 
drm/amdgpu: add a helper for processing recoverable GPUVM faults

Add a common helper to remove the repeated logic from each
gmc module.

Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Deprecate print_clock_levels interface
Lijo Lazar [Wed, 26 Nov 2025 10:38:14 +0000 (16:08 +0530)] 
drm/amd/pm: Deprecate print_clock_levels interface

Use emit_clock_levels instead of print_clock_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clock_levels in vega20
Lijo Lazar [Wed, 26 Nov 2025 10:15:48 +0000 (15:45 +0530)] 
drm/amd/pm: Use emit_clock_levels in vega20

Move to emit_clock_levels from print_clock_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clock_levels in vega12
Lijo Lazar [Wed, 26 Nov 2025 10:09:58 +0000 (15:39 +0530)] 
drm/amd/pm: Use emit_clock_levels in vega12

Move to emit_clock_levels from print_clock_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clock_levels in vega10
Lijo Lazar [Wed, 26 Nov 2025 09:29:14 +0000 (14:59 +0530)] 
drm/amd/pm: Use emit_clock_levels in vega10

Keep only emit_clock_levels, and remove print_clock_levels.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clock_levels in SMUv10.0
Lijo Lazar [Wed, 26 Nov 2025 09:17:07 +0000 (14:47 +0530)] 
drm/amd/pm: Use emit_clock_levels in SMUv10.0

Move to emit_clock_levels from print_clock_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clock_levels in SMUv8.0
Lijo Lazar [Wed, 26 Nov 2025 09:15:16 +0000 (14:45 +0530)] 
drm/amd/pm: Use emit_clock_levels in SMUv8.0

Move to emit_clock_levels from print_clock_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clock_levels in SMUv7.0
Lijo Lazar [Wed, 26 Nov 2025 08:08:40 +0000 (13:38 +0530)] 
drm/amd/pm: Use emit_clock_levels in SMUv7.0

Move to emit_clock_levels from print_clock_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clk_levels in SMUv14.0.2
Lijo Lazar [Wed, 26 Nov 2025 07:57:44 +0000 (13:27 +0530)] 
drm/amd/pm: Use emit_clk_levels in SMUv14.0.2

Move to emit_clk_levels from print_clk_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clk_levels in SMUv14.0.0
Lijo Lazar [Wed, 26 Nov 2025 07:54:19 +0000 (13:24 +0530)] 
drm/amd/pm: Use emit_clk_levels in SMUv14.0.0

Move to emit_clk_levels from print_clk_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clk_levels in yellow carp
Lijo Lazar [Wed, 26 Nov 2025 07:50:50 +0000 (13:20 +0530)] 
drm/amd/pm: Use emit_clk_levels in yellow carp

Move to emit_clk_levels from print_clk_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clk_levels in SMUv13.0.7
Lijo Lazar [Wed, 26 Nov 2025 07:48:38 +0000 (13:18 +0530)] 
drm/amd/pm: Use emit_clk_levels in SMUv13.0.7

Move to emit_clk_levels from print_clk_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clk_levels in SMUv13.0.6
Lijo Lazar [Wed, 26 Nov 2025 07:44:45 +0000 (13:14 +0530)] 
drm/amd/pm: Use emit_clk_levels in SMUv13.0.6

Move to emit_clk_levels from print_clk_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clk_levels in SMUv13.0.5
Lijo Lazar [Wed, 26 Nov 2025 07:33:32 +0000 (13:03 +0530)] 
drm/amd/pm: Use emit_clk_levels in SMUv13.0.5

Move to emit_clk_levels from print_clk_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clk_levels in SMUv13.0.4
Lijo Lazar [Wed, 26 Nov 2025 07:30:18 +0000 (13:00 +0530)] 
drm/amd/pm: Use emit_clk_levels in SMUv13.0.4

Move to emit_clk_levels from print_clk_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clk_levels in SMUv13.0.0
Lijo Lazar [Wed, 26 Nov 2025 07:25:37 +0000 (12:55 +0530)] 
drm/amd/pm: Use emit_clk_levels in SMUv13.0.0

Move to emit_clk_levels from print_clk_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clk_levels in renoir
Lijo Lazar [Wed, 26 Nov 2025 07:17:06 +0000 (12:47 +0530)] 
drm/amd/pm: Use emit_clk_levels in renoir

Move to emit_clk_levels from print_clk_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clk_levels in vangogh
Lijo Lazar [Wed, 26 Nov 2025 07:03:52 +0000 (12:33 +0530)] 
drm/amd/pm: Use emit_clk_levels in vangogh

Move to emit_clk_levels from print_clk_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clk_levels in cyan skillfish
Lijo Lazar [Wed, 26 Nov 2025 06:59:41 +0000 (12:29 +0530)] 
drm/amd/pm: Use emit_clk_levels in cyan skillfish

Move to emit_clk_levels from print_clk_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: add soc config init for GC v12_1
Likun Gao [Fri, 21 Mar 2025 03:23:44 +0000 (11:23 +0800)] 
drm/amdgpu: add soc config init for GC v12_1

Add function to initialize soc configuration information
for GC 12.1.0 ASICs.
Use it to map IPs and other SOC related information once IP
configuration information is available through discovery.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use emit_clk_levels in sienna_cichild
Lijo Lazar [Wed, 26 Nov 2025 06:52:15 +0000 (12:22 +0530)] 
drm/amd/pm: Use emit_clk_levels in sienna_cichild

Move to emit_clk_levels from print_clk_levels

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Remove print_clk_levels from navi10
Lijo Lazar [Wed, 26 Nov 2025 06:33:59 +0000 (12:03 +0530)] 
drm/amd/pm: Remove print_clk_levels from navi10

Keep only emit_clk_levels as it covers print_clk_levels functionality

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoamdkfd: fence handler evict and restore a kfd process by its context id
Zhu Lingshan [Tue, 5 Aug 2025 03:31:32 +0000 (11:31 +0800)] 
amdkfd: fence handler evict and restore a kfd process by its context id

In fence enable signaling handler, kfd evicts
and restores the corresponding kfd_process,
this commit helps find the kfd_process by
both its mm and context id.

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoamdkfd: record kfd context id in amdkfd_fence
Zhu Lingshan [Wed, 6 Aug 2025 13:37:26 +0000 (21:37 +0800)] 
amdkfd: record kfd context id in amdkfd_fence

This commit records the context id of the
cooresponding kfd process in amdkfd_fence

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/mes12_1: set multi-xcc mes log address
Michael Chen [Fri, 21 Mar 2025 18:39:03 +0000 (14:39 -0400)] 
drm/amdgpu/mes12_1: set multi-xcc mes log address

Set mes event log address based on xcc id and pipe.

Signed-off-by: Michael Chen <michael.chen@amd.com>
Reviewed-by: Jack Xiao <Jack.Xiao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/mes12_1: add cooperative dispatch support
Jack Xiao [Mon, 10 Mar 2025 09:02:36 +0000 (17:02 +0800)] 
drm/amdgpu/mes12_1: add cooperative dispatch support

Add initial cooperative dispatch MES support.
a. set shared cmd buffer for the group of cooperative dispatch mes.
b. automatically dispatch add_hw_queue/remove_hw_queue to master mes.

Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdkfd: Add interrupt handling for GFX 12.1.0
Mukul Joshi [Thu, 27 Feb 2025 03:46:54 +0000 (22:46 -0500)] 
drm/amdkfd: Add interrupt handling for GFX 12.1.0

Add interrupt handling for GFX 12.1.0 similar to what is done
for GFX 9.4.3.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Alex Sierra <alex.sierra@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdkfd: Add MQD manager for GFX 12.1.0
Mukul Joshi [Thu, 27 Feb 2025 03:22:00 +0000 (22:22 -0500)] 
drm/amdkfd: Add MQD manager for GFX 12.1.0

This patch adds the following functionality for GFX 12.1.0:
1. Add a new MQD manager for GFX v12.1.0.
2. Add a new 12.1.0 specific device queue manager file.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Alex Sierra <alex.sierra@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdkfd: Add GFX 12.1.0 support in KFD
Mukul Joshi [Thu, 27 Feb 2025 03:09:56 +0000 (22:09 -0500)] 
drm/amdkfd: Add GFX 12.1.0 support in KFD

Add support for GFX 12.1.0 in KFD.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Alex Sierra <alex.sierra@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Setup PCIe atomics bit in PTE on GFX 12.1.0
Mukul Joshi [Wed, 26 Feb 2025 20:45:46 +0000 (15:45 -0500)] 
drm/amdgpu: Setup PCIe atomics bit in PTE on GFX 12.1.0

To enable atomic access to memory, setup the new PCIe atomics bit
in PTE on GFX 12.1.0.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Alex Sierra <alex.sierra@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Setup Atomics enable in TCP UTCL0 for GFX 12.1.0
Mukul Joshi [Wed, 26 Feb 2025 20:35:23 +0000 (15:35 -0500)] 
drm/amdgpu: Setup Atomics enable in TCP UTCL0 for GFX 12.1.0

We need to explicitly setup atomics enable in TCP UTCL0 to enable
PCIe atomics to host memory.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Alex Sierra <alex.sierra@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Fix golden register init for GFX 12.1.0
Mukul Joshi [Wed, 26 Feb 2025 20:29:09 +0000 (15:29 -0500)] 
drm/amdgpu: Fix golden register init for GFX 12.1.0

TCP_UTCL0 registers are not per XCD so don't init them on a per
XCD basis.

Fixes: ad5f1ee0a9b0 ("drm/amdgpu: Add initial support for gfx v12_1")
Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Alex Sierra <alex.sierra@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Include the correct pkt header for gfx v12_1
Hawking Zhang [Sun, 16 Mar 2025 11:04:51 +0000 (19:04 +0800)] 
drm/amdgpu: Include the correct pkt header for gfx v12_1

GFX v12_1 should use packets defined in gfx_v12_1_pkt
header file.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Acked-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd: include rrmt mode for mes_v12_1
Alex Sierra [Fri, 7 Mar 2025 18:17:34 +0000 (12:17 -0600)] 
drm/amd: include rrmt mode for mes_v12_1

Implement rrmt for misc read/write regs ops in mes_v12.
This covers LOCAL/REMOTE XCD and LOCAL/REMOTE AID.

v2: fix comments (Alex)

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Reviewed-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Michael Chen <michael.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: skip SDMA autoload copy if not initialized
Likun Gao [Tue, 11 Mar 2025 06:53:05 +0000 (14:53 +0800)] 
drm/amdgpu: skip SDMA autoload copy if not initialized

Skip SDMA firmware copy for rlc autoload if SDMA not enabled.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: only set XCC 0 related reg for rlc autoload
Likun Gao [Tue, 4 Mar 2025 02:07:16 +0000 (10:07 +0800)] 
drm/amdgpu: only set XCC 0 related reg for rlc autoload

For RLC autoload, only set XCC id 0 related register to trigger
rlc autoload, no need to trigger muti-times for muti-xcc.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: update rlc autoload function
Likun Gao [Tue, 18 Feb 2025 03:19:30 +0000 (11:19 +0800)] 
drm/amdgpu: update rlc autoload function

Update rlc autoload function for gfx v12.1.0
to support muti-XCC firmware autoload.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: remove hdp flush/invalidation completely for gfx12.1.0/sdma7.1.0
Le Ma [Tue, 25 Feb 2025 11:24:33 +0000 (19:24 +0800)] 
drm/amdgpu: remove hdp flush/invalidation completely for gfx12.1.0/sdma7.1.0

Remove the hdp operation and interfaces as the HDP hw does not exist.

v2: add checks to see if hdp funcs exists before do hdp flush/invalidation

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/include : Update MES v12 API header
Shaoyun Liu [Wed, 5 Feb 2025 17:06:50 +0000 (12:06 -0500)] 
drm/amd/include : Update MES v12 API header

1. Add RRMT option support which will be used for remote die
   register access
2. Update set_hw_resource1 for cooperative mode support
3. Add full_sh_mem_config_data for xnack support

v2: squash in compilation fix

Signed-off-by: Shaoyun Liu <shaoyun.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Add gfx v12_1_0 to discovery list
Likun Gao [Thu, 13 Feb 2025 02:16:04 +0000 (10:16 +0800)] 
drm/amdgpu: Add gfx v12_1_0 to discovery list

Include gfx v12_1_0 in the discovery list for
gfx IP blocks

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Mukul Joshi <mukul.joshi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Add initial support for gfx v12_1
Likun Gao [Mon, 17 Feb 2025 09:13:05 +0000 (17:13 +0800)] 
drm/amdgpu: Add initial support for gfx v12_1

Add initial support for gfx ip block for gc v12_1.

V2: Remove some not applicable bit set.
V3: drop unused header (Alex)
v4: Fix type on copyright
v5: fix num_xcc handling (Alex)

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Mukul Joshi <mukul.joshi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoamdkfd: record kfd context id into kfd process_info
Zhu Lingshan [Mon, 3 Mar 2025 10:42:50 +0000 (18:42 +0800)] 
amdkfd: record kfd context id into kfd process_info

This commit records the context id of the owner
kfd_process into a kfd process_info when
create it.

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoamdkfd: introduce new helper kfd_lookup_process_by_id
Zhu Lingshan [Thu, 21 Aug 2025 06:41:31 +0000 (14:41 +0800)] 
amdkfd: introduce new helper kfd_lookup_process_by_id

This commit introduces a new helper function
kfd_lookup_process_by_id which can find a
kfd process that identified by its context id from
the kfd process table

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoamdkfd: remove test_kq
Zhu Lingshan [Mon, 4 Aug 2025 08:18:58 +0000 (16:18 +0800)] 
amdkfd: remove test_kq

This commit removes test_kq() function becuse it has been
marked as unused since 2014 and no other functions calls it.

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: correct kernel-doc in dml21_wrapper.h
Randy Dunlap [Sat, 29 Nov 2025 07:37:39 +0000 (23:37 -0800)] 
drm/amd/display: correct kernel-doc in dml21_wrapper.h

Fix all kernel-doc warnings in dml21_wrapper.h:
- add missing @dml_ctx entries (2 places)
- fix function prototype typo for dml21_create()
- change a blank kernel-doc line to " *"

Fixes these warnings:
Warning: drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_wrapper.h:30
 function parameter 'dml_ctx' not described in 'dml21_create'
Warning: drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_wrapper.h:30
 expecting prototype for dml2_create(). Prototype was for dml21_create()
 instead
Warning: drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_wrapper.h:55
 bad line:
Warning: drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_wrapper.h:61
 function parameter 'dml_ctx' not described in 'dml21_validate'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/amdgpu: Move enum for VDD board
Asad Kamal [Fri, 28 Nov 2025 12:10:55 +0000 (20:10 +0800)] 
drm/amd/amdgpu: Move enum for VDD board

Move AMDGPU_PP_SENSOR_VDDBOARD below already existing
members to maintain backward compatibility

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Don't send warning when close drm obj if drm device has been unplug
Xiaogang Chen [Sat, 22 Nov 2025 22:49:22 +0000 (16:49 -0600)] 
drm/amdgpu: Don't send warning when close drm obj if drm device has been unplug

During amdgpu_gem_object_close amdgpu driver cleans vm mapping for the closing
drm obj. If the correspondent adev has been unplug got error -ENODEV code. In
this case do not need send warning message.

Signed-off-by: Xiaogang Chen <xiaogang.chen@amd.com>
Reviewed-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoamdkfd: process pointer of a HIQ should be NULL
Zhu Lingshan [Mon, 4 Aug 2025 07:36:31 +0000 (15:36 +0800)] 
amdkfd: process pointer of a HIQ should be NULL

In kq_initialize, queue->process of a HIQ should
be NULL as initialized, because it does not belong
to any kfd_process.

This commit decommisions the function kfd_get_process() because
it can not locate a specific kfd_process among multiple
contexts and not any code path calls it after this commit.

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Make pre_asic_init optional
Lijo Lazar [Fri, 28 Nov 2025 07:06:46 +0000 (12:36 +0530)] 
drm/amdgpu: Make pre_asic_init optional

pre_asic_init is not required for all SOCs. Make it optional and remove
empty implementations.

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>
2 months agoamdkfd: remove DIQ support
Zhu Lingshan [Mon, 13 Oct 2025 08:41:36 +0000 (16:41 +0800)] 
amdkfd: remove DIQ support

This commit remove DIQ support because it has been
marked as DEPRECATED since 2022

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoamdkfd: find kfd_process by filep->private_data in kfd_mmap
Zhu Lingshan [Mon, 4 Aug 2025 07:33:51 +0000 (15:33 +0800)] 
amdkfd: find kfd_process by filep->private_data in kfd_mmap

This commit finds the proper kfd_process by
filep->private_data in kfd_mmap,
because the function kfd_get_process()
can not locate a specific kfd process among
multiple contexts.

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoamdkfd: identify a secondary kfd process by its id
Zhu Lingshan [Tue, 14 Oct 2025 09:16:06 +0000 (17:16 +0800)] 
amdkfd: identify a secondary kfd process by its id

This commit introduces a new id field for
struct kfd process, which helps identify
a kfd process among multiple contexts that
all belong to a single user space program.

The sysfs entry of a secondary kfd process
is placed under the sysfs entry folder of
its primary kfd process.

The naming format of the sysfs entry of a secondary
kfd process is "context_%u" where %u is the context id.

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoamdkfd: process USERPTR allocation only on the primary kfd process
Zhu Lingshan [Mon, 30 Jun 2025 03:00:29 +0000 (11:00 +0800)] 
amdkfd: process USERPTR allocation only on the primary kfd process

The lifecycle of the primary kfd process is tied to
the user space program, all secondary kfd process
would be destroyed when fd close. Thus only the primary
kfd process should process USERPTR memory allocation.

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>