]> git.ipfire.org Git - thirdparty/linux.git/log
thirdparty/linux.git
2 months agodrm/amdgpu: cancel gfx idle work in device suspend for s0ix
Alex Deucher [Sun, 6 Apr 2025 21:27:24 +0000 (17:27 -0400)] 
drm/amdgpu: cancel gfx idle work in device suspend for s0ix

This is normally handled in the gfx IP suspend callbacks, but
for S0ix, those are skipped because we don't want to touch
gfx.  So handle it in device suspend.

Fixes: b9467983b774 ("drm/amdgpu: add dynamic workload profile switching for gfx10")
Fixes: 963537ca2325 ("drm/amdgpu: add dynamic workload profile switching for gfx11")
Fixes: 5f95a1549555 ("drm/amdgpu: add dynamic workload profile switching for gfx12")
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: pause the workload setting in dm
Kenneth Feng [Fri, 28 Mar 2025 02:34:57 +0000 (10:34 +0800)] 
drm/amd/display: pause the workload setting in dm

Pause the workload setting in dm when doing idle optimization

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/pm/swsmu: implement pause workload profile
Alex Deucher [Wed, 26 Mar 2025 14:54:56 +0000 (10:54 -0400)] 
drm/amdgpu/pm/swsmu: implement pause workload profile

Add the callback for implementation for swsmu.

Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/pm: add workload profile pause helper
Alex Deucher [Wed, 26 Mar 2025 14:26:25 +0000 (10:26 -0400)] 
drm/amdgpu/pm: add workload profile pause helper

To be used for display idle optimizations when
we want to pause non-default profiles.

Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx12: dump full CP packet header FIFOs
Alex Deucher [Thu, 20 Mar 2025 15:58:42 +0000 (11:58 -0400)] 
drm/amdgpu/gfx12: dump full CP packet header FIFOs

In dev core dump, dump the full header fifo for
each queue. Each FIFO has 8 entries.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx11: dump full CP packet header FIFOs
Alex Deucher [Thu, 20 Mar 2025 15:48:26 +0000 (11:48 -0400)] 
drm/amdgpu/gfx11: dump full CP packet header FIFOs

In dev core dump, dump the full header fifo for
each queue. Each FIFO has 8 entries.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx10: dump full CP packet header FIFOs
Alex Deucher [Thu, 20 Mar 2025 15:30:15 +0000 (11:30 -0400)] 
drm/amdgpu/gfx10: dump full CP packet header FIFOs

In dev core dump, dump the full header fifo for
each queue. Each FIFO has 8 entries.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx9.4.3: dump full CP packet header FIFOs
Alex Deucher [Thu, 20 Mar 2025 15:39:20 +0000 (11:39 -0400)] 
drm/amdgpu/gfx9.4.3: dump full CP packet header FIFOs

In dev core dump, dump the full header fifo for
each queue. Each FIFO has 8 entries.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx9: dump full CP packet header FIFOs
Alex Deucher [Thu, 13 Mar 2025 17:29:36 +0000 (13:29 -0400)] 
drm/amdgpu/gfx9: dump full CP packet header FIFOs

In dev core dump, dump the full header fifo for
each queue. Each FIFO has 8 entries.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: implement dpm vcn reset function
Ruili Ji [Mon, 24 Mar 2025 05:08:50 +0000 (01:08 -0400)] 
drm/amd/pm: implement dpm vcn reset function

Implement VCN engine reset by sending MSG_ResetVCN
on smu 13.0.6.

v2: fix format for code and message

Reviewed-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruili Ji <ruiliji2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Promote DC to 3.2.328
Taimur Hassan [Mon, 31 Mar 2025 15:13:01 +0000 (10:13 -0500)] 
drm/amd/display: Promote DC to 3.2.328

Summary:

* Optimize custom brightness curve
* Correct SSC enable detection for DCN351
* Turn off eDP lcdvdd and backlight if not required
* Use DMUB Fused IO interface for HDCP
* Extend eDP-on-DP1 quirk list

Reviewed-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@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>
2 months agodrm/amd/display: rename IPS2 entry/exit message
Sherry Wang [Fri, 28 Mar 2025 05:33:12 +0000 (13:33 +0800)] 
drm/amd/display: rename IPS2 entry/exit message

[Why&How]
Fix the confusing entry/exit message name for IPS2

Reviewed-by: Duncan Ma <duncan.ma@amd.com>
Signed-off-by: Sherry Wang <Yao.Wang1@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>
2 months agodrm/amd/display: [FW Promotion] Release 0.1.5.0
Taimur Hassan [Sun, 30 Mar 2025 19:12:35 +0000 (15:12 -0400)] 
drm/amd/display: [FW Promotion] Release 0.1.5.0

Aligning dmub_cmd header with dmu firmware release 0.1.5.0

Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Reviewed-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: turn off eDP lcdvdd and backlight if not required
Charlene Liu [Wed, 26 Mar 2025 09:11:35 +0000 (17:11 +0800)] 
drm/amd/display: turn off eDP lcdvdd and backlight if not required

[why]
A+N configuration, eDP on A-APU is off, extended display active.
Resume from s4, eDP's backlight is still on.

[how]
Turn off inactive eDP backlight and lcdvdd.

Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Charlene Liu <Charlene.Liu@amd.com>
Signed-off-by: Jing Zhou <Jing.Zhou@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>
2 months agodrm/amd/display: dont disable dtb as dto src during dpms off
Ausef Yousof [Fri, 28 Mar 2025 15:06:50 +0000 (11:06 -0400)] 
drm/amd/display: dont disable dtb as dto src during dpms off

fix was previously in 25.20 but was reverted out as it was accompanied
by other changes that caused regression.

[why&how]
Disabling dtb as the dto src during dpms off relies on in the same
instance being able to also alter the dto src bit to dpref (or not dtb
in general), but this was recently changed to only take place in
dcn31_program_pix_clk, as that is where we want to perform any dto src
changes because tg is off at that point, it is unsafe to do that
elsewhere. What this means is now instead of disabling dtb as dto src
and modifying source bit, we are left with the configuration for a given
tg that specifies dtb as dto src and dtb dto en simultaneously is unset.
dcn31_program_pix_clk can rectify this but its possible for us to
perform some tg dependant  operation that would simply hang because when
we go to enable say crtc then, the clk we specify as dto src is "off" en
bit is cleared, source bit was never changed, and program_pix_clk hasnt
been called yet (as apart of dpms on)

We cant disable it as dto src during dpms off if we want the luxury of
performing tg dependant operation during dpms off and before dpms on.

Reviewed-by: Yihan Zhu <yihan.zhu@amd.com>
Signed-off-by: Ausef Yousof <Ausef.Yousof@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>
2 months agodrm/amd/display: wait for updates to latch before locking
Ausef Yousof [Fri, 28 Mar 2025 15:06:27 +0000 (11:06 -0400)] 
drm/amd/display: wait for updates to latch before locking

[why&how]
It is possible for an update to acquire otg lock and begin programming
while the previous update has not completed and its values have not
latched. The correct way to go about this is to wait until the vupdate
pulses so we can be sure that previous updates have latched and we can
continue with the current update pipe programming, otherwise during
consecutive full updates we will have corruption flash on the screen.

The corruption flash occurs specifically on configs that require odm
combine, and its local to a specific pipe (will not flash across whole
screen). This ticket is across the otg slave, but it may also appear
across master.

Reviewed-by: Leo Chen <leo.chen@amd.com>
Signed-off-by: Ausef Yousof <Ausef.Yousof@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>
2 months agodrm/amd/display: Remove double checks for `debug.enable_mem_low_power.bits.cm`
Mario Limonciello [Wed, 4 Dec 2024 20:27:42 +0000 (14:27 -0600)] 
drm/amd/display: Remove double checks for `debug.enable_mem_low_power.bits.cm`

[Why]
A variety of the 3DLUT handling functions check
`debug.enable_mem_low_power.bits.cm` both in the caller and function.
This is unnecessary overhead.

[How]
For each of them reduce to just checking just in caller or function.

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>
2 months agodrm/amd/display: Move PSR support message into amdgpu_dm
Mario Limonciello [Wed, 26 Mar 2025 21:01:54 +0000 (16:01 -0500)] 
drm/amd/display: Move PSR support message into amdgpu_dm

[Why]
PSR support could vary from the panels connected to one GPU versus
another.

[How]
Move PSR support message into amdgpu_dm which has the scope of the
GPU and use that information.

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>
2 months agodrm/amd/display: Adjust all dev_*() messages to drm_*()
Mario Limonciello [Wed, 26 Mar 2025 20:33:03 +0000 (15:33 -0500)] 
drm/amd/display: Adjust all dev_*() messages to drm_*()

[Why]
dev_*() messages don't show that they are from a driver in drm
subsystem.

[How]
Change all dev_*() messages to drm_*() messages.

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>
2 months agodrm/amd/display: HDCP Locality check using DMUB Fused IO
Dominik Kaszewski [Thu, 27 Mar 2025 19:39:51 +0000 (20:39 +0100)] 
drm/amd/display: HDCP Locality check using DMUB Fused IO

[Why]
HDCP locality check has strict timing requirements, currently broken
due to reliance on msleep which does not guarantee accuracy.
The PR moves the write-poll-read sequence into DMUB using new generic
Fused IO interface, where the timing accuracy is greatly improved.
New flow is enabled using DCN resource capability bit (none for now),
or using a debug flag.

[How]
* Extended mod_hdcp_config with new function for requesting DMUB
to execute a sequence of fused I2C/AUX commands and synchronously
wait until an outbox reply arrives or a timeout expires.
* If the timeout expires, send an abort to DMUB.
* Update HDCP to use the DMUB for locality check if supported.
* Add DC_HDCP_LC_FORCE_FW_ENABLE and DC_HDCP_LC_ENABLE_SW_FALLBACK.
* Make the first enable new flow regardless of resource capabilities.
* Make the second enable fallback to old SW flow.
* Clean up makefile source file listings for easier updates.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Dominik Kaszewski <dominik.kaszewski@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>
2 months agodrm/amd/display: Correct SSC enable detection for DCN351
Kevin Gao [Wed, 26 Mar 2025 18:14:05 +0000 (14:14 -0400)] 
drm/amd/display: Correct SSC enable detection for DCN351

[Why]
Due to very small clock register delta between DCN35 and DCN351, clock
spread is being checked on the wrong register for DCN351, causing the
display driver to believe that DPREFCLK downspread to be disabled when
in some stacks it is enabled. This causes the clock values for audio to
be incorrect.

[How]
Both DCN351 and DCN35 use the same clk_mgr, so we modify the DCN35
function that checks for SSC enable to read CLK6 instead of CLK5 when
using DCN351. This allows us to read for DPREFCLK downspread correctly
so the clock can properly compensate when setting values.

Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Signed-off-by: Kevin Gao <kevin.gao3@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>
2 months agodrm/amd/display: Optimize custom brightness curve
Mario Limonciello [Mon, 24 Mar 2025 17:57:25 +0000 (12:57 -0500)] 
drm/amd/display: Optimize custom brightness curve

[Why]
When BIOS includes a lot of custom brightness data points, walking
the entire list can be time consuming.  This is most noticed when
dragging a power slider.  The "higher" values are "slower" to drag
around.

[How]
Move custom brightness calculation loop into a static function. Before
starting the loop check the "half way" data point to see how it compares
to the input.  If greater than the half way data point use that as the
starting point instead.

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>
2 months agodrm/amdgpu: Fix CPER error handling on VFs
Victor Skvortsov [Sun, 30 Mar 2025 18:54:06 +0000 (13:54 -0500)] 
drm/amdgpu: Fix CPER error handling on VFs

CPER read will loop infinitely if an error is encountered and
the more bit is set. Add error checks to break upon failure.

v2: added function pointer checks

Suggested-by: Tony Yi <Tony.Yi@amd.com>
Signed-off-by: Victor Skvortsov <Victor.Skvortsov@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Fix typo in DC_DEBUG_MASK kernel-doc
Dominik Kaszewski [Wed, 19 Mar 2025 11:12:43 +0000 (12:12 +0100)] 
drm/amdgpu: Fix typo in DC_DEBUG_MASK kernel-doc

Add missing colon in kernel-doc for DC_DEBUG_MASK enum.

Signed-off-by: Dominik Kaszewski <dominik.kaszewski@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Fix the comment to avoid warning
Sunil Khatri [Thu, 3 Apr 2025 07:27:09 +0000 (12:57 +0530)] 
drm/amdgpu: Fix the comment to avoid warning

Fix the below comment warning
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c:541:
warning: Function parameter or struct member 'adev'
not described in 'amdgpu_sdma_register_on_reset_callbacks'

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Fix xgmi v6.4.1 link status reporting
Lijo Lazar [Thu, 27 Mar 2025 04:04:15 +0000 (09:34 +0530)] 
drm/amdgpu: Fix xgmi v6.4.1 link status reporting

Use the right register offsets for getting link status.

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 agodrm/amd/display: Remove the redundant NULL check
Andrey Vatoropin [Wed, 2 Apr 2025 14:21:39 +0000 (14:21 +0000)] 
drm/amd/display: Remove the redundant NULL check

Static analysis shows that pointer "timing" cannot be NULL because it
points to the object "struct dc_crtc_timing".

Remove the extra NULL check. It is meaningless and harms the readability
of the code.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Add basic validation for RAS header
Lijo Lazar [Wed, 26 Mar 2025 07:58:38 +0000 (13:28 +0530)] 
drm/amdgpu: Add basic validation for RAS header

If RAS header read from EEPROM is corrupted, it could result in trying
to allocate huge memory for reading the records. Add some validation to
header fields.

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/amdkfd: Drop workaround for GC v9.4.3 revID 0
Apurv Mishra [Mon, 17 Mar 2025 18:00:38 +0000 (14:00 -0400)] 
drm/amdkfd: Drop workaround for GC v9.4.3 revID 0

Remove workaround code for the early engineering
samples GC v9.4.3 SOCs with revID 0

Reviewed-by: Amber Lin <Amber.Lin@amd.com>
Signed-off-by: Apurv Mishra <Apurv.Mishra@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: removed unused function
James Flowers [Fri, 28 Mar 2025 03:29:02 +0000 (20:29 -0700)] 
drm/amd/display: removed unused function

Removed unused function mpc401_get_3dlut_fast_load_status.

Signed-off-by: James Flowers <bold.zone2373@fastmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: huge sid.h cleanup, drop substituted defines.
Alexandre Demers [Fri, 28 Mar 2025 05:10:18 +0000 (01:10 -0400)] 
drm/amdgpu: huge sid.h cleanup, drop substituted defines.

Now that we are using the proper defines, cleanup useless old "substituted" defines.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: move si.c away from sid.h
Alexandre Demers [Fri, 28 Mar 2025 05:10:17 +0000 (01:10 -0400)] 
drm/amdgpu: move si.c away from sid.h

Replace defines by the ones added earlier to GFX6, SMU6 and DCE6

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/pm/legacy-dpm: move SI away from sid.h and si_enums.h
Alexandre Demers [Fri, 28 Mar 2025 05:10:16 +0000 (01:10 -0400)] 
drm/pm/legacy-dpm: move SI away from sid.h and si_enums.h

Replace defines for the ones under smu_6_0_d.h and smu_6_0_sh_mask.h

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: enable FW workaround for VCN 4_0_5
Boyuan Zhang [Fri, 28 Mar 2025 17:43:53 +0000 (13:43 -0400)] 
drm/amdgpu: enable FW workaround for VCN 4_0_5

Enabling VCN FW workaround for drm key injection through shared
memory for vcn 4_0_5

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Add indirect L1_TLB_CNTL reg programming for VFs
Victor Skvortsov [Thu, 27 Mar 2025 15:38:42 +0000 (11:38 -0400)] 
drm/amdgpu: Add indirect L1_TLB_CNTL reg programming for VFs

VFs on some IP versions are unable to access this register directly.

This register must be programmed before PSP ring is setup,
so use PSP VF mailbox directly. PSP will broadcast the register
value to all VF assigned instances.

Signed-off-by: Victor Skvortsov <victor.skvortsov@amd.com>
Reviewed-by: Zhigang Luo <Zhigang.luo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx12: Implement the gfx12 kgq pipe reset
Prike Liang [Fri, 13 Dec 2024 09:10:35 +0000 (17:10 +0800)] 
drm/amdgpu/gfx12: Implement the gfx12 kgq pipe reset

Implement the GFX12 kgq pipe reset, and temporarily disable
the GFX12 pipe reset until the CPFW fully support it.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: add missing SMU6 defines, shifts and masks
Alexandre Demers [Fri, 28 Mar 2025 05:10:15 +0000 (01:10 -0400)] 
drm/amdgpu: add missing SMU6 defines, shifts and masks

They will be used later when switching away from sid.h/si_enums.h.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pp: Fix potential NULL pointer dereference in atomctrl_initialize_mc_reg_table
Charles Han [Thu, 27 Mar 2025 04:04:35 +0000 (12:04 +0800)] 
drm/amd/pp: Fix potential NULL pointer dereference in atomctrl_initialize_mc_reg_table

The function atomctrl_initialize_mc_reg_table() and
atomctrl_initialize_mc_reg_table_v2_2() does not check the return
value of smu_atom_get_data_table(). If smu_atom_get_data_table()
fails to retrieve vram_info, it returns NULL which is later
dereferenced.

Fixes: b3892e2bb519 ("drm/amd/pp: Use atombios api directly in powerplay (v2)")
Fixes: 5f92b48cf62c ("drm/amd/pm: add mc register table initialization")
Signed-off-by: Charles Han <hanchunchao@inspur.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx11: Implement the GFX11 KCQ pipe reset
Prike Liang [Fri, 21 Feb 2025 12:14:31 +0000 (20:14 +0800)] 
drm/amdgpu/gfx11: Implement the GFX11 KCQ pipe reset

Implement the GFX11 compute pipe reset. As the GFX11 CPFW
still hasn't fully supported pipe reset yet, therefore
disable the KCQ pipe reset temporarily.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx11: Implement the GFX11 KGQ pipe reset
Prike Liang [Wed, 17 Jul 2024 06:58:00 +0000 (14:58 +0800)] 
drm/amdgpu/gfx11: Implement the GFX11 KGQ pipe reset

Implement the kernel graphics queue pipe reset,and the driver
will fallback to pipe reset when the queue reset fails. However,
the ME FW hasn't fully supported pipe reset yet so disable the
KGQ pipe reset temporarily.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Promote DAL to 3.2.327
Aric Cyr [Mon, 24 Mar 2025 05:40:16 +0000 (00:40 -0500)] 
drm/amd/display: Promote DAL to 3.2.327

Summary:

* Improve vrr for replay and psr
* Rewrite drm debug message
* Fix clock issues for dcn32 and dcn401
* Fix mst dsc mode validation issue

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Fix Vertical Interrupt definitions for dcn32, dcn401
Dillon Varone [Wed, 19 Mar 2025 17:54:44 +0000 (13:54 -0400)] 
drm/amd/display: Fix Vertical Interrupt definitions for dcn32, dcn401

[WHY&HOW]
- VUPDATE_NO_LOCK should be used in place of VUPDATE always
- Add VERTICAL_INTERRUPT1 and VERTICAL_INTERRUPT2 definitions

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoRevert "drm/amd/display: Fix VUpdate offset calculations for dcn401"
Dillon Varone [Fri, 28 Mar 2025 16:56:39 +0000 (12:56 -0400)] 
Revert "drm/amd/display: Fix VUpdate offset calculations for dcn401"

This reverts commit fe45e2af4a22e569b35b7f45eb9f040f6fbef94f.

Reason for revert: it causes stuttering in some usecases.

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@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>
2 months agodrm/amd/display: Fix VUpdate offset calculations for dcn401
Dillon Varone [Wed, 19 Mar 2025 17:53:25 +0000 (13:53 -0400)] 
drm/amd/display: Fix VUpdate offset calculations for dcn401

[WHY&HOW]
DCN401 uses a different structure to store the VStartup offset used to
calculate the VUpdate position, so adjust the calculations to use this
value.

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Do Not Consider DSC if Valid Config Not Found
Fangzhi Zuo [Thu, 20 Mar 2025 17:58:24 +0000 (13:58 -0400)] 
drm/amd/display: Do Not Consider DSC if Valid Config Not Found

[why]
In the mode validation, mst dsc is considered for bw calculation after
common dsc config is determined. Currently it considered common dsc config
is found if max and min target bpp are non zero which is not accurate. Invalid
max and min target bpp values would not get max_kbps and min_kbps calculated,
leading to falsefully pass a mode that does not have valid dsc parameters
available.

[how]
Use the return value of decide_dsc_bandwidth_range() to determine whether valid
dsc common config is found or not. Prune out modes that do not have valid common
dsc config determined.

Reviewed-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Add Support for reg inbox0 for host->DMUB CMDs
Dillon Varone [Wed, 19 Mar 2025 16:45:13 +0000 (12:45 -0400)] 
drm/amd/display: Add Support for reg inbox0 for host->DMUB CMDs

[WHY]
DCN4+ supports a new register based mailbox for sending messages
from host to DMCUB. This mailbox supports 64 byte commands, which makes
it compatible with the same structure as the frame buffer based mailbox.

[HOW]
The intention for reg_inbox0 is to be slot in replacement for the frame
buffer based mailbox (Inbox1). It supports all of the required features:
- Supports all messages handled by FB Inbox1
- Supports multi command batching

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Add a Panel Replay config option
ChunTao Tso [Tue, 22 Oct 2024 06:54:50 +0000 (14:54 +0800)] 
drm/amd/display: Add a Panel Replay config option

[Why]
Replay need special policy for the scenario Teams,
add a flag to imply apply special policy or not.

[How]
Add a config option intended for future use for video conferencing applications.

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: ChunTao Tso <ChunTao.Tso@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: use drm_warn instead of DRM_WARN
Aurabindo Pillai [Tue, 18 Mar 2025 21:25:16 +0000 (17:25 -0400)] 
drm/amd/display: use drm_warn instead of DRM_WARN

drm_warn prints the drm device instance which is helpful when
debugging multi gpu issues

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: use drm_info instead of DRM_INFO
Aurabindo Pillai [Tue, 18 Mar 2025 21:05:50 +0000 (17:05 -0400)] 
drm/amd/display: use drm_info instead of DRM_INFO

drm_info prints the drm device instance which is helpful when
debugging multi gpu issues

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Consider downspread against max clocks in DML2.1
Dillon Varone [Thu, 13 Mar 2025 19:24:59 +0000 (15:24 -0400)] 
drm/amd/display: Consider downspread against max clocks in DML2.1

[WHY&HOW]
Core should evaluate support based on the max clocks after considering
downspread.

Reviewed-by: Austin Zheng <austin.zheng@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Enable Replay Low Hz feature flag
Robin Chen [Tue, 18 Mar 2025 01:14:47 +0000 (09:14 +0800)] 
drm/amd/display: Enable Replay Low Hz feature flag

Enable replay low refresh rate support.

Reviewed-by: ChunTao Tso <chuntao.tso@amd.com>
Signed-off-by: Robin Chen <robin.chen@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Use meaningful size for block_sequence array
Joshua Aberback [Fri, 14 Mar 2025 22:33:43 +0000 (18:33 -0400)] 
drm/amd/display: Use meaningful size for block_sequence array

[Why]
This array was initially defined as size 50. There were array overflow
issues so the size was increased to 100. To ensure such issues are
avoided in the future, the size should be set based on the possible
contents instead of an arbitrary value.

[How]
 - upper bound, assume every update occurs on max number of pipes
 - define array sizes for function parameters, for static analysis

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Joshua Aberback <joshua.aberback@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: Set ODM Factor Based On DML Architecture
Austin Zheng [Mon, 17 Mar 2025 17:29:47 +0000 (13:29 -0400)] 
drm/amd/display: Set ODM Factor Based On DML Architecture

[Why]
Mapping of ODM enum is different for DML2.0 vs DML2.1.
Configs using DML2.1 will incorrectly trigger an assert meant for DML2.0.

[How]
Use if/else to seperate logic between DML2.0 and DML2.1.

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Austin Zheng <Austin.Zheng@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: convert more DRM_ERROR to drm_err
Aurabindo Pillai [Tue, 11 Mar 2025 19:34:53 +0000 (15:34 -0400)] 
drm/amd/display: convert more DRM_ERROR to drm_err

prefer drm_err instead of DRM_ERROR since the former prints the
associated DRM device, which is helpful when debugging multi-gpu
use cases.

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: use drm_err in create_validate_stream_for_sink()
Aurabindo Pillai [Tue, 11 Mar 2025 19:55:55 +0000 (15:55 -0400)] 
drm/amd/display: use drm_err in create_validate_stream_for_sink()

make the drm device available in create_validate_stream_for_sink()
so that drm_err() can be used

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: use drm_err in hpd rx offload
Aurabindo Pillai [Tue, 11 Mar 2025 19:51:03 +0000 (15:51 -0400)] 
drm/amd/display: use drm_err in hpd rx offload

add amdgpu_device pointer to data associated with the work struct
such that hpd handlers has access to the drm device for use with
drm_err()

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/display: convert DRM_ERROR to drm_err in hpd_rx_irq_create_workqueue()
Aurabindo Pillai [Tue, 11 Mar 2025 19:43:07 +0000 (15:43 -0400)] 
drm/amd/display: convert DRM_ERROR to drm_err in hpd_rx_irq_create_workqueue()

pass in a pointer to amdgpu_device directly to the function.

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/pm: Use gpu_metrics_v1_8 for smu_v13_0_12
Asad Kamal [Mon, 17 Mar 2025 07:03:46 +0000 (15:03 +0800)] 
drm/amd/pm: Use gpu_metrics_v1_8 for smu_v13_0_12

Use gpu_metrics_v1_8 for smu_v13_0_12 to fill metrics data

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/amd/pm: Use gpu_metrics_v1_8 for smu_v13_0_6
Asad Kamal [Mon, 17 Mar 2025 06:55:38 +0000 (14:55 +0800)] 
drm/amd/pm: Use gpu_metrics_v1_8 for smu_v13_0_6

Use gpu_metrics_v1_8 for smu_v13_0_6 to fill metrics data

v2: Move exposing caps to separate patch, move smu_v13.0.12 gpu metrics
1.8 usage to separate patch (Lijo)

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/amd/pm: Expose smu_v13_0_6 caps
Asad Kamal [Mon, 17 Mar 2025 06:37:37 +0000 (14:37 +0800)] 
drm/amd/pm: Expose smu_v13_0_6 caps

Expose smu_v13_0_6 caps by moving it to common header

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 agoDocumentation: Remove repeated word in docs
Charles Han [Thu, 13 Feb 2025 07:08:37 +0000 (15:08 +0800)] 
Documentation: Remove repeated word in docs

Remove the repeated word "the" in docs.

Signed-off-by: Charles Han <hanchunchao@inspur.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoDocumentation/gpu: Add an intro about MES
Rodrigo Siqueira [Tue, 25 Mar 2025 17:18:47 +0000 (11:18 -0600)] 
Documentation/gpu: Add an intro about MES

MES is an important firmware that lacks some essential documentation.
This commit introduces an overview of it and how it works.

Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoDocumentation/gpu: Create a GC entry in the amdgpu documentation
Rodrigo Siqueira [Tue, 25 Mar 2025 17:18:46 +0000 (11:18 -0600)] 
Documentation/gpu: Create a GC entry in the amdgpu documentation

GC is a large block that plays a vital role for amdgpu; for this reason,
this commit creates one specific page for GC and adds extra information
about the CP component.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoDocumentation/gpu: Add explanation about AMD Pipes and Queues
Rodrigo Siqueira [Tue, 25 Mar 2025 17:18:45 +0000 (11:18 -0600)] 
Documentation/gpu: Add explanation about AMD Pipes and Queues

Pipes and Queues are two common vocabulary that pervades discussions
around amdgpu core features. The definition and explanation of those
components are spread around multiple places in the code, mailing list,
and Gitlab, which sometimes leads to the wrong interpretation of these
concepts. This commit attempts to centralize the definition and
explanation of Pipe and Queue from amdgpu perspective in a kernel doc.
Most of the information in this doc was derived from:

- https://lore.kernel.org/amd-gfx/CADnq5_Pcz2x4aJzKbVrN3jsZhD6sTydtDw=6PaN4O3m4t+Grtg@mail.gmail.com/T/#m9a670b55ab20e0f7c46c80f802a0a4be255a719d
- https://gitlab.freedesktop.org/mesa/mesa/-/issues/11759

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoDocumentation/gpu: Create a documentation entry just for hardware info
Rodrigo Siqueira [Tue, 25 Mar 2025 17:18:44 +0000 (11:18 -0600)] 
Documentation/gpu: Create a documentation entry just for hardware info

The APU and dGPU tables are hidden in the driver misc info, which makes
it hard to find specific hardware info when users need it. This commit
creates a single page for this information and adds it to the top of the
amdgpu list to improve searchability.

Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoDocumentation/gpu: Change index order to show driver core first
Rodrigo Siqueira [Tue, 25 Mar 2025 17:18:43 +0000 (11:18 -0600)] 
Documentation/gpu: Change index order to show driver core first

Since driver-core has an overview of the AMD GPU hardware structure, it
makes more sense to keep it first. This commit move driver-core up in
the index list.

Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agoDocumentation/gpu: Add new acronyms
Rodrigo Siqueira [Tue, 25 Mar 2025 17:18:42 +0000 (11:18 -0600)] 
Documentation/gpu: Add new acronyms

This commit introduces some new acronyms extracted from the source code
and found on some web pages around the internet (most of them came from
ArchLinux, Gentoo, and Wikipedia links).

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx11: fix CSIB handling
Alex Deucher [Wed, 19 Mar 2025 15:58:19 +0000 (11:58 -0400)] 
drm/amdgpu/gfx11: fix CSIB handling

We shouldn't return after the last section.
We need to update the rest of the CSIB.

Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx10: fix CSIB handling
Alex Deucher [Wed, 19 Mar 2025 15:58:03 +0000 (11:58 -0400)] 
drm/amdgpu/gfx10: fix CSIB handling

We shouldn't return after the last section.
We need to update the rest of the CSIB.

Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx9: fix CSIB handling
Alex Deucher [Wed, 19 Mar 2025 15:57:49 +0000 (11:57 -0400)] 
drm/amdgpu/gfx9: fix CSIB handling

We shouldn't return after the last section.
We need to update the rest of the CSIB.

Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx8: fix CSIB handling
Alex Deucher [Wed, 19 Mar 2025 15:57:34 +0000 (11:57 -0400)] 
drm/amdgpu/gfx8: fix CSIB handling

We shouldn't return after the last section.
We need to update the rest of the CSIB.

Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx7: fix CSIB handling
Alex Deucher [Wed, 19 Mar 2025 15:57:19 +0000 (11:57 -0400)] 
drm/amdgpu/gfx7: fix CSIB handling

We shouldn't return after the last section.
We need to update the rest of the CSIB.

Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx6: fix CSIB handling
Alex Deucher [Wed, 19 Mar 2025 15:56:02 +0000 (11:56 -0400)] 
drm/amdgpu/gfx6: fix CSIB handling

We shouldn't return after the last section.
We need to update the rest of the CSIB.

Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx: assign the actual me0 queues per pipe
Alex Deucher [Thu, 20 Mar 2025 18:24:47 +0000 (14:24 -0400)] 
drm/amdgpu/gfx: assign the actual me0 queues per pipe

Set the actual number of queues per pipe for ME0 (gfx).
This way we will dump all of the queues properly in
dev core dumps.

Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx: decouple the number of kgqs from the hw
Alex Deucher [Thu, 20 Mar 2025 18:10:17 +0000 (14:10 -0400)] 
drm/amdgpu/gfx: decouple the number of kgqs from the hw

The driver currently sets up one kgq per pipe.  As such
adev->gfx.me.num_queue_per_pipe is hardcoded to 1 everywhere.
This is fine for kernel queues, but when we enable user queues
we need to know that actual number of queues per pipe.  Decouple
the kgq setup from the actual hardware count.  For dev core
dumps and user queues, we want to know the actual number
of queues per pipe.

Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx: make amdgpu_gfx_me_queue_to_bit() static
Alex Deucher [Thu, 20 Mar 2025 17:34:33 +0000 (13:34 -0400)] 
drm/amdgpu/gfx: make amdgpu_gfx_me_queue_to_bit() static

It's not used outside of amdgpu_gfx.c.

Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu/gfx10: Add Cleaner Shader Support for GFX10.3.x GPUs
Srinivasan Shanmugam [Wed, 26 Mar 2025 07:23:01 +0000 (12:53 +0530)] 
drm/amdgpu/gfx10: Add Cleaner Shader Support for GFX10.3.x GPUs

Enable the cleaner shader for other GFX10.3.x series of GPUs to provide
data isolation between GPU workloads. The cleaner shader is responsible
for clearing the Local Data Store (LDS), Vector General Purpose
Registers (VGPRs), and Scalar General Purpose Registers (SGPRs), which
helps prevent data leakage and ensures accurate computation results.

This update extends cleaner shader support to GFX10.3.x GPUs, previously
available for GFX10.3.0. It enhances security by clearing GPU memory
between processes and maintains a consistent GPU state across KGD and
KFD workloads.

Cc: Mario Sopena-Novales <mario.novales@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: drop some dead code
Alex Deucher [Tue, 25 Mar 2025 14:07:50 +0000 (10:07 -0400)] 
drm/amdgpu: drop some dead code

Drop the cgs smu firmware code for SI, it's not used.
The smu firmware fetching for SI is done in si_dpm.c.

Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: add initial documentation for debugfs files
Alex Deucher [Mon, 3 Mar 2025 22:35:32 +0000 (17:35 -0500)] 
drm/amdgpu: add initial documentation for debugfs files

Describes what debugfs files are available and what
they are used for.

v2: fix some typos (Mark Glines)
v3: Address comments from Siqueira and Kent

Reviewed-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: continue cleaning up sid.h and si_enums.h
Alexandre Demers [Sat, 22 Mar 2025 01:47:00 +0000 (21:47 -0400)] 
drm/amdgpu: continue cleaning up sid.h and si_enums.h

Remove more duplicated defines and move some in sid.h for coherence with
CIK.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amd/amdgpu: Fix typo
Ananta Srikar [Tue, 25 Mar 2025 01:49:12 +0000 (21:49 -0400)] 
drm/amd/amdgpu: Fix typo

Fixes a typo in the word "version" in an error message.

Signed-off-by: Ananta Srikar <srikarananta01@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: Replace deprecated function strcpy() with strscpy()
Andres Urian Florez [Tue, 25 Mar 2025 00:07:21 +0000 (19:07 -0500)] 
drm/amdgpu: Replace deprecated function strcpy() with strscpy()

Instead of using the strcpy() deprecated function to populate the
fw_name, use the strscpy() function

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy
Signed-off-by: Andres Urian Florez <andres.emb.sys@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: add rebar parameter
Alex Deucher [Thu, 27 Feb 2025 17:31:28 +0000 (12:31 -0500)] 
drm/amdgpu: add rebar parameter

Add a new parameter to disable BAR resizing.  Note that this
only disables the driver from attempting to resize the BAR,
The BIOS may have resized the BAR at boot.

Some teams have found this useful in debugging P2P DMA
issues on systems where the available MMIO space did not allow
for all of the GPUs present to resize their BARs.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: cleanup DCE6 a bit more
Alexandre Demers [Sat, 22 Mar 2025 01:46:59 +0000 (21:46 -0400)] 
drm/amdgpu: cleanup DCE6 a bit more

Use shifts already available in DCE6's defines, masks and shifts.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: keep removing sid.h dependency from si_dma.c
Alexandre Demers [Sat, 22 Mar 2025 01:46:58 +0000 (21:46 -0400)] 
drm/amdgpu: keep removing sid.h dependency from si_dma.c

Move and rename DMA_SEM_INCOMPLETE_TIMER_CNTL and DMA_SEM_WAIT_FAIL_TIMER_CNTL
in oss_1_0_d.h

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: move si_dma.c away from sid.h and si_enums.h
Alexandre Demers [Sat, 22 Mar 2025 01:46:56 +0000 (21:46 -0400)] 
drm/amdgpu: move si_dma.c away from sid.h and si_enums.h

Replace defines for the ones in oss_1_0_d.h and oss_1_0_sh_mask.h

Taking the opportunity to add some comments taken from cik_sdma.c

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: make GFX6 easier to read
Alexandre Demers [Sat, 22 Mar 2025 01:46:54 +0000 (21:46 -0400)] 
drm/amdgpu: make GFX6 easier to read

Just fix the style and add a comment for reading easiness

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: add missing GFX6 defines
Alexandre Demers [Sat, 22 Mar 2025 01:46:51 +0000 (21:46 -0400)] 
drm/amdgpu: add missing GFX6 defines

They will be used later when switching away from sid.h/si_enums.h.

v2: fix whitespace (Alex)

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: add missing DMA defines, shifts and masks
Alexandre Demers [Sat, 22 Mar 2025 01:46:50 +0000 (21:46 -0400)] 
drm/amdgpu: add missing DMA defines, shifts and masks

They will be used later when switching away from sid.h/si_enums.h.

v2: fix up whitespace (Alex)

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: move DCE6 away from sid.h and si_enums.h defines
Alexandre Demers [Sat, 22 Mar 2025 01:46:49 +0000 (21:46 -0400)] 
drm/amdgpu: move DCE6 away from sid.h and si_enums.h defines

This cleans up DCE6.

I added some minor tweaks taken from CIK to exit early

v2: minor fixes (Alex)

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: use GRPH_SECONDARY_SURFACE_ADDRESS_MASK with GRPH_SECONDARY_SURFACE_ADDRE...
Alexandre Demers [Sat, 22 Mar 2025 01:46:48 +0000 (21:46 -0400)] 
drm/amdgpu: use GRPH_SECONDARY_SURFACE_ADDRESS_MASK with GRPH_SECONDARY_SURFACE_ADDRESS in DCE6

It seems a copy-paste error: since we are working with
mmGRPH_SECONDARY_SURFACE_ADDRESS,
GRPH_SECONDARY_SURFACE_ADDRESS__GRPH_SECONDARY_SURFACE_ADDRESS_MASK
should be used.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: move si_ih.c away from sid.h defines
Alexandre Demers [Sat, 22 Mar 2025 01:46:47 +0000 (21:46 -0400)] 
drm/amdgpu: move si_ih.c away from sid.h defines

They are properly defined under oss_1_0_d.h

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: remove PACKET3 duplicated defines from si_enums.h
Alexandre Demers [Sat, 22 Mar 2025 01:46:46 +0000 (21:46 -0400)] 
drm/amdgpu: remove PACKET3 duplicated defines from si_enums.h

PACKET3 is already in sid.h, as it is done under cikd.h for CIK

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: use proper defines, shifts and masks in DCE6 code
Alexandre Demers [Sat, 22 Mar 2025 01:46:45 +0000 (21:46 -0400)] 
drm/amdgpu: use proper defines, shifts and masks in DCE6 code

By replacing VGA_VSTATUS_CNTL by VGA_RENDER_CONTROL__VGA_VSTATUS_CNTL_MASK,
we also need to fix its usage in GMC6.

Note: VGA_VSTATUS_CNTL's binary value was inverted in dce_6_0_sh_mask.h,
so we need to invert its value where it was used.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: wire up defines, shifts and masks through SI code
Alexandre Demers [Sat, 22 Mar 2025 01:46:44 +0000 (21:46 -0400)] 
drm/amdgpu: wire up defines, shifts and masks through SI code

To be able to remove as much duplicated defines, the different files
containing definitions, shifts and masks must be properly included.

Once done, the code will be migrated where needed to shifts and masks and
proper defines, before removing useless defines in the end.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: move GFX6 defines into gfx_v6_0.c
Alexandre Demers [Sat, 22 Mar 2025 01:46:43 +0000 (21:46 -0400)] 
drm/amdgpu: move GFX6 defines into gfx_v6_0.c

Send a few GFX6 defines where it's used in GFX6.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/radeon: fix MAX_POWER_SHIFT value
Alexandre Demers [Sat, 22 Mar 2025 18:39:00 +0000 (14:39 -0400)] 
drm/radeon: fix MAX_POWER_SHIFT value

While I don't think it is being used anywhere, if it were used, it would
be wrong. We can base this assumption on MAX_POWER_MASK, where the shift is
by 16 bits.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: move X_GB_ADDR_CONFIG_GOLDEN in GFX7
Alexandre Demers [Sat, 22 Mar 2025 18:37:45 +0000 (14:37 -0400)] 
drm/amdgpu: move X_GB_ADDR_CONFIG_GOLDEN in GFX7

[BONAIRE|HAWAII]_GB_ADDR_CONFIG_GOLDEN are only used by GFX7. So keep them
where they are needed.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: small cleanup to CIK SDMA
Alexandre Demers [Sat, 22 Mar 2025 18:37:44 +0000 (14:37 -0400)] 
drm/amdgpu: small cleanup to CIK SDMA

Tidy cik_sdma_hw_init() by returning directly cik_sdma_start()'s result.

Keep amdgpu_cik_gpu_check_soft_reset() early declaration with others.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 months agodrm/amdgpu: use cik_sdma_is_idle() in CIK SDMA
Alexandre Demers [Sat, 22 Mar 2025 18:37:43 +0000 (14:37 -0400)] 
drm/amdgpu: use cik_sdma_is_idle() in CIK SDMA

cik_sdma_is_idle() does exactly what we need, so use it.

V2: fix parameter (Alex)

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>