]> git.ipfire.org Git - thirdparty/linux.git/log
thirdparty/linux.git
4 days agodrm/amdkfd: Destroy KFD debugfs after destroy KFD wq
Amber Lin [Fri, 1 Aug 2025 00:45:00 +0000 (20:45 -0400)] 
drm/amdkfd: Destroy KFD debugfs after destroy KFD wq

Since KFD proc content was moved to kernel debugfs, we can't destroy KFD
debugfs before kfd_process_destroy_wq. Move kfd_process_destroy_wq prior
to kfd_debugfs_fini to fix a kernel NULL pointer problem. It happens
when /sys/kernel/debug/kfd was already destroyed in kfd_debugfs_fini but
kfd_process_destroy_wq calls kfd_debugfs_remove_process. This line
    debugfs_remove_recursive(entry->proc_dentry);
tries to remove /sys/kernel/debug/kfd/proc/<pid> while
/sys/kernel/debug/kfd is already gone. It hangs the kernel by kernel
NULL pointer.

Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Reviewed-by: Eric Huang <jinhuieric.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 0333052d90683d88531558dcfdbf2525cc37c233)
Cc: stable@vger.kernel.org
4 days agoamdgpu/amdgpu_discovery: increase timeout limit for IFWI init
Xaver Hugl [Thu, 31 Jul 2025 22:49:51 +0000 (00:49 +0200)] 
amdgpu/amdgpu_discovery: increase timeout limit for IFWI init

With a timeout of only 1 second, my rx 5700XT fails to initialize,
so this increases the timeout to 2s.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3697
Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 9ed3d7bdf2dcdf1a1196630fab89a124526e9cc2)
Cc: stable@vger.kernel.org
6 days agodrm/amdgpu: Update SDMA firmware version check for user queue support
Jesse.Zhang [Mon, 4 Aug 2025 00:43:15 +0000 (08:43 +0800)] 
drm/amdgpu: Update SDMA firmware version check for user queue support

This commit fixes a firmware version check for enabling user queue
support in SDMA v7.0. The previous version check (7836028) was
incorrect and could lead to issues with PROTECTED_FENCE_SIGNAL
commands causing register conflicts between MCU_DBG0 and MCU_DBG1.

Fixes: 8c011408ed84 ("drm/amdgpu/sdma7: add ucode version checks for userq support")
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>
(cherry picked from commit 92e2449241516c95aab95eea91faecd0fa2b7ed5)
Cc: stable@vger.kernel.org
6 days agodrm/amdgpu: Add NULL check for asic_funcs
Lijo Lazar [Fri, 18 Jul 2025 03:55:21 +0000 (09:25 +0530)] 
drm/amdgpu: Add NULL check for asic_funcs

If driver load fails too early, asic_funcs pointer remains unassigned.
Add NULL check to sanitize unwind path.

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>
(cherry picked from commit 582bf7c5158dce16f7dc5b8345b7876bd8031224)
Cc: stable@vger.kernel.org
6 days agodrm/amd/display: Revert "drm/amd/display: Fix AMDGPU_MAX_BL_LEVEL value"
Mario Limonciello [Mon, 21 Jul 2025 04:39:41 +0000 (23:39 -0500)] 
drm/amd/display: Revert "drm/amd/display: Fix AMDGPU_MAX_BL_LEVEL value"

This reverts commit 66abb996999de0d440a02583a6e70c2c24deab45.
This broke custom brightness curves but it wasn't obvious because
of other related changes. Custom brightness curves are always
from a 0-255 input signal. The correct fix was to fix the default
value which was done by [1].

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4412
Link: https://lore.kernel.org/amd-gfx/0f094c4b-d2a3-42cd-824c-dc2858a5618d@kernel.org/T/#m69f875a7e69aa22df3370b3e3a9e69f4a61fdaf2
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 6ec8a5cbec751625133461600d0d4950ffd3a214)
Cc: stable@vger.kernel.org
6 days agodrm/amd/display: fix a Null pointer dereference vulnerability
Siyang Liu [Fri, 4 Jul 2025 03:16:22 +0000 (11:16 +0800)] 
drm/amd/display: fix a Null pointer dereference vulnerability

[Why]
A null pointer dereference vulnerability exists in the AMD display driver's
(DC module) cleanup function dc_destruct().
When display control context (dc->ctx) construction fails
(due to memory allocation failure), this pointer remains NULL.
During subsequent error handling when dc_destruct() is called,
there's no NULL check before dereferencing the perf_trace member
(dc->ctx->perf_trace), causing a kernel null pointer dereference crash.

[How]
Check if dc->ctx is non-NULL before dereferencing.

Link: https://lore.kernel.org/r/tencent_54FF4252EDFB6533090A491A25EEF3EDBF06@qq.com
Co-developed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
(Updated commit text and removed unnecessary error message)
Signed-off-by: Siyang Liu <Security@tencent.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 9dd8e2ba268c636c240a918e0a31e6feaee19404)
Cc: stable@vger.kernel.org
6 days agodrm/amd/display: Add primary plane to commits for correct VRR handling
Michel Dänzer [Wed, 30 Jul 2025 08:09:02 +0000 (10:09 +0200)] 
drm/amd/display: Add primary plane to commits for correct VRR handling

amdgpu_dm_commit_planes calls update_freesync_state_on_stream only for
the primary plane. If a commit affects a CRTC but not its primary plane,
it would previously not trigger a refresh cycle or affect LFC, violating
current UAPI semantics.

Fixes e.g. atomic commits affecting only the cursor plane being limited
to the minimum refresh rate.

Don't do this for the legacy cursor ioctls though, it would break the
UAPI semantics for those.

Suggested-by: Xaver Hugl <xaver.hugl@kde.org>
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3034
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit cc7bfba95966251b254cb970c21627124da3b7f4)
Cc: stable@vger.kernel.org
6 days agodrm/amdgpu: update mmhub 3.3 client id mappings
Alex Deucher [Fri, 18 Jul 2025 19:53:21 +0000 (15:53 -0400)] 
drm/amdgpu: update mmhub 3.3 client id mappings

Update the client id mapping so the correct clients
get printed when there is a mmhub page fault.

v2: fix typos spotted by David Wu.
v3: fix additional typo spotted by David.

Reviewed-by: David (Ming Qiang) Wu <David.Wu3@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit e932f4779a2d329841bb9ca70bb80a4bb2d707b6)
Cc: stable@vger.kernel.org
6 days agodrm/amdgpu: update mmhub 3.0.1 client id mappings
Alex Deucher [Fri, 18 Jul 2025 19:52:04 +0000 (15:52 -0400)] 
drm/amdgpu: update mmhub 3.0.1 client id mappings

Update the client id mapping so the correct clients
get printed when there is a mmhub page fault.

Reviewed-by: David (Ming Qiang) Wu <David.Wu3@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 2a2681eda73b99a2c1ee8cdb006099ea5d0c2505)
Cc: stable@vger.kernel.org
6 days agodrm/amdgpu: Retain job->vm in amdgpu_job_prepare_job
YuanShang [Wed, 23 Jul 2025 08:44:49 +0000 (16:44 +0800)] 
drm/amdgpu: Retain job->vm in amdgpu_job_prepare_job

The field job->vm is used in function amdgpu_job_run to get the page
table re-generation counter and decide whether the job should be skipped.

Specifically, function amdgpu_vm_generation checks if the VM is valid for this job to use.
For instance, if a gfx job depends on a cancelled sdma job from entity vm->delayed,
then the gfx job should be skipped.

Fixes: 26c95e838e63 ("drm/amdgpu: set the VM pointer to NULL in amdgpu_job_prepare")
Signed-off-by: YuanShang <YuanShang.Mao@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit ed76936c6b10b547c6df4ca75412331e9ef6d339)
Cc: stable@vger.kernel.org
6 days agodrm/amd/display: Fix DCE 6.0 and 6.4 PLL programming.
Timur Kristóf [Tue, 22 Jul 2025 15:58:30 +0000 (17:58 +0200)] 
drm/amd/display: Fix DCE 6.0 and 6.4 PLL programming.

Apparently, both DCE 6.0 and 6.4 have 3 PLLs, but PLL0 can only
be used for DP. Make sure to initialize the correct amount of PLLs
in DC for these DCE versions and use PLL0 only for DP.

Also, on DCE 6.0 and 6.4, the PLL0 needs to be powered on at
initialization as opposed to DCE 6.1 and 7.x which use a different
clock source for DFS.

The following functions were used as reference from the old
radeon driver implementation of DCE 6.x:
- radeon_atom_pick_pll
- atombios_crtc_set_disp_eng_pll

Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 35222b5934ec8d762473592ece98659baf6bc48e)
Cc: stable@vger.kernel.org
6 days agodrm/amd/display: Don't overwrite dce60_clk_mgr
Timur Kristóf [Tue, 22 Jul 2025 15:58:29 +0000 (17:58 +0200)] 
drm/amd/display: Don't overwrite dce60_clk_mgr

dc_clk_mgr_create accidentally overwrites the dce60_clk_mgr
with the dce_clk_mgr, causing incorrect behaviour on DCE6.
Fix it by removing the extra dce_clk_mgr_construct.

Fixes: 62eab49faae7 ("drm/amd/display: hide VGH asic specific structs")
Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit bbddcbe36a686af03e91341b9bbfcca94bd45fb6)
Cc: stable@vger.kernel.org
6 days agodrm/amdkfd: Fix checkpoint-restore on multi-xcc
David Yat Sin [Wed, 16 Jul 2025 22:04:28 +0000 (22:04 +0000)] 
drm/amdkfd: Fix checkpoint-restore on multi-xcc

GPUs with multi-xcc have multiple MQDs per queue. This patch saves and
restores all the MQDs within the partition.

Signed-off-by: David Yat Sin <David.YatSin@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit a578f2a58c3ab38f0643b1b6e7534af860233cb1)
Cc: stable@vger.kernel.org
6 days agodrm/amd: Restore cached manual clock settings during resume
Mario Limonciello [Fri, 25 Jul 2025 03:12:22 +0000 (22:12 -0500)] 
drm/amd: Restore cached manual clock settings during resume

If the SCLK limits have been set before S3 they will not
be restored. The limits are however cached in the driver and so
they can be restored by running a commit sequence during resume.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://lore.kernel.org/r/20250725031222.3015095-3-superm1@kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 4e9526924d09057a9ba854305e17eded900ced82)
Cc: stable@vger.kernel.org
6 days agodrm/amd: Restore cached power limit during resume
Mario Limonciello [Fri, 25 Jul 2025 03:12:21 +0000 (22:12 -0500)] 
drm/amd: Restore cached power limit during resume

The power limit will be cached in smu->current_power_limit but
if the ASIC goes into S3 this value won't be restored.

Restore the value during SMU resume.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://lore.kernel.org/r/20250725031222.3015095-2-superm1@kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 26a609e053a6fc494403e95403bc6a2470383bec)
Cc: stable@vger.kernel.org
6 days agodrm/amdgpu: Update external revid for GC v9.5.0
Lijo Lazar [Fri, 25 Jul 2025 04:51:10 +0000 (10:21 +0530)] 
drm/amdgpu: Update external revid for GC v9.5.0

Use different external revid for GC v9.5.0 SOCs.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 21c6764ed4bfaecad034bc4fd15dd64c5a436325)
Cc: stable@vger.kernel.org
6 days agodrm/amdgpu: Update supported modes for GC v9.5.0
Lijo Lazar [Tue, 8 Jul 2025 07:47:18 +0000 (13:17 +0530)] 
drm/amdgpu: Update supported modes for GC v9.5.0

For GC v9.5.0 SOCs, both CPX and QPX compute modes are also supported in
NPS2 mode.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Acked-by: Mangesh Gadre <Mangesh.Gadre@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 9d1ac25c7f830e0132aa816393b1e9f140e71148)
Cc: stable@vger.kernel.org
10 days agoMerge tag 'drm-xe-next-fixes-2025-07-31' of https://gitlab.freedesktop.org/drm/xe...
Dave Airlie [Thu, 31 Jul 2025 21:09:11 +0000 (07:09 +1000)] 
Merge tag 'drm-xe-next-fixes-2025-07-31' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next

- Fix BMG probe on unsupported mailbox command (Raag)
- Fix OA static checker warning about null gt (Ashutosh)
- Fix a NULL vs IS_ERR() bug in xe_i2c_register_adapter (Dan)
- Fix missing unwind goto in GuC/HuC (Zhanjun)
- Don't register I2C devices if VF (Lukasz)
- Clear whole GuC g2h_fence during initialization (Michal)
- Avoid call kfree for drmm_kzalloc (Shuicheng)
- Fix pci_dev reference leak on configfs (Michal)
- SRIOV: Disable CSC support on VF (Lukasz)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/aIvIAANnXv-j_bNA@intel.com
10 days agoMerge tag 'amd-drm-fixes-6.17-2025-07-31' of https://gitlab.freedesktop.org/agd5f...
Dave Airlie [Thu, 31 Jul 2025 20:15:58 +0000 (06:15 +1000)] 
Merge tag 'amd-drm-fixes-6.17-2025-07-31' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-fixes-6.17-2025-07-31:

amdgpu:
- DSC divide by 0 fix
- clang fix
- DC debugfs fix
- Userq fixes
- Avoid extra evict-restore with KFD
- Backlight fix
- Documentation fix
- RAS fix
- Add new kicker handling
- DSC fix for DCN 3.1.4
- PSR fix
- Atomic fix
- DC reset fixes
- DCN 3.0.1 fix
- MMHUB client mapping fix

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://lore.kernel.org/r/20250731191916.255648-1-alexander.deucher@amd.com
11 days agodrm/xe/vf: Disable CSC support on VF
Lukasz Laguna [Tue, 29 Jul 2025 12:34:37 +0000 (14:34 +0200)] 
drm/xe/vf: Disable CSC support on VF

CSC is not accessible by VF drivers, so disable its support flag on VF
to prevent further initialization attempts.

Fixes: e02cea83d32d ("drm/xe/gsc: add Battlemage support")
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
Cc: Alexander Usyskin <alexander.usyskin@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://lore.kernel.org/r/20250729123437.5933-1-lukasz.laguna@intel.com
(cherry picked from commit 552dbba1caaf0cb40ce961806d757615e26ec668)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
12 days agoMerge tag 'drm-misc-next-fixes-2025-07-24' of https://gitlab.freedesktop.org/drm...
Dave Airlie [Tue, 29 Jul 2025 06:52:49 +0000 (16:52 +1000)] 
Merge tag 'drm-misc-next-fixes-2025-07-24' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next

Two more bridge conversions to devm_drm_bridge_alloc that address a
warning now reported by the bridge core code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maxime Ripard <mripard@redhat.com>
Link: https://lore.kernel.org/r/20250724-petite-gray-foxhound-b4fbb8@houat
13 days agodrm/amdgpu: update mmhub 4.1.0 client id mappings
Alex Deucher [Fri, 18 Jul 2025 19:53:54 +0000 (15:53 -0400)] 
drm/amdgpu: update mmhub 4.1.0 client id mappings

Update the client id mapping so the correct clients
get printed when there is a mmhub page fault.

Tested-by: David (Ming Qiang) Wu <David.Wu3@amd.com>
Reviewed-by: David (Ming Qiang) Wu <David.Wu3@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
13 days agodrm/amd/display: Allow DCN301 to clear update flags
Ivan Lipski [Thu, 17 Jul 2025 17:58:35 +0000 (13:58 -0400)] 
drm/amd/display: Allow DCN301 to clear update flags

[Why & How]
Not letting DCN301 to clear after surface/stream update results
in artifacts when switching between active overlay planes. The issue
is known and has been solved initially. See below:
(https://gitlab.freedesktop.org/drm/amd/-/issues/3441)

Fixes: f354556e29f4 ("drm/amd/display: limit clear_update_flags t dcn32 and above")
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
13 days agodrm/amd/display: Pass up errors for reset GPU that fails to init HW
Mario Limonciello [Thu, 15 May 2025 20:16:17 +0000 (15:16 -0500)] 
drm/amd/display: Pass up errors for reset GPU that fails to init HW

[Why]
If a GPU is in reset and the hardware fails to initialize the rest of the
resume sequence shouldn't be run.

[How]
Pass error code up to caller of dm_resume().

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
13 days agodrm/amd/display: Only finalize atomic_obj if it was initialized
Mario Limonciello [Tue, 15 Jul 2025 19:41:46 +0000 (14:41 -0500)] 
drm/amd/display: Only finalize atomic_obj if it was initialized

[Why]
If amdgpu_dm failed to initalize before amdgpu_dm_initialize_drm_device()
completed then freeing atomic_obj will lead to list corruption.

[How]
Check if atomic_obj state is initialized before trying to free.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
13 days agodrm/amd/display: Avoid configuring PSR granularity if PSR-SU not supported
Mario Limonciello [Sun, 6 Jul 2025 13:38:05 +0000 (08:38 -0500)] 
drm/amd/display: Avoid configuring PSR granularity if PSR-SU not supported

[Why]
If PSR-SU is disabled on the link, then configuring su_y granularity in
mod_power_calc_psr_configs() can lead to assertions in
psr_su_set_dsc_slice_height().

[How]
Check the PSR version in amdgpu_dm_link_setup_psr() to determine whether
or not to configure granularity.

Reviewed-by: Sun peng (Leo) Li <sunpeng.li@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
13 days agodrm/amd/display: Disable dsc_power_gate for dcn314 by default
Roman Li [Mon, 14 Jul 2025 18:37:33 +0000 (14:37 -0400)] 
drm/amd/display: Disable dsc_power_gate for dcn314 by default

[Why]
"REG_WAIT timeout 1us * 1000 tries - dcn314_dsc_pg_control line"
warnings seen after resuming from s2idle.
DCN314 has issues with DSC power gating that cause REG_WAIT timeouts
when attempting to power down DSC blocks.

[How]
Disable dsc_power_gate for dcn314 by default.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Roman Li <Roman.Li@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
13 days agodrm/amdgpu: add kicker fws loading for gfx12/smu14/psp14
Frank Min [Wed, 4 Jun 2025 13:39:34 +0000 (21:39 +0800)] 
drm/amdgpu: add kicker fws loading for gfx12/smu14/psp14

1. Add kicker firmwares loading for gfx12/smu14/psp14
2. Register additional MODULE_FIRMWARE entries for kicker fws
   - gc_12_0_1_rlc_kicker.bin
   - gc_12_0_1_imu_kicker.bin
   - psp_14_0_3_sos_kicker.bin
   - psp_14_0_3_ta_kicker.bin
   - smu_14_0_3_kicker.bin

Signed-off-by: Frank Min <Frank.Min@amd.com>
Reviewed-by: Gui Chengming <Jack.Gui@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
13 days agodrm/amd/amdgpu: fix missing lock for cper.ring->rptr/wptr access
Yang Wang [Thu, 24 Jul 2025 07:16:18 +0000 (15:16 +0800)] 
drm/amd/amdgpu: fix missing lock for cper.ring->rptr/wptr access

Add lock protection for 'ring->wptr'/'ring->rptr' to ensure the correct execution.

Fixes: 8652920d2c00 ("drm/amdgpu: add mutex lock for cper ring")
Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
13 days agodrm/amd/display: Fix misuse of /** to /* in 'dce_i2c_hw.c'
Srinivasan Shanmugam [Mon, 21 Jul 2025 13:22:36 +0000 (18:52 +0530)] 
drm/amd/display: Fix misuse of /** to /* in 'dce_i2c_hw.c'

Fix the comment style before cntl_stuck_hw_workaround() by replacing
'/**' with '/*' since it is not a kdoc comment.

Fixes the below with gcc W=1:
display/dc/dce/dce_i2c_hw.c:380: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* If we boot without an HDMI display, the I2C engine does not get
  initialized

Fixes: 04d57f4462a6 ("drm/amd/display: Workaround for stuck I2C arbitrage")
Cc: Alvin Lee <alvin.lee2@amd.com>
Cc: Dominik Kaszewski <dominik.kaszewski@amd.com>
Cc: Ivan Lipski <ivan.lipski@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Tom Chung <chiahsuan.chung@amd.com>
Cc: Roman Li <roman.li@amd.com>
Cc: Alex Hung <alex.hung@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
13 days agodrm/amd/display: fix initial backlight brightness calculation
Lauri Tirkkonen [Mon, 21 Jul 2025 00:59:40 +0000 (09:59 +0900)] 
drm/amd/display: fix initial backlight brightness calculation

DIV_ROUND_CLOSEST(x, 100) returns either 0 or 1 if 0<x<=100, so the
division needs to be performed after the multiplication and not the
other way around, to properly scale the value.

Fixes: 8b5f3a229a70 ("drm/amd/display: Fix default DC and AC levels")
Signed-off-by: Lauri Tirkkonen <lauri@hacktheplanet.fi>
Cc: stable@vger.kernel.org
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/aH2Q_HJvxKbW74vU@hacktheplanet.fi
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
13 days agodrm/amdgpu: Avoid extra evict-restore process.
Gang Ba [Tue, 8 Jul 2025 18:36:13 +0000 (14:36 -0400)] 
drm/amdgpu: Avoid extra evict-restore process.

If vm belongs to another process, this is fclose after fork,
wait may enable signaling KFD eviction fence and cause parent process queue evicted.

[677852.634569]  amdkfd_fence_enable_signaling+0x56/0x70 [amdgpu]
[677852.634814]  __dma_fence_enable_signaling+0x3e/0xe0
[677852.634820]  dma_fence_wait_timeout+0x3a/0x140
[677852.634825]  amddma_resv_wait_timeout+0x7f/0xf0 [amdkcl]
[677852.634831]  amdgpu_vm_wait_idle+0x2d/0x60 [amdgpu]
[677852.635026]  amdgpu_flush+0x34/0x50 [amdgpu]
[677852.635208]  filp_flush+0x38/0x90
[677852.635213]  filp_close+0x14/0x30
[677852.635216]  do_close_on_exec+0xdd/0x130
[677852.635221]  begin_new_exec+0x1da/0x490
[677852.635225]  load_elf_binary+0x307/0xea0
[677852.635231]  ? srso_alias_return_thunk+0x5/0xfbef5
[677852.635235]  ? ima_bprm_check+0xa2/0xd0
[677852.635240]  search_binary_handler+0xda/0x260
[677852.635245]  exec_binprm+0x58/0x1a0
[677852.635249]  bprm_execve.part.0+0x16f/0x210
[677852.635254]  bprm_execve+0x45/0x80
[677852.635257]  do_execveat_common.isra.0+0x190/0x200

Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Gang Ba <Gang.Ba@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
13 days agodrm/amdgpu: track whether a queue is a kernel queue in amdgpu_mqd_prop
Alex Deucher [Tue, 24 Jun 2025 15:22:26 +0000 (11:22 -0400)] 
drm/amdgpu: track whether a queue is a kernel queue in amdgpu_mqd_prop

Used to to set the MQD appropriately for each queue type.
Kernel queues have additional privileges.

Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.16.x
13 days agodrm/amdgpu: check if hubbub is NULL in debugfs/amdgpu_dm_capabilities
Peter Shkenev [Thu, 17 Jul 2025 20:48:17 +0000 (23:48 +0300)] 
drm/amdgpu: check if hubbub is NULL in debugfs/amdgpu_dm_capabilities

HUBBUB structure is not initialized on DCE hardware, so check if it is NULL
to avoid null dereference while accessing amdgpu_dm_capabilities file in
debugfs.

Signed-off-by: Peter Shkenev <mustela@erminea.space>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
13 days agodrm/amdgpu: Initialize data to NULL in imu_v12_0_program_rlc_ram()
Nathan Chancellor [Tue, 15 Jul 2025 23:50:22 +0000 (16:50 -0700)] 
drm/amdgpu: Initialize data to NULL in imu_v12_0_program_rlc_ram()

After a recent change in clang to expose uninitialized warnings from
const variables and pointers [1], there is a warning in
imu_v12_0_program_rlc_ram() because data is passed uninitialized to
program_imu_rlc_ram():

  drivers/gpu/drm/amd/amdgpu/imu_v12_0.c:374:30: error: variable 'data' is uninitialized when used here [-Werror,-Wuninitialized]
    374 |                         program_imu_rlc_ram(adev, data, (const u32)size);
        |                                                   ^~~~

As this warning happens early in clang's frontend, it does not realize
that due to the assignment of r to -EINVAL, program_imu_rlc_ram() is
never actually called, and even if it were, data would not be
dereferenced because size is 0.

Just initialize data to NULL to silence the warning, as the commit that
added program_imu_rlc_ram() mentioned it would eventually be used over
the old method, at which point data can be properly initialized and
used.

Cc: stable@vger.kernel.org
Closes: https://github.com/ClangBuiltLinux/linux/issues/2107
Fixes: 56159fffaab5 ("drm/amdgpu: use new method to program rlc ram")
Link: https://github.com/llvm/llvm-project/commit/2464313eef01c5b1edf0eccf57a32cdee01472c7
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
13 days agodrm/amd/display: Fix divide by zero when calculating min ODM factor
Dillon Varone [Fri, 11 Jul 2025 00:57:37 +0000 (20:57 -0400)] 
drm/amd/display: Fix divide by zero when calculating min ODM factor

[WHY&HOW]
If the debug option is set to disable_dsc the max slice width and/or
dispclk can be zero. This causes a divide by zero when calculating the
min ODM combine factor. Add a check to ensure they are valid first.

Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
13 days agodrm/xe/configfs: Fix pci_dev reference leak
Michal Wajdeczko [Tue, 22 Jul 2025 14:10:54 +0000 (16:10 +0200)] 
drm/xe/configfs: Fix pci_dev reference leak

We are using pci_get_domain_bus_and_slot() function to verify if
the given config directory name matches any existing PCI device,
but we missed to call matching pci_dev_put() to release reference.

While around, also change error code in case of no device match,
to make it more specific than generic formatting error.

Fixes: 16280ded45fb ("drm/xe: Add configfs to enable survivability mode")
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://lore.kernel.org/r/20250722141059.30707-2-michal.wajdeczko@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
(cherry picked from commit 0bdd05c2a82bbf2419415d012fd4f5faeca7f1af)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
13 days agodrm/xe/hw_engine_group: Avoid call kfree() for drmm_kzalloc()
Shuicheng Lin [Thu, 24 Jul 2025 19:38:55 +0000 (19:38 +0000)] 
drm/xe/hw_engine_group: Avoid call kfree() for drmm_kzalloc()

Memory allocated with drmm_kzalloc() should not be freed using
kfree(), as it is managed by the DRM subsystem. The memory will
be automatically freed when the associated drm_device is released.
These 3 group pointers are allocated using drmm_kzalloc() in
hw_engine_group_alloc(), so they don't require manual deallocation.

Fixes: 67979060740f ("drm/xe/hw_engine_group: Fix potential leak")
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://lore.kernel.org/r/20250724193854.1124510-2-shuicheng.lin@intel.com
(cherry picked from commit f98de826b418885a21ece67f0f5b921ae759b7bf)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
13 days agodrm/xe/guc: Clear whole g2h_fence during initialization
Michal Wajdeczko [Wed, 23 Jul 2025 17:56:39 +0000 (19:56 +0200)] 
drm/xe/guc: Clear whole g2h_fence during initialization

The struct g2h_fence must be explicitly initializated using the
g2h_fence_init() function to avoid trash values in its members,
but we missed to update this helper function with the new member.

To fix that and avoid any future mistakes, memset the whole struct
first, then update remaining non-zero members.

Fixes: 94de94d24ea8 ("drm/xe/guc: Cancel ongoing H2G requests when stopping CT")
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://lore.kernel.org/r/20250723175639.206875-1-michal.wajdeczko@intel.com
(cherry picked from commit 159afd92bae8153bdd8d8b34aea0d463fe19c978)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
13 days agodrm/xe/vf: Don't register I2C devices if VF
Lukasz Laguna [Thu, 17 Jul 2025 15:54:20 +0000 (17:54 +0200)] 
drm/xe/vf: Don't register I2C devices if VF

VF drivers can't access I2C devices, so skip their registration when
running as VF.

Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
Fixes: f0e53aadd702 ("drm/xe: Support for I2C attached MCUs")
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20250717155420.25298-1-lukasz.laguna@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit 9a220e065914b67b55d3d0ab91c3e215742fdd73)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
13 days agodrm/xe/uc: Fix missing unwind goto
Zhanjun Dong [Mon, 21 Jul 2025 21:45:20 +0000 (17:45 -0400)] 
drm/xe/uc: Fix missing unwind goto

Fix missing unwind goto on error handling.

Fixes: b2c4ac219fa4 ("drm/xe/uc: Disable GuC communication on hardware initialization error")
Signed-off-by: Zhanjun Dong <zhanjun.dong@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://lore.kernel.org/r/20250721214520.954014-1-zhanjun.dong@intel.com
(cherry picked from commit 176f44a5ec0b074aaf44852db77d0c183c36696d)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
13 days agodrm/xe: Fix a NULL vs IS_ERR() bug in xe_i2c_register_adapter()
Dan Carpenter [Tue, 15 Jul 2025 22:59:44 +0000 (17:59 -0500)] 
drm/xe: Fix a NULL vs IS_ERR() bug in xe_i2c_register_adapter()

The fwnode_create_software_node() function returns error pointers.  It
never returns NULL.  Update the checks to match.

Fixes: f0e53aadd702 ("drm/xe: Support for I2C attached MCUs")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/65825d00-81ab-4665-af51-4fff6786a250@sabinyo.mountain
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit 2f264d58cc805a3cefc6b98097f90fbc388136ef)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
13 days agodrm/xe/oa: Fix static checker warning about null gt
Ashutosh Dixit [Tue, 15 Jul 2025 18:14:22 +0000 (11:14 -0700)] 
drm/xe/oa: Fix static checker warning about null gt

There is a static checker warning that gt returned by xe_device_get_gt can
be NULL and that is being dereferenced. Use xe_root_mmio_gt instead, which
is equivalent and cannot return a NULL gt 0.

Fixes: 10d42ef34bce ("drm/xe/oa: Assign hwe for OAM_SAG")
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Link: https://lore.kernel.org/r/20250715181422.2807624-1-ashutosh.dixit@intel.com
(cherry picked from commit 308dc9b27874d0e8a0258869b9e681b0fdd2e579)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
13 days agodrm/xe: Don't fail probe on unsupported mailbox command
Raag Jadav [Mon, 14 Jul 2025 21:55:03 +0000 (03:25 +0530)] 
drm/xe: Don't fail probe on unsupported mailbox command

If the device is running older pcode firmware, it is possible that newer
mailbox commands are not supported by it. The sysfs attributes aren't
useful in that case, but we shouldn't fail driver probe because of it.
As of now, it is unknown if we can distinguish unsupported commands before
attempting them. But until we figure out a way to do that, fix the
regressions.

v2: Add debug message (Lucas)

Fixes: cdc36b66cd41 ("drm/xe: Expose fan control and voltage regulator version")
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Tested-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://lore.kernel.org/r/20250714215503.2897748-1-raag.jadav@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit ed5461daa150b037e36b8202381da1ef85d6b16b)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2 weeks agoMerge tag 'nova-next-v6.17-2025-07-18' of https://gitlab.freedesktop.org/drm/nova...
Dave Airlie [Mon, 21 Jul 2025 02:56:15 +0000 (12:56 +1000)] 
Merge tag 'nova-next-v6.17-2025-07-18' of https://gitlab.freedesktop.org/drm/nova into drm-next

Nova changes for v6.17

DMA:

  - Merge topic/dma-features-2025-06-23 from alloc tree.

    - Clarify wording and be consistent in 'coherent' nomenclature.

    - Convert the read!() / write!() macros to return a Result.

    - Add as_slice() / write() methods in CoherentAllocation.

    - Fix doc-comment of dma_handle().

    - Expose count() and size() in CoherentAllocation and add the
      corresponding type invariants.

    - Implement CoherentAllocation::dma_handle_with_offset().

nova-core:

  - Various register!() macro improvements.

  - Custom Sleep / Delay helpers (until the actual abstractions land).

  - Add DMA object abstraction.

  - VBIOS

    - Image parser / iterator.

    - PMU table look up in FWSEC.

    - FWSEC ucode extraction.

  - Register sysmem flush page.

  - Falcon

    - Generic falcon boot code and HAL (Ampere).

    - GSP / SEC2 specific code.

  - FWSEC-FRTS

    - Compute layout of FRTS region (FbLayout and HAL).

    - Load into GSP falcon and execute.

  - Add Documentation for VBIOS layout, Devinit process, Fwsec operation
    and layout, Falcon basics.

  - Update and annotate TODO list.

  - Add Alexandre Courbot as co-maintainer.

Rust:

  - Make ETIMEDOUT error available.

  - Add size constants up to SZ_2G.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: "Danilo Krummrich" <dakr@kernel.org>
Link: https://lore.kernel.org/r/DBFKLDMUGZD9.Z93GN2N5B0FI@kernel.org
2 weeks agoMerge tag 'amd-drm-next-6.17-2025-07-17' of https://gitlab.freedesktop.org/agd5f...
Dave Airlie [Mon, 21 Jul 2025 01:57:43 +0000 (11:57 +1000)] 
Merge tag 'amd-drm-next-6.17-2025-07-17' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.17-2025-07-17:

amdgpu:
- Partition fixes
- Reset fixes
- RAS fixes
- i2c fix
- MPC updates
- DSC cleanup
- EDID fixes
- Display idle D3 update
- IPS updates
- DMUB updates
- Retimer fix
- Replay fixes
- Fix DC memory leak
- Initial support for smartmux
- DCN 4.0.1 degamma LUT fix
- Per queue reset cleanups
- Track ring state associated with a fence
- SR-IOV fixes
- SMU fixes
- Per queue reset improvements for GC 9+ compute
- Per queue reset improvements for GC 10+ gfx
- Per queue reset improvements for SDMA 5+
- Per queue reset improvements for JPEG 2+
- Per queue reset improvements for VCN 2+
- GC 8 fix
- ISP updates

amdkfd:
- Enable KFD on LoongArch

radeon:
- Drop console lock during suspend/resume

UAPI:
- Add userq slot info to INFO IOCTL
  Used for IGT userq validation tests (https://lists.freedesktop.org/archives/igt-dev/2025-July/093228.html)

From: Alex Deucher <alexander.deucher@amd.com>
Link: https://lore.kernel.org/r/20250717213827.2061581-1-alexander.deucher@amd.com
Signed-off-by: Dave Airlie <airlied@redhat.com>
3 weeks agoMerge tag 'drm-misc-next-2025-07-17' of https://gitlab.freedesktop.org/drm/misc/kerne...
Dave Airlie [Sun, 20 Jul 2025 23:13:15 +0000 (09:13 +1000)] 
Merge tag 'drm-misc-next-2025-07-17' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next

drm-misc-next for 6.17:

UAPI Changes:

Cross-subsystem Changes:

Core Changes:

- mode_config: Change fb_create prototype to pass the drm_format_info
  and avoid redundant lookups in drivers
- sched: kunit improvements, memory leak fixes, reset handling
  improvements
- tests: kunit EDID update

Driver Changes:

- amdgpu: Hibernation fixes, structure lifetime fixes
- nouveau: sched improvements
- sitronix: Add Sitronix ST7567 Support

- bridge:
  - Make connector available to bridge detect hook

- panel:
  - More refcounting changes
  - New panels: BOE NE14QDM

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maxime Ripard <mripard@redhat.com>
Link: https://lore.kernel.org/r/20250717-efficient-kudu-of-fantasy-ff95e0@houat
3 weeks agodrm/tidss: oldi: convert to devm_drm_bridge_alloc() API
Jayesh Choudhary [Mon, 14 Jul 2025 10:45:54 +0000 (16:15 +0530)] 
drm/tidss: oldi: convert to devm_drm_bridge_alloc() API

DRM bridges now use "devm_drm_bridge_alloc()" for allocation and
initialization. "devm_kzalloc()" is not allowed anymore and it results
in WARNING. So convert it.

Fixes: 7246e0929945 ("drm/tidss: Add OLDI bridge support")
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
Link: https://lore.kernel.org/r/20250714104554.13441-1-j-choudhary@ti.com
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
3 weeks agodrm/tidss: encoder: convert to devm_drm_bridge_alloc()
Michael Walle [Wed, 16 Jul 2025 13:41:07 +0000 (15:41 +0200)] 
drm/tidss: encoder: convert to devm_drm_bridge_alloc()

Convert the tidss encoder to use devm_drm_bridge_alloc(). Instead of
allocating the memory by drmm_simple_encoder_alloc() use
devm_drm_bridge_alloc() and initialize the encoder afterwards.

Fixes: a7748dd127ea ("drm/bridge: get/put the bridge reference in drm_bridge_add/remove()")
Signed-off-by: Michael Walle <mwalle@kernel.org>
Link: https://lore.kernel.org/r/20250716134107.4084945-1-mwalle@kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
3 weeks agoMerge tag 'drm-xe-next-2025-07-15' of https://gitlab.freedesktop.org/drm/xe/kernel...
Dave Airlie [Fri, 18 Jul 2025 09:48:13 +0000 (19:48 +1000)] 
Merge tag 'drm-xe-next-2025-07-15' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next

Driver Changes:
 - Create and use XE_DEVICE_WA infrastructure (Atwood)
 - SRIOV: Mark BMG as SR-IOV capable (Michal)
 - Dont skip TLB invalidations on VF (Tejas)
 - Fix migration copy direction in access_memory (Auld)
 - General code clean-up (Lucas, Brost, Dr. David, Xin)
 - More missing XeLP workarounds (Tvrtko)
 - SRIOV: Relax VF/PF version negotiation (Michal)
 - SRIOV: LMTT invalidation (Michal)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/aHacDvF9IaVHI61C@intel.com
3 weeks agodrm/amdgpu: move reset support type checks into the caller
Alex Deucher [Tue, 15 Jul 2025 15:55:05 +0000 (11:55 -0400)] 
drm/amdgpu: move reset support type checks into the caller

Rather than checking in the callbacks, check if the reset
type is supported in the caller.

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/sdma7: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 29 May 2025 17:12:35 +0000 (13:12 -0400)] 
drm/amdgpu/sdma7: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/sdma6: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 29 May 2025 17:11:54 +0000 (13:11 -0400)] 
drm/amdgpu/sdma6: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/sdma5.2: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 26 Jun 2025 13:53:18 +0000 (09:53 -0400)] 
drm/amdgpu/sdma5.2: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/sdma5: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 26 Jun 2025 13:52:55 +0000 (09:52 -0400)] 
drm/amdgpu/sdma5: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/gfx12: re-emit unprocessed state on ring reset
Alex Deucher [Wed, 28 May 2025 02:29:31 +0000 (22:29 -0400)] 
drm/amdgpu/gfx12: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.
Drop the soft_recovery callbacks as the queue reset replaces
it.

Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/gfx11: re-emit unprocessed state on ring reset
Alex Deucher [Wed, 28 May 2025 02:05:13 +0000 (22:05 -0400)] 
drm/amdgpu/gfx11: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.
Drop the soft_recovery callbacks as the queue reset replaces
it.

Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/gfx10: re-emit unprocessed state on ring reset
Alex Deucher [Fri, 23 May 2025 04:33:04 +0000 (00:33 -0400)] 
drm/amdgpu/gfx10: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.
Drop the soft_recovery callbacks as the queue reset replaces
it.

Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/gfx9.4.3: re-emit unprocessed state on kcq reset
Alex Deucher [Wed, 28 May 2025 03:23:53 +0000 (23:23 -0400)] 
drm/amdgpu/gfx9.4.3: re-emit unprocessed state on kcq reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/gfx9: re-emit unprocessed state on kcq reset
Alex Deucher [Wed, 28 May 2025 03:19:29 +0000 (23:19 -0400)] 
drm/amdgpu/gfx9: re-emit unprocessed state on kcq reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu: Add WARN_ON to the resource clear function
Arunpravin Paneer Selvam [Wed, 16 Jul 2025 07:51:23 +0000 (13:21 +0530)] 
drm/amdgpu: Add WARN_ON to the resource clear function

Set the dirty bit when the memory resource is not cleared
during BO release.

v2(Christian):
  - Drop the cleared flag set to false.
  - Improve the amdgpu_vram_mgr_set_clear_state() function.

v3:
  - Add back the resource clear flag set function call after
    being cleared during eviction (Christian).
  - Modified the patch subject name.

Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amd/pm: Use cached metrics data on SMUv13.0.6
Lijo Lazar [Fri, 11 Jul 2025 06:39:06 +0000 (12:09 +0530)] 
drm/amd/pm: Use cached metrics data on SMUv13.0.6

Cached metrics data validity is 1ms on SMUv13.0.6 SOCs. It's not
reasonable for any client to query gpu_metrics at a faster rate and
constantly interrupt PMFW.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amd/pm: Use cached data for min/max clocks
Lijo Lazar [Fri, 11 Jul 2025 16:18:33 +0000 (21:48 +0530)] 
drm/amd/pm: Use cached data for min/max clocks

If dpm tables are already populated on SMU v13.0.6 SOCs, use the cached
data. Otherwise, fetch values from firmware.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agogpu: nova-core: fix bounds check in PmuLookupTableEntry::new
Rhys Lloyd [Sun, 13 Jul 2025 02:51:08 +0000 (19:51 -0700)] 
gpu: nova-core: fix bounds check in PmuLookupTableEntry::new

data is sliced from 2..6, but the bounds check data.len() < 5
does not satisfy those bounds.

Fixes: 47c4846e4319 ("gpu: nova-core: vbios: Add support for FWSEC ucode extraction")
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Rhys Lloyd <krakow20@gmail.com>
Link: https://lore.kernel.org/r/20250713025108.9364-2-krakow20@gmail.com
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
3 weeks agodrm/amdgpu: Replace HQD terminology with slots naming
Jesse Zhang [Fri, 4 Jul 2025 07:17:43 +0000 (15:17 +0800)] 
drm/amdgpu: Replace HQD terminology with slots naming

The term "HQD" is CP-specific and doesn't
accurately describe the queue resources for other IP blocks like SDMA,
VCN, or VPE. This change:

1. Renames `num_hqds` to `num_slots` in amdgpu_kms.c to better reflect
   the generic nature of the resource counting
2. Updates the UAPI struct member from `userq_num_hqds` to `userq_num_slots`
3. Maintains the same functionality while using more appropriate terminology

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu: Add user queue instance count in HW IP info
Jesse Zhang [Wed, 25 Jun 2025 07:29:45 +0000 (15:29 +0800)] 
drm/amdgpu: Add user queue instance count in HW IP info

This change exposes the number of available user queue instances
for each hardware IP type (GFX, COMPUTE, SDMA) through the
drm_amdgpu_info_hw_ip interface.

Key changes:
1. Added userq_num_instance field to drm_amdgpu_info_hw_ip structure
2. Implemented counting of available HQD slots using:
   - mes.gfx_hqd_mask for GFX queues
   - mes.compute_hqd_mask for COMPUTE queues
   - mes.sdma_hqd_mask for SDMA queues
3. Only counts available instances when user queues are enabled
   (!disable_uq)

v2: using the adev->mes.gfx_hqd_mask[]/compute_hqd_mask[]/sdma_hqd_mask[] masks
  to determine the number of queue slots available for each engine type (Alex)
v3: rename userq_num_instance to userq_num_hqds (Alex)

Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amd/amdgpu: Add helper functions for isp buffers
Pratap Nirujogi [Mon, 23 Jun 2025 22:44:50 +0000 (18:44 -0400)] 
drm/amd/amdgpu: Add helper functions for isp buffers

Accessing amdgpu internal data structures "struct amdgpu_device"
and "struct amdgpu_bo" in ISP V4L2 driver to alloc/free GART
buffers is not recommended.

Add new amdgpu_isp helper functions that takes opaque params
from ISP V4L2 driver and calls the amdgpu internal functions
amdgpu_bo_create_isp_user() and amdgpu_bo_create_kernel() to
alloc/free GART buffers.

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>
3 weeks agodrm/amd/amdgpu: Initialize swnode for ISP MFD device
Pratap Nirujogi [Tue, 24 Jun 2025 23:15:00 +0000 (19:15 -0400)] 
drm/amd/amdgpu: Initialize swnode for ISP MFD device

Create amd_isp_capture MFD device with swnode initialized to
isp specific software_node part of fwnode graph in amd_isp4
x86/platform driver. The isp driver use this swnode handle
to retrieve the critical properties (data-lanes, mipi phyid,
link-frequencies etc.) required for camera to work on AMD ISP4
based targets.

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>
3 weeks agodrm/amdgpu/gfx8: reset compute ring wptr on the GPU on resume
Eeli Haapalainen [Mon, 14 Jul 2025 05:13:09 +0000 (08:13 +0300)] 
drm/amdgpu/gfx8: reset compute ring wptr on the GPU on resume

Commit 42cdf6f687da ("drm/amdgpu/gfx8: always restore kcq MQDs") made the
ring pointer always to be reset on resume from suspend. This caused compute
rings to fail since the reset was done without also resetting it for the
firmware. Reset wptr on the GPU to avoid a disconnect between the driver
and firmware wptr.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3911
Fixes: 42cdf6f687da ("drm/amdgpu/gfx8: always restore kcq MQDs")
Signed-off-by: Eeli Haapalainen <eeli.haapalainen@protonmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amd/pm: fix null pointer access
Umio Yasuno [Tue, 15 Jul 2025 14:44:35 +0000 (14:44 +0000)] 
drm/amd/pm: fix null pointer access

Writing a string without delimiters (' ', '\n', '\0') to the under
gpu_od/fan_ctrl sysfs or pp_power_profile_mode for the CUSTOM profile
will result in a null pointer dereference.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4401
Signed-off-by: Umio Yasuno <coelacanth_dream@protonmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/jpeg: clean up reset type handling
Alex Deucher [Tue, 15 Jul 2025 15:37:56 +0000 (11:37 -0400)] 
drm/amdgpu/jpeg: clean up reset type handling

Make the handling consistent with other IPs and across
JPEG versions.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu: rework gmc_v9_0_get_coherence_flags v2
Christian König [Thu, 5 Jun 2025 12:17:09 +0000 (14:17 +0200)] 
drm/amdgpu: rework gmc_v9_0_get_coherence_flags v2

Avoid using the mapping here.

v2: use amdgpu_xgmi_same_hive() as suggested by Felix

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/vcn3: implement ring reset
Alex Deucher [Mon, 16 Jun 2025 21:15:27 +0000 (17:15 -0400)] 
drm/amdgpu/vcn3: implement ring reset

Use the new helpers to handle engine resets for VCN.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/vcn2.5: implement ring reset
Alex Deucher [Mon, 16 Jun 2025 21:07:22 +0000 (17:07 -0400)] 
drm/amdgpu/vcn2.5: implement ring reset

Use the new helpers to handle engine resets for VCN.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/vcn2: implement ring reset
Alex Deucher [Mon, 16 Jun 2025 20:37:34 +0000 (16:37 -0400)] 
drm/amdgpu/vcn2: implement ring reset

Use the new helpers to handle engine resets for VCN.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/vcn: add a helper framework for engine resets
Alex Deucher [Mon, 16 Jun 2025 20:01:25 +0000 (16:01 -0400)] 
drm/amdgpu/vcn: add a helper framework for engine resets

With engine resets we reset all queues on the engine rather
than just a single queue.  Add a framework to handle this
similar to SDMA.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/vcn5: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 29 May 2025 19:26:37 +0000 (15:26 -0400)] 
drm/amdgpu/vcn5: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/vcn4.0.5: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 29 May 2025 19:26:08 +0000 (15:26 -0400)] 
drm/amdgpu/vcn4.0.5: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/vcn4.0.3: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 29 May 2025 19:25:52 +0000 (15:25 -0400)] 
drm/amdgpu/vcn4.0.3: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/vcn4: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 29 May 2025 19:25:05 +0000 (15:25 -0400)] 
drm/amdgpu/vcn4: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/jpeg5.0.1: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 29 May 2025 19:24:11 +0000 (15:24 -0400)] 
drm/amdgpu/jpeg5.0.1: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/jpeg5: add queue reset
Alex Deucher [Thu, 29 May 2025 17:05:35 +0000 (13:05 -0400)] 
drm/amdgpu/jpeg5: add queue reset

Add queue reset support for jpeg 5.0.0.
Use the new helpers to re-emit the unprocessed state
after resetting the queue.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/jpeg4.0.5: add queue reset
Alex Deucher [Thu, 5 Jun 2025 22:11:11 +0000 (18:11 -0400)] 
drm/amdgpu/jpeg4.0.5: add queue reset

Add queue reset support for jpeg 4.0.5.
Use the new helpers to re-emit the unprocessed state
after resetting the queue.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/jpeg4.0.3: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 29 May 2025 19:22:52 +0000 (15:22 -0400)] 
drm/amdgpu/jpeg4.0.3: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/jpeg4: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 29 May 2025 19:22:36 +0000 (15:22 -0400)] 
drm/amdgpu/jpeg4: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/jpeg3: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 29 May 2025 19:22:20 +0000 (15:22 -0400)] 
drm/amdgpu/jpeg3: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/jpeg2.5: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 29 May 2025 19:22:01 +0000 (15:22 -0400)] 
drm/amdgpu/jpeg2.5: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/jpeg2: re-emit unprocessed state on ring reset
Alex Deucher [Thu, 29 May 2025 19:21:46 +0000 (15:21 -0400)] 
drm/amdgpu/jpeg2: re-emit unprocessed state on ring reset

Re-emit the unprocessed state after resetting the queue.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amd/pm: Remove unnecessary variable
Asad Kamal [Tue, 15 Jul 2025 05:40:43 +0000 (13:40 +0800)] 
drm/amd/pm: Remove unnecessary variable

Remove unnecessary variable ret from smu_v13_0_12_get_smu_metrics_data

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507150618.WOfvWsQF-lkp@intel.com
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>
3 weeks agodrm/amdgpu: Increase reset counter only on success
Lijo Lazar [Mon, 14 Jul 2025 05:07:00 +0000 (10:37 +0530)] 
drm/amdgpu: Increase reset counter only on success

Increment the reset counter only if soft recovery succeeded. This is
consistent with a ring hard reset behaviour where counter gets
incremented only if hard reset succeeded.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amd/pm: Get max/min frequency on aldebaran VF
Lijo Lazar [Sat, 12 Jul 2025 06:40:48 +0000 (12:10 +0530)] 
drm/amd/pm: Get max/min frequency on aldebaran VF

PMFW interface to get max/min frequencies is not available on aldebaran
VFs. Use data, if available, in DPM tables to get the max/min
frequencies.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu: make compute timeouts consistent
Alex Deucher [Wed, 18 Jun 2025 13:49:05 +0000 (09:49 -0400)] 
drm/amdgpu: make compute timeouts consistent

For kernel compute queues, align the timeout with
other kernel queues (10 sec).  This had previously
been set higher for OpenCL when it used kernel
queues, but now OpenCL uses KFD user queues which
don't have a timeout limitation. This also aligns
with SR-IOV which already used a shorter timeout.

Additionally the longer timeout negatively impacts
the user experience with kernel queues for interactive
applications.

Reviewed-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu: Check SQ_CONFIG register support on SRIOV
Tony Yi [Mon, 9 Jun 2025 19:09:28 +0000 (14:09 -0500)] 
drm/amdgpu: Check SQ_CONFIG register support on SRIOV

On SRIOV environments, check if RLCG supports
SQ_CONFIG register programming.

Signed-off-by: Tony Yi <Tony.Yi@amd.com>
Reviewed-by: Zhigang Luo <zhigang.luo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu: track ring state associated with a fence
Alex Deucher [Wed, 28 May 2025 01:35:00 +0000 (21:35 -0400)] 
drm/amdgpu: track ring state associated with a fence

We need to know the wptr and sequence number associated
with a fence so that we can re-emit the unprocessed state
after a ring reset.  Pre-allocate storage space for
the ring buffer contents and add helpers to save off
and re-emit the unprocessed state so that it can be
re-emitted after the queue is reset.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu: clean up GC reset functions
Alex Deucher [Fri, 11 Jul 2025 18:01:42 +0000 (14:01 -0400)] 
drm/amdgpu: clean up GC reset functions

Make them consistent and use the reset flags.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu: clean up jpeg reset functions
Alex Deucher [Fri, 11 Jul 2025 17:31:14 +0000 (13:31 -0400)] 
drm/amdgpu: clean up jpeg reset functions

Make them consistent and use the reset flags.

Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/vcn: don't enable per queue resets on SR-IOV
Alex Deucher [Fri, 11 Jul 2025 17:21:46 +0000 (13:21 -0400)] 
drm/amdgpu/vcn: don't enable per queue resets on SR-IOV

Power control is only available in bare metal.  SR-IOV
will need a different method.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 weeks agodrm/amdgpu/jpeg4: add additional ring reset error checking
Alex Deucher [Mon, 7 Jul 2025 15:00:24 +0000 (11:00 -0400)] 
drm/amdgpu/jpeg4: add additional ring reset error checking

Start and stop can fail, so add checks.

Fixes: 74894ffc7d0c ("drm/amdgpu: Add ring reset callback for JPEG4_0_0")
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Sathishkumar S <sathishkumar.sundararaju@amd.com>
3 weeks agodrm/amdgpu/jpeg3: add additional ring reset error checking
Alex Deucher [Mon, 7 Jul 2025 14:56:07 +0000 (10:56 -0400)] 
drm/amdgpu/jpeg3: add additional ring reset error checking

Start and stop can fail, so add checks.

Fixes: 03399d0bff25 ("drm/amdgpu: Add ring reset callback for JPEG3_0_0")
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Sathishkumar S <sathishkumar.sundararaju@amd.com>
3 weeks agodrm/amdgpu/jpeg2: add additional ring reset error checking
Alex Deucher [Mon, 7 Jul 2025 14:52:49 +0000 (10:52 -0400)] 
drm/amdgpu/jpeg2: add additional ring reset error checking

Start and stop can fail, so add checks.

Fixes: 500c04d2a708 ("drm/amdgpu: Add ring reset callback for JPEG2_0_0")
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Sathishkumar S <sathishkumar.sundararaju@amd.com>