]> Git Repo - linux.git/log
linux.git
5 months agodrm/amdkfd: Output migrate end event if migrate failed
Philip Yang [Fri, 16 Feb 2024 16:41:16 +0000 (11:41 -0500)]
drm/amdkfd: Output migrate end event if migrate failed

If page migration failed, also output migrate end event to match with
migrate start event, with failure error_code added to the end of the
migrate message macro. This will not break uAPI because application uses
old message macro sscanf drop and ignore the error_code.

Output GPU page fault restore end event if migration failed.

Signed-off-by: Philip Yang <[email protected]>
Reviewed-by: James Zhu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu/gfx11: Implement cleaner shader support for GFX11 hardware
Srinivasan Shanmugam [Thu, 3 Oct 2024 10:13:14 +0000 (15:43 +0530)]
drm/amdgpu/gfx11: Implement cleaner shader support for GFX11 hardware

The patch modifies the gfx_v11_0_kiq_set_resources function to write
the cleaner shader's memory controller address to the ring buffer. It
also adds a new function, gfx_v11_0_ring_emit_cleaner_shader, which
emits the PACKET3_RUN_CLEANER_SHADER packet to the ring buffer.

This patch adds support for the PACKET3_RUN_CLEANER_SHADER packet in the
gfx_v11_0 module. This packet is used to emit the cleaner shader, which
is used to clear GPU memory before it's reused, helping to prevent data
leakage between different processes.

Finally, the patch updates the ring function structures to include the
new gfx_v11_0_ring_emit_cleaner_shader function. This allows the
cleaner shader to be emitted as part of the ring's operations.

Cc: Christian König <[email protected]>
Cc: Alex Deucher <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/pm: use pm_runtime_get_if_active for debugfs getters
Pierre-Eric Pelloux-Prayer [Mon, 16 Sep 2024 14:49:15 +0000 (16:49 +0200)]
drm/amd/pm: use pm_runtime_get_if_active for debugfs getters

Don't wake up the GPU for reading pm values. Instead, take a runtime
powermanagement ref when trying to read it if and only if the GPU is
already awake.

This avoids spurious wake ups (eg: from applets).

We use pm_runtime_get_if_in_active because we care about "is the GPU awake?"
not about "is the GPU awake and something else prevents suspend?".

Tested-by: Mario Limonciello <[email protected]>
Reviewed-by: Kenneth Feng <[email protected]>
Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: change the comment from handle to ip_block
Sunil Khatri [Wed, 2 Oct 2024 13:54:25 +0000 (19:24 +0530)]
drm/amdgpu: change the comment from handle to ip_block

htmldoc generation depend upon the input arguments etc
to generate the document. After update of handle to
ip_block then update needs in comments too to fix the
warnings.

Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]
Signed-off-by: Sunil Khatri <[email protected]>
Acked-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu/gfx10: Implement cleaner shader support for GFX10 hardware
Srinivasan Shanmugam [Wed, 2 Oct 2024 03:55:10 +0000 (09:25 +0530)]
drm/amdgpu/gfx10: Implement cleaner shader support for GFX10 hardware

The patch modifies the gfx_v10_0_kiq_set_resources function to write
the cleaner shader's memory controller address to the ring buffer. It
also adds a new function, gfx_v10_0_ring_emit_cleaner_shader, which
emits the PACKET3_RUN_CLEANER_SHADER packet to the ring buffer.

This patch adds support for the PACKET3_RUN_CLEANER_SHADER packet in the
gfx_v10_0 module. This packet is used to emit the cleaner shader, which
is used to clear GPU memory before it's reused, helping to prevent data
leakage between different processes.

Finally, the patch updates the ring function structures to include the
new gfx_v10_0_ring_emit_cleaner_shader function. This allows the
cleaner shader to be emitted as part of the ring's operations.

Cc: Christian König <[email protected]>
Cc: Alex Deucher <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdkfd: Fix an eviction fence leak
Lang Yu [Fri, 27 Sep 2024 10:27:46 +0000 (18:27 +0800)]
drm/amdkfd: Fix an eviction fence leak

Only creating a new reference for each process instead of each VM.

Fixes: 9a1c1339abf9 ("drm/amdkfd: Run restore_workers on freezable WQs")
Suggested-by: Felix Kuehling <[email protected]>
Signed-off-by: Lang Yu <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/pm: don't update runpm last_usage on debugfs getter
Pierre-Eric Pelloux-Prayer [Mon, 16 Sep 2024 14:35:15 +0000 (16:35 +0200)]
drm/amd/pm: don't update runpm last_usage on debugfs getter

Reading pm values from the GPU shouldn't prevent it to be suspended
by resetting the last active timestamp (eg: if an background app
monitors GPU sensors every second, it would prevent the autosuspend
sequence to trigger).

Tested-by: Mario Limonciello <[email protected]>
Reviewed-by: Kenneth Feng <[email protected]>
Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: fix html doc generation warning
Sunil Khatri [Wed, 2 Oct 2024 09:22:52 +0000 (14:52 +0530)]
drm/amdgpu: fix html doc generation warning

Fix the html doc warning due to mix up of the
forward declaration of struct amdgpu_ip_block.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in hw_fini
Sunil Khatri [Wed, 2 Oct 2024 05:50:58 +0000 (11:20 +0530)]
drm/amdgpu: update the handle ptr in hw_fini

Update the *handle to amdgpu_ip_block ptr for all
functions pointers of hw_fini.

Also update the ip_block ptr where ever needed as
there were cyclic dependency of hw_fini on suspend
and some followed clean up.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in hw_init
Sunil Khatri [Tue, 1 Oct 2024 06:05:14 +0000 (11:35 +0530)]
drm/amdgpu: update the handle ptr in hw_init

Update the *handle to amdgpu_ip_block ptr for all
functions pointers of hw_init.

Also update the ip_block ptr where ever needed as
there were cyclic dependency of hw_init on resume.

v2: squash in isp fix

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in resume
Sunil Khatri [Mon, 30 Sep 2024 12:12:01 +0000 (17:42 +0530)]
drm/amdgpu: update the handle ptr in resume

Update the *handle to amdgpu_ip_block ptr for all
functions pointers of resume.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in suspend
Sunil Khatri [Mon, 30 Sep 2024 11:30:38 +0000 (17:00 +0530)]
drm/amdgpu: update the handle ptr in suspend

Update the *handle to amdgpu_ip_block ptr for all
functions pointers of suspend.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in wait_for_idle
Sunil Khatri [Mon, 30 Sep 2024 10:59:15 +0000 (16:29 +0530)]
drm/amdgpu: update the handle ptr in wait_for_idle

Update the *handle to amdgpu_ip_block ptr for all
functions pointers of wait_for_idle.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/pm: use pm_runtime_resume_and_get
Pierre-Eric Pelloux-Prayer [Fri, 6 Sep 2024 11:51:39 +0000 (13:51 +0200)]
drm/amd/pm: use pm_runtime_resume_and_get

Using pm_runtime_resume_and_get over pm_runtime_get_sync is recommended.

Tested-by: Mario Limonciello <[email protected]>
Reviewed-by: Kenneth Feng <[email protected]>
Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/pm: fix rpm refcount handling on error
Pierre-Eric Pelloux-Prayer [Fri, 26 Jul 2024 09:42:40 +0000 (11:42 +0200)]
drm/amd/pm: fix rpm refcount handling on error

pm_runtime_put_autosuspend must be called from all exit paths.

Tested-by: Mario Limonciello <[email protected]>
Reviewed-by: Kenneth Feng <[email protected]>
Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in post_soft_reset
Sunil Khatri [Mon, 30 Sep 2024 09:38:44 +0000 (15:08 +0530)]
drm/amdgpu: update the handle ptr in post_soft_reset

Update the *handle to amdgpu_ip_block ptr for all
functions pointers of post_soft_reset.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in soft_reset
Sunil Khatri [Mon, 30 Sep 2024 09:30:30 +0000 (15:00 +0530)]
drm/amdgpu: update the handle ptr in soft_reset

Update the *handle to amdgpu_ip_block ptr for all
functions pointers of soft_reset.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu/gfx9: Add Cleaner Shader Deinitialization in gfx_v9_0 Module
Srinivasan Shanmugam [Tue, 1 Oct 2024 06:56:46 +0000 (12:26 +0530)]
drm/amdgpu/gfx9: Add Cleaner Shader Deinitialization in gfx_v9_0 Module

This commit addresses an omission in the previous patch related to the
cleaner shader support for GFX9 hardware. Specifically, it adds the
necessary deinitialization code for the cleaner shader in the
gfx_v9_0_sw_fini function.

The added line amdgpu_gfx_cleaner_shader_sw_fini(adev); ensures that any
allocated resources for the cleaner shader are freed correctly, avoiding
potential memory leaks and ensuring that the GPU state is clean for the
next initialization sequence.

Cc: Christian König <[email protected]>
Cc: Alex Deucher <[email protected]>
Fixes: c2e70d307f44 ("drm/amdgpu/gfx9: Implement cleaner shader support for GFX9 hardware")
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Acked-by: Christian König <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in pre_soft_reset
Sunil Khatri [Mon, 30 Sep 2024 09:07:11 +0000 (14:37 +0530)]
drm/amdgpu: update the handle ptr in pre_soft_reset

Update the *handle to amdgpu_ip_block ptr for all
functions pointers of pre_soft_reset.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Fix logic to determine TOS reload
Lijo Lazar [Mon, 30 Sep 2024 12:05:50 +0000 (17:35 +0530)]
drm/amdgpu: Fix logic to determine TOS reload

Avoid comparing TOS version on APUs. On APUs driver doesn't take care of
TOS load.

Fixes: 0ff382261371 ("drm/amdgpu: Add interface for TOS reload cases")
Signed-off-by: Lijo Lazar <[email protected]>
Acked-by: Rajneesh Bhardwaj <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in check_soft_reset
Sunil Khatri [Mon, 30 Sep 2024 09:02:13 +0000 (14:32 +0530)]
drm/amdgpu: update the handle ptr in check_soft_reset

Update the *handle to amdgpu_ip_block ptr for all
functions pointers of check_soft_reset.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in prepare_suspend
Sunil Khatri [Mon, 30 Sep 2024 08:41:22 +0000 (14:11 +0530)]
drm/amdgpu: update the handle ptr in prepare_suspend

Update the *handle to amdgpu_ip_block ptr for all
functions pointers of prepare_suspend.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in late_fini
Sunil Khatri [Mon, 30 Sep 2024 08:35:49 +0000 (14:05 +0530)]
drm/amdgpu: update the handle ptr in late_fini

Update the *handle to amdgpu_ip_block ptr for all
functions pointers of late_fini.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: remove the dummy fn acp_early_init
Sunil Khatri [Mon, 30 Sep 2024 08:20:15 +0000 (13:50 +0530)]
drm/amdgpu: remove the dummy fn acp_early_init

acp_early_init is a dummy function and is not being
used and hence removed.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/powerplay: Delete unused function and maths library
Dr. David Alan Gilbert [Sun, 29 Sep 2024 21:03:33 +0000 (22:03 +0100)]
drm/amd/powerplay: Delete unused function and maths library

We start with the function 'atomctrl_calculate_voltage_evv_on_sclk'
which has been unused since 2016's commit
e805ed83ba1c ("drm/amd/powerplay: delete useless files.")

Remove it.

It was also the last user of the entire fixed point maths library in
ppevvmath.h.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd: Taint the kernel when enabling overdrive
Mario Limonciello [Wed, 25 Sep 2024 20:05:07 +0000 (15:05 -0500)]
drm/amd: Taint the kernel when enabling overdrive

Some distributions have been patching amdgpu to enable overdrive by
default which may compromise stability.  Furthermore when bug reports
are brought upstream it's not obvious that the system has been tampered
with.

When overdrive is enabled taint the kernel and leave a critical message
in the logs for users so that it's obvious in a bug report it's been
tampered with.

Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Mario Limonciello <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/pm: remove dump_pptable functions
Pierre-Eric Pelloux-Prayer [Mon, 16 Sep 2024 13:52:26 +0000 (15:52 +0200)]
drm/amd/pm: remove dump_pptable functions

They're not used.

Tested-by: Mario Limonciello <[email protected]>
Reviewed-by: Kenneth Feng <[email protected]>
Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/radeon/r600_cs: Fix possible int overflow in r600_packet3_check()
Igor Artemiev [Fri, 27 Sep 2024 15:07:19 +0000 (18:07 +0300)]
drm/radeon/r600_cs: Fix possible int overflow in r600_packet3_check()

It is possible, although unlikely, that an integer overflow will occur
when the result of radeon_get_ib_value() is shifted to the left.

Avoid it by casting one of the operands to larger data type (u64).

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

Signed-off-by: Igor Artemiev <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Reorganize kerneldoc parameter names
Julia Lawall [Mon, 30 Sep 2024 11:21:11 +0000 (13:21 +0200)]
drm/amd/display: Reorganize kerneldoc parameter names

Reorganize kerneldoc parameter names to match the parameter
order in the function header.

Problems identified using Coccinelle.

Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdkfd: Fix kdoc entry for 'get_wave_count()' function parameters
Srinivasan Shanmugam [Wed, 25 Sep 2024 14:59:48 +0000 (20:29 +0530)]
drm/amdkfd: Fix kdoc entry for 'get_wave_count()' function parameters

Update kdoc entries to reflect the function's parameters. The descriptor
for the 'queue_cnt' parameter has been added, and the incorrect mentions
of 'wave_cnt' and 'vmid', which are not parameters but local variables,
have been removed.

Fixes the below with gcc W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:954: warning: Function parameter or struct member 'queue_cnt' not described in 'get_wave_count'
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:954: warning: Excess function parameter 'wave_cnt' description in 'get_wave_count'
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:954: warning: Excess function parameter 'vmid' description in 'get_wave_count'

Cc: Ramesh Errabolu <[email protected]>
Cc: Harish Kasiviswanathan <[email protected]>
Cc: Felix Kuehling <[email protected]>
Cc: Christian König <[email protected]>
Cc: Alex Deucher <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Reviewed-by: Mukul Joshi <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in early_fini
Sunil Khatri [Thu, 26 Sep 2024 15:31:55 +0000 (21:01 +0530)]
drm/amdgpu: update the handle ptr in early_fini

Update the *handle to amdgpu_ip_block ptr for all
functions pointers of early_fini.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in sw_fini
Sunil Khatri [Thu, 26 Sep 2024 15:17:32 +0000 (20:47 +0530)]
drm/amdgpu: update the handle ptr in sw_fini

update the *handle to amdgpu_ip_block ptr for all
functions pointers of sw_fini.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in sw_init
Sunil Khatri [Thu, 26 Sep 2024 09:00:28 +0000 (14:30 +0530)]
drm/amdgpu: update the handle ptr in sw_init

update the *handle to amdgpu_ip_block ptr for all
functions pointers of sw_init.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in late_init
Sunil Khatri [Thu, 26 Sep 2024 07:59:24 +0000 (13:29 +0530)]
drm/amdgpu: update the handle ptr in late_init

Update the ptr handle to amdgpu_ip_block ptr in all
the functions of late_init function ptr.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in early_init
Sunil Khatri [Wed, 25 Sep 2024 11:29:51 +0000 (16:59 +0530)]
drm/amdgpu: update the handle ptr in early_init

update the handle ptr to amdgpu_ip_block ptr
for all functions pointers on early_init.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Add supported partition mode node
Asad Kamal [Tue, 24 Sep 2024 11:22:05 +0000 (19:22 +0800)]
drm/amdgpu: Add supported partition mode node

Add sysfs node to show supported partition modes across all NPS modes

Signed-off-by: Asad Kamal <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Add option to refresh NPS data
Lijo Lazar [Wed, 18 Sep 2024 10:27:08 +0000 (15:57 +0530)]
drm/amdgpu: Add option to refresh NPS data

In certain use cases, NPS data needs to be refreshed again from
discovery table. Add API parameter to refresh NPS data from discovery
table.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Rajneesh Bhardwaj <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu/sdma5.2: implement ring reset callback for sdma5.2
Jiadong Zhu [Fri, 20 Sep 2024 03:29:41 +0000 (11:29 +0800)]
drm/amdgpu/sdma5.2: implement ring reset callback for sdma5.2

Implement sdma queue reset callback via MMIO.

v2: enter/exit safemode for mmio queue reset.

Signed-off-by: Jiadong Zhu <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Flush tlb by VM_INVALIDATION packet in sdma_v5_2
YuanShang [Mon, 9 Sep 2024 08:29:22 +0000 (16:29 +0800)]
drm/amdgpu: Flush tlb by VM_INVALIDATION packet in sdma_v5_2

In order for SDMA not to be switched between VM_INVALIDATION
request and ack, use an single VM_INVALIDATION packet in function
sdma_v5_2_ring_emit_vm_flush.

Signed-off-by: YuanShang <[email protected]>
Reviewed-By: Horace Chen <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu/sdma5.2: split out per instance resume function
Jiadong Zhu [Fri, 20 Sep 2024 03:18:29 +0000 (11:18 +0800)]
drm/amdgpu/sdma5.2: split out per instance resume function

Extract the resume sequence from sdma_v5_2_gfx_resume for
starting/restarting an individual instance.

Signed-off-by: Jiadong Zhu <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu/sdma5: implement ring reset callback for sdma5
Jiadong Zhu [Fri, 20 Sep 2024 02:54:13 +0000 (10:54 +0800)]
drm/amdgpu/sdma5: implement ring reset callback for sdma5

Implement sdma queue reset callback via MMIO.

v2: enter/exit safemode when sdma queue reset.

Signed-off-by: Jiadong Zhu <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: 3.2.303
Aric Cyr [Mon, 23 Sep 2024 13:14:59 +0000 (09:14 -0400)]
drm/amd/display: 3.2.303

DC 3.2.303 contains some improvements as summarized below:
* Improve brightness control
* Add support for UHBR10 eDP
* OPTC required only for DTBCLK_P for dcn401
* Fix TBT monitor resume issue
* Code cleanup

Reviewed-by: Zaeem Mohamed <[email protected]>
Signed-off-by: Aric Cyr <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: [FW Promotion] Release 0.0.236.0
Taimur Hassan [Mon, 23 Sep 2024 05:37:51 +0000 (01:37 -0400)]
drm/amd/display: [FW Promotion] Release 0.0.236.0

Reviewed-by: Zaeem Mohamed <[email protected]>
Signed-off-by: Taimur Hassan <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Configure DTBCLK_P with OPTC only for dcn401
Dillon Varone [Fri, 20 Sep 2024 20:56:20 +0000 (16:56 -0400)]
drm/amd/display: Configure DTBCLK_P with OPTC only for dcn401

[WHY]
DTBCLK_P is used to generate virtual pixel clock, and to drive the HPO
stream encoder clock. Programming the required clock when
enabling/disabling both components can cause issues.
For example, if HPO is being disabled and clock source is changed to
REFCLK, virtual pixel rate will then be wrong, causing issues in CRTC.

[HOW]
Only program the DTBCLK_P when programming CRTC, as its expected it will
be enabled prior to HPO, and disabled after HPO in all valid cases.

Reviewed-by: Alvin Lee <[email protected]>
Signed-off-by: Dillon Varone <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Add IPS residency capture helpers to dc_dmub_srv
Ovidiu Bunea [Wed, 31 Jul 2024 18:18:08 +0000 (14:18 -0400)]
drm/amd/display: Add IPS residency capture helpers to dc_dmub_srv

This enables starting and stopping IPS residency measurements
and querying the IPS residency information consisting of residency
percent, entry counter, total time active & inactive, and histograms
for the specified IPS mode.

Reviewed-by: Nicholas Kazlauskas <[email protected]>
Reviewed-by: Aric Cyr <[email protected]>
Signed-off-by: Ovidiu Bunea <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Removed unused assignments and variables
Alex Hung [Fri, 20 Sep 2024 00:46:48 +0000 (18:46 -0600)]
drm/amd/display: Removed unused assignments and variables

[WHAT]
A number of values are assigned to variables but the stored values are
not used afterwards.

[HOW]
The assignments are removed. If the variables are not used, they are
removed as well.

This fixes 9 UNUSED_VALUE issues reported by Coverity.

Reviewed-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Eliminate recursive header inclusion
Alex Hung [Thu, 19 Sep 2024 02:45:51 +0000 (20:45 -0600)]
drm/amd/display: Eliminate recursive header inclusion

[WHAT & HOW]
This removes recursive inclusion like dc.h -> dc_state.h -> dc.h and
dc.h -> dc_plane.h -> dc.h

This fixes 4 PW.INCLUDE_RECURSION issues reported by Coverity.

Reviewed-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Fix out-of-bounds access in 'dcn21_link_encoder_create'
Srinivasan Shanmugam [Wed, 25 Sep 2024 14:34:15 +0000 (20:04 +0530)]
drm/amd/display: Fix out-of-bounds access in 'dcn21_link_encoder_create'

An issue was identified in the dcn21_link_encoder_create function where
an out-of-bounds access could occur when the hpd_source index was used
to reference the link_enc_hpd_regs array. This array has a fixed size
and the index was not being checked against the array's bounds before
accessing it.

This fix adds a conditional check to ensure that the hpd_source index is
within the valid range of the link_enc_hpd_regs array. If the index is
out of bounds, the function now returns NULL to prevent undefined
behavior.

References:

[   65.920507] ------------[ cut here ]------------
[   65.920510] UBSAN: array-index-out-of-bounds in drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn21/dcn21_resource.c:1312:29
[   65.920519] index 7 is out of range for type 'dcn10_link_enc_hpd_registers [5]'
[   65.920523] CPU: 3 PID: 1178 Comm: modprobe Tainted: G           OE      6.8.0-cleanershaderfeatureresetasdntipmi200nv2132 #13
[   65.920525] Hardware name: AMD Majolica-RN/Majolica-RN, BIOS WMJ0429N_Weekly_20_04_2 04/29/2020
[   65.920527] Call Trace:
[   65.920529]  <TASK>
[   65.920532]  dump_stack_lvl+0x48/0x70
[   65.920541]  dump_stack+0x10/0x20
[   65.920543]  __ubsan_handle_out_of_bounds+0xa2/0xe0
[   65.920549]  dcn21_link_encoder_create+0xd9/0x140 [amdgpu]
[   65.921009]  link_create+0x6d3/0xed0 [amdgpu]
[   65.921355]  create_links+0x18a/0x4e0 [amdgpu]
[   65.921679]  dc_create+0x360/0x720 [amdgpu]
[   65.921999]  ? dmi_matches+0xa0/0x220
[   65.922004]  amdgpu_dm_init+0x2b6/0x2c90 [amdgpu]
[   65.922342]  ? console_unlock+0x77/0x120
[   65.922348]  ? dev_printk_emit+0x86/0xb0
[   65.922354]  dm_hw_init+0x15/0x40 [amdgpu]
[   65.922686]  amdgpu_device_init+0x26a8/0x33a0 [amdgpu]
[   65.922921]  amdgpu_driver_load_kms+0x1b/0xa0 [amdgpu]
[   65.923087]  amdgpu_pci_probe+0x1b7/0x630 [amdgpu]
[   65.923087]  local_pci_probe+0x4b/0xb0
[   65.923087]  pci_device_probe+0xc8/0x280
[   65.923087]  really_probe+0x187/0x300
[   65.923087]  __driver_probe_device+0x85/0x130
[   65.923087]  driver_probe_device+0x24/0x110
[   65.923087]  __driver_attach+0xac/0x1d0
[   65.923087]  ? __pfx___driver_attach+0x10/0x10
[   65.923087]  bus_for_each_dev+0x7d/0xd0
[   65.923087]  driver_attach+0x1e/0x30
[   65.923087]  bus_add_driver+0xf2/0x200
[   65.923087]  driver_register+0x64/0x130
[   65.923087]  ? __pfx_amdgpu_init+0x10/0x10 [amdgpu]
[   65.923087]  __pci_register_driver+0x61/0x70
[   65.923087]  amdgpu_init+0x7d/0xff0 [amdgpu]
[   65.923087]  do_one_initcall+0x49/0x310
[   65.923087]  ? kmalloc_trace+0x136/0x360
[   65.923087]  do_init_module+0x6a/0x270
[   65.923087]  load_module+0x1fce/0x23a0
[   65.923087]  init_module_from_file+0x9c/0xe0
[   65.923087]  ? init_module_from_file+0x9c/0xe0
[   65.923087]  idempotent_init_module+0x179/0x230
[   65.923087]  __x64_sys_finit_module+0x5d/0xa0
[   65.923087]  do_syscall_64+0x76/0x120
[   65.923087]  entry_SYSCALL_64_after_hwframe+0x6e/0x76
[   65.923087] RIP: 0033:0x7f2d80f1e88d
[   65.923087] Code: 5b 41 5c c3 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 73 b5 0f 00 f7 d8 64 89 01 48
[   65.923087] RSP: 002b:00007ffc7bc1aa78 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[   65.923087] RAX: ffffffffffffffda RBX: 0000564c9c1db130 RCX: 00007f2d80f1e88d
[   65.923087] RDX: 0000000000000000 RSI: 0000564c9c1e5480 RDI: 000000000000000f
[   65.923087] RBP: 0000000000040000 R08: 0000000000000000 R09: 0000000000000002
[   65.923087] R10: 000000000000000f R11: 0000000000000246 R12: 0000564c9c1e5480
[   65.923087] R13: 0000564c9c1db260 R14: 0000000000000000 R15: 0000564c9c1e54b0
[   65.923087]  </TASK>
[   65.923927] ---[ end trace ]---

Cc: Tom Chung <[email protected]>
Cc: Rodrigo Siqueira <[email protected]>
Cc: Roman Li <[email protected]>
Cc: Alex Hung <[email protected]>
Cc: Aurabindo Pillai <[email protected]>
Cc: Harry Wentland <[email protected]>
Cc: Hamza Mahfooz <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Reviewed-by: Roman Li <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Remove always-false branches
Alex Hung [Wed, 18 Sep 2024 21:33:27 +0000 (15:33 -0600)]
drm/amd/display: Remove always-false branches

[WHAT & HOW]
MacroTileSizeBytes is set to either 256 or 65535 and it is never
4096. Its branch is not taken, and should be removed. Similarly,
mode_422 is always 0 and thus ppe will always be 1. The ternary
operator should be removed.

This fixes 2 DEADCODE issues reported by Coverity.

Reviewed-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Introduce New ABC Framework for Brightness Control
Muyuan Yang [Thu, 18 Jul 2024 18:03:18 +0000 (14:03 -0400)]
drm/amd/display: Introduce New ABC Framework for Brightness Control

Adjust the existing brightness control functions to use the new
ABC Framework and prioritize Aux-based brightness control.

Reviewed-by: Anthony Koo <[email protected]>
Signed-off-by: Muyuan Yang <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Change Brightness Control Priority
Muyuan Yang [Wed, 5 Jun 2024 14:24:59 +0000 (10:24 -0400)]
drm/amd/display: Change Brightness Control Priority

Prioritize Aux-based over PWM-based brightness control
for more types of panels and introduce a new structure
to store and manage the type of brightness control used.

Reviewed-by: Anthony Koo <[email protected]>
Signed-off-by: Muyuan Yang <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: add more support for UHBR10 eDP
Liu Xi (Alex) [Thu, 19 Sep 2024 19:10:15 +0000 (15:10 -0400)]
drm/amd/display: add more support for UHBR10 eDP

[Why and how]

The current UHBR10 eDP panel has new security feature update. Add support for the new FW

Reviewed-by: Wenjing Liu <[email protected]>
Signed-off-by: Liu Xi (Alex) <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Add logs to record register read/write
Paul Hsieh [Thu, 12 Sep 2024 06:47:51 +0000 (14:47 +0800)]
drm/amd/display: Add logs to record register read/write

[Why]
There are some issues which customer only can provide full
dump for analyze, without register history, it's hard to
debug HW status.

[How]
1. Put register read/write into WPP log so we can trace the logs
from full memory dump.
2. MALL doesn't add into WPP, add it.

Reviewed-by: Aric Cyr <[email protected]>
Signed-off-by: Paul Hsieh <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Fix system hang while resume with TBT monitor
Tom Chung [Fri, 13 Sep 2024 07:44:40 +0000 (15:44 +0800)]
drm/amd/display: Fix system hang while resume with TBT monitor

[Why]
Connected with a Thunderbolt monitor and do the suspend and the system
may hang while resume.

The TBT monitor HPD will be triggered during the resume procedure
and call the drm_client_modeset_probe() while
struct drm_connector connector->dev->master is NULL.

It will mess up the pipe topology after resume.

[How]
Skip the TBT monitor HPD during the resume procedure because we
currently will probe the connectors after resume by default.

Reviewed-by: Wayne Lin <[email protected]>
Signed-off-by: Tom Chung <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Adjust PHY FSM transition to TX_EN-to-PLL_ON for TMDS
Ryan Seto [Fri, 13 Sep 2024 20:01:47 +0000 (16:01 -0400)]
drm/amd/display: Adjust PHY FSM transition to TX_EN-to-PLL_ON for TMDS

[Why]
If two monitors with TMDS signals were timing synced and one was
disconnected, the stream would go out of sync too early due to
the PLL turning off and the system could hang

[How]
On link disable output, change PHY FSM transition from TX_EN-to-PHY_OFF
to TX_EN-to-PLL_ON for TMDS

Reviewed-by: Wenjing Liu <[email protected]>
Signed-off-by: Ryan Seto <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: 3.2.302
Aric Cyr [Mon, 16 Sep 2024 00:34:33 +0000 (20:34 -0400)]
drm/amd/display: 3.2.302

* Stability fixes in DML, SPL,
* Improvements for MST, DSC, eDP, IPS, HDR
* Fix clock gating on DCN35
* Fixes from static analysis checks
* Other bug fixes and debug improvements

Reviewed-by: Leo Li <[email protected]>
Signed-off-by: Aric Cyr <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in print_ip_state
Sunil Khatri [Wed, 25 Sep 2024 03:26:40 +0000 (08:56 +0530)]
drm/amdgpu: update the handle ptr in print_ip_state

Update the ptr handle to amdgpu_ip_block ptr in all
the functions affected.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Enable idle workqueue for more IPS modes
Leo Li [Wed, 11 Sep 2024 21:27:08 +0000 (17:27 -0400)]
drm/amd/display: Enable idle workqueue for more IPS modes

[Why]

There are more IPS modes other than DMUB_IPS_ENABLE that enables IPS. We
need to enable the hotplug detect idle workqueue for those modes as
well.

[How]

Modify the if condition to initialize the workqueue in all IPS modes
except for DMUB_IPS_DISABLE_ALL.

Fixes: 65444581a4ae ("drm/amd/display: Determine IPS mode by ASIC and PMFW versions")
Signed-off-by: Leo Li <[email protected]>
Reviewed-by: Roman Li <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Wait For DET Update Should Use Current State
Austin Zheng [Thu, 12 Sep 2024 19:34:14 +0000 (15:34 -0400)]
drm/amd/display: Wait For DET Update Should Use Current State

[Why]
Current state should be used when waiting for DET update
instead of new context.
For any streams decreasing in DET, pipes used in the current state
should be checked since those pipes need to free their DET before
DET can be reallocated.

[How]
Pass in current_state instead of context.
Use pipe from current_state instead of context. This assumes that
pipe in the current_state is an OTG_MASTER pipe if the pipe in the context is an OTG_MASTER pipe.

Reviewed-by: Dillon Varone <[email protected]>
Signed-off-by: Austin Zheng <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Add HDR workaround for specific eDP
Alex Hung [Fri, 6 Sep 2024 17:39:18 +0000 (11:39 -0600)]
drm/amd/display: Add HDR workaround for specific eDP

[WHY & HOW]
Some eDP panels suffer from flicking when HDR is enabled in KDE. This
quirk works around it by skipping VSC that is incompatible with eDP
panels.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3151
Cc: Mario Limonciello <[email protected]>
Cc: Alex Deucher <[email protected]>
Reviewed-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Clip rect size changes should be full updates
Joshua Aberback [Thu, 12 Sep 2024 22:47:22 +0000 (18:47 -0400)]
drm/amd/display: Clip rect size changes should be full updates

[Why]
In cases where an MPO plane is being dragged around partially off-screen,
it is possible to get a flip where the only scaling parameters to change
are the clip rect size and position. Currently, clip rect size changes
are considered medium updates, which can result in the clip rect being used
for HW programming being larger than the clip rect that was used for the
last DML validation. This can lead to mismatches in different parts of the
pipe and can result in a p-state hang.

[How]
 - consider clip rect size changes scaling changes, therefore full updates
 - refactor get_scaling_info_update_type for clarity
 - remove clip_size_change update flag

Clip rect size changes were previously demoted from full updates as an
optimization when the MPO + ODM policy changed to always pre-allocate MPO
pipes, but it created the issue described above. Personally testing this
use case, the performance feels fine with full update spam, and we expect
this is a fairly infrequent use case. If the performance needs to be
optimized in the future, consider reworking the entire update type logic
to run a DML pass and determine the update type based on what DML says
will actually change.

Reviewed-by: Dillon Varone <[email protected]>
Signed-off-by: Joshua Aberback <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Fix cursor visual confirm update
Ilya Bakoulin [Thu, 12 Sep 2024 18:31:13 +0000 (14:31 -0400)]
drm/amd/display: Fix cursor visual confirm update

[Why/How]
Certain transitions from HW to SW cursor can be missed, which will
result in black visual confirm instead of expected blue/red. Need to add
handling for cursor visual confirm to dc_update_visual_confirm_color.

Reviewed-by: Alvin Lee <[email protected]>
Signed-off-by: Ilya Bakoulin <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Update Interface to Check UCLK DPM
Austin Zheng [Tue, 10 Sep 2024 20:41:20 +0000 (16:41 -0400)]
drm/amd/display: Update Interface to Check UCLK DPM

[Why]
Videos using YUV420 format may result in high power being used.
Disabling MPO may result in lower power usage.
Update interface that can be used to check power profile of a dc_state.

[How]
Allow pstate switching in VBlank as last entry in strategy candidates.
Add helper functions that can be used to determine power level:
-get power profile after a dc_state has undergone full validation

Reviewed-by: Aric Cyr <[email protected]>
Signed-off-by: Austin Zheng <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: fix static analysis warnings
Samson Tam [Tue, 10 Sep 2024 05:02:16 +0000 (01:02 -0400)]
drm/amd/display: fix static analysis warnings

[Why & How]
Fix static analysis warnings in SPL library

Reviewed-by: Alvin Lee <[email protected]>
Signed-off-by: Samson Tam <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: correct register Clock Gater incorrectly disabled
Charlene Liu [Thu, 12 Sep 2024 00:35:39 +0000 (20:35 -0400)]
drm/amd/display: correct register Clock Gater incorrectly disabled

[why]
The "dpp35_dppclk_control" routine is incorrectly disabling the register clock gater
when the DPP is enabled.

The "DISPCLK_R_GATE_DISABLE" should never be set to 1 in the normal operating mode.
This will disable the clock gater and the DPPCLK register clock branch will always be running.
As a consequence, the dynamic power will be higher than expected.

Reviewed-by: Alvin Lee <[email protected]>
Signed-off-by: Charlene Liu <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: avoid set dispclk to 0
Charlene Liu [Wed, 11 Sep 2024 23:45:09 +0000 (19:45 -0400)]
drm/amd/display: avoid set dispclk to 0

[why]
set dispclk to 0 cause stability issue.

Cc: Mario Limonciello <[email protected]>
Cc: Alex Deucher <[email protected]>
Reviewed-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: Charlene Liu <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Block UHBR Based On USB-C PD Cable ID
Michael Strauss [Tue, 3 Sep 2024 20:23:11 +0000 (16:23 -0400)]
drm/amd/display: Block UHBR Based On USB-C PD Cable ID

[WHY]
Currently the absence of UHBR cable ID caps from USB-C PD does not block UHBR
rates. In situations where DPCD reports valid UHBR capability but USB-C PD
does not, such as using a USB-C to DP1.4 dongle connected to a native DP2.1
cable, link loss and lightup failures can be seen as a result.

Additionally, in edge cases where a platform supports cable ID but DMUB
doesn't correctly return cable ID caps, driver currently also allows UHBR.

[HOW]
Block UHBR rates over DP alt mode if cable id indicates no UHBR support.
Additionally, block UHBR rates if a cable ID supported platform receives no
reply from a DMUB cable id query.

Reviewed-by: Wenjing Liu <[email protected]>
Reviewed-by: Ovidiu Bunea <[email protected]>
Signed-off-by: Michael Strauss <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Set Pipe Unlock Order Outside of HWSEQ
Austin Zheng [Tue, 10 Sep 2024 17:46:50 +0000 (13:46 -0400)]
drm/amd/display: Set Pipe Unlock Order Outside of HWSEQ

[Why]
Current pipe unlock order set within dcn401_interdependent_update_lock.
Separate the logic from the functionality to allow for unit testing
and make it easier to debug.

[How]
Add a flag to indicate if a pipe unlock order should be set.
Create function to determine unlock order.
Indicate which pipes should be unlocked first using
array stored in dc scratch memory.
Pipes indicated in array can be unlocked in any order.

Reviewed-by: Alvin Lee <[email protected]>
Signed-off-by: Austin Zheng <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Change dc_surface_update cm2_params to const
Shunlu Zhang [Tue, 3 Sep 2024 05:08:01 +0000 (01:08 -0400)]
drm/amd/display: Change dc_surface_update cm2_params to const

[WHY]
cm2_params is used to set update_flags.
It's value is not intended to be modified.

[WHAT]
Change the declaration of cm2_params to be a constant variable

Reviewed-by: Tao Huang <[email protected]>
Reviewed-by: Ariel Bernstein <[email protected]>
Signed-off-by: Shunlu Zhang <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Clean up triple buffer enablement code
Sung Lee [Mon, 9 Sep 2024 20:12:55 +0000 (16:12 -0400)]
drm/amd/display: Clean up triple buffer enablement code

[WHY]
Triple buffer enablement currently does not work properly

[HOW]
Allow triple buffer enablement to happen properly on
fast updates

Reviewed-by: Aric Cyr <[email protected]>
Signed-off-by: Sung Lee <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Fix incorrect DSC recompute trigger
Fangzhi Zuo [Wed, 4 Sep 2024 20:56:45 +0000 (16:56 -0400)]
drm/amd/display: Fix incorrect DSC recompute trigger

A stream without dsc_aux should not be eliminated from
the dsc determination. Whether it needs a dsc recompute depends on
whether its mode has changed or not. Eliminating such a no-dsc stream
from the dsc determination policy will end up with inconsistencies
in the new dc_state when compared to the current dc_state,
triggering a dsc recompute that should not have happened.

Reviewed-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Monitor patch to call blank_stream() before otg off
Zhongwei [Tue, 10 Sep 2024 05:28:34 +0000 (13:28 +0800)]
drm/amd/display: Monitor patch to call blank_stream() before otg off

[Why]
Turning off OTG before DIG is on and backlight is on, might cause:

DIG FIFO underflow.
EDP output unexpected video data. That might violate EDP spec.
EDP spec requires black light should be off before validate
video data is turned off.

Currently garbage issue only occurs in one type of EDP to MIPI converter.

[How]
Add monitor patch to call blank_stream() before disable_crtc().
That will be no impact for current sequence.

If there are more types of EDP panels meeting this issue later,
we might remove this monitor patch and fix the current sequence.

Reviewed-by: Nicholas Kazlauskas <[email protected]>
Signed-off-by: Zhongwei <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Wait for all pending cleared before full update
Alvin Lee [Mon, 9 Sep 2024 20:24:05 +0000 (16:24 -0400)]
drm/amd/display: Wait for all pending cleared before full update

[Description]
Before every full update we must wait for all pending updates to be
cleared - this is particularly important for minimal transitions
because if we don't wait for pending cleared, it will be as if
there was no minimal transition at all. In OTG we must read 3 different
status registers for pending cleared, one specifically for OTG updates,
one specifically for OPTC updates, and the last for surface related
updates.

Reviewed-by: Dillon Varone <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: Restore Optimized pbn Value if Failed to Disable DSC
Fangzhi Zuo [Wed, 4 Sep 2024 19:29:24 +0000 (15:29 -0400)]
drm/amd/display: Restore Optimized pbn Value if Failed to Disable DSC

Existing last step of dsc policy is to restore pbn value under minimum compression
when try to greedily disable dsc for a stream failed to fit in MST bw.
Optimized dsc params result from optimization step is not necessarily the minimum compression,
therefore it is not correct to restore the pbn under minimum compression rate.

Restore the pbn under minimum compression instead of the value from optimized pbn could result
in the dsc params not correct at the modeset where atomic_check failed due to not
enough bw. One or more monitors connected could not light up in such case.

Restore the optimized pbn value, instead of using the pbn value under minimum
compression.

Cc: Mario Limonciello <[email protected]>
Cc: Alex Deucher <[email protected]>
Reviewed-by: Wayne Lin <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: disable adaptive scaler and sharpener when integer scaling is enabled
Samson Tam [Fri, 6 Sep 2024 07:28:47 +0000 (03:28 -0400)]
drm/amd/display: disable adaptive scaler and sharpener when integer scaling is enabled

[Why & How]
When integer scaling is enabled, set taps to 1 and disable adaptive
 scaler and sharpener.

Reviewed-by: Jun Lei <[email protected]>
Signed-off-by: Samson Tam <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: update DML2 policy EnhancedPrefetchScheduleAccelerationFinal DCN35
Yihan Zhu [Sat, 7 Sep 2024 17:25:19 +0000 (13:25 -0400)]
drm/amd/display: update DML2 policy EnhancedPrefetchScheduleAccelerationFinal DCN35

[WHY & HOW]
Mismatch in DCN35 DML2 cause bw validation failed to acquire unexpected DPP pipe to cause
grey screen and system hang. Remove EnhancedPrefetchScheduleAccelerationFinal value override
to match HW spec.

Cc: Mario Limonciello <[email protected]>
Cc: Alex Deucher <[email protected]>
Reviewed-by: Charlene Liu <[email protected]>
Signed-off-by: Yihan Zhu <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Add sysfs nodes to get xcp details
Lijo Lazar [Mon, 9 Sep 2024 08:47:17 +0000 (14:17 +0530)]
drm/amdgpu: Add sysfs nodes to get xcp details

Add partition config nodes in sysfs to get resource instance details for
a particular partition mode. A resource could be anything like an xcc,
vcn decoder, system dma units etc.

Details of various resource instances are available under
/sys/bus/pci/devices/.../compute_partition_config/

Select a partition configuration:
/sys/bus/pci/devices/.../compute_partition_config/xcp_config

Number of instances of a resource:
/sys/bus/pci/devices/.../compute_partition_config/<rsrc_name>/num_inst

Total partitions sharing the resource:
/sys/bus/pci/devices/.../compute_partition_config/<rsrc_name>/num_shared

v2: Update node name as per spec

Signed-off-by: Lijo Lazar <[email protected]>
Signed-off-by: Asad Kamal <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: update the handle ptr in dump_ip_state
Sunil Khatri [Tue, 24 Sep 2024 16:00:17 +0000 (21:30 +0530)]
drm/amdgpu: update the handle ptr in dump_ip_state

Update the ptr handle to amdgpu_ip_block ptr in all
the functions.

Signed-off-by: Sunil Khatri <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu/sdma5: split out per instance resume function
Jiadong Zhu [Fri, 20 Sep 2024 01:45:42 +0000 (09:45 +0800)]
drm/amdgpu/sdma5: split out per instance resume function

Extract the resume sequence from sdma_v5_0_gfx_resume for
starting/restarting an individual instance.

Signed-off-by: Jiadong Zhu <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdkfd: Remove an unused parameter in queue creation
Lang Yu [Mon, 23 Sep 2024 08:59:42 +0000 (16:59 +0800)]
drm/amdkfd: Remove an unused parameter in queue creation

struct file *f is unused in queue creation, remove it.

Signed-off-by: Lang Yu <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agoRevert "drm/amd/display: change the panel power savings level without a modeset"
Leo Li [Mon, 9 Sep 2024 20:15:23 +0000 (16:15 -0400)]
Revert "drm/amd/display: change the panel power savings level without a modeset"

This reverts commit 8d20a066fa9beb1ec559b12945414a51d17d07e5.

It's causing a failure in the abm_gradual igt test.

Signed-off-by: Leo Li <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: change the panel power savings level without a modeset
Hamza Mahfooz [Fri, 9 Aug 2024 20:42:53 +0000 (16:42 -0400)]
drm/amd/display: change the panel power savings level without a modeset

We don't actually need to request that the compositor does a full
modeset to modify the panel power savings level, we can instead
just make a request to DMUB, to set the new level dynamically.

Cc: Harry Wentland <[email protected]>
Cc: Leo Li <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Sebastian Wick <[email protected]>
Signed-off-by: Hamza Mahfooz <[email protected]>
Tested-by: Mario Limonciello <[email protected]>
Reviewed-by: Mario Limonciello <[email protected]>
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3578
Signed-off-by: Mario Limonciello <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Add PSP reload case to reset-on-init
Lijo Lazar [Mon, 2 Sep 2024 05:58:34 +0000 (11:28 +0530)]
drm/amdgpu: Add PSP reload case to reset-on-init

A reset on initialization will be needed if a new PSP TOS needs to be
loaded than the one currently active on the system. This is possible
only on SOCs which support a full device reset which results in unload
of active PSP TOS.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Acked-by: Rajneesh Bhardwaj <[email protected]>
Tested-by: Rajneesh Bhardwaj <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Add interface for TOS reload cases
Lijo Lazar [Mon, 2 Sep 2024 05:50:22 +0000 (11:20 +0530)]
drm/amdgpu: Add interface for TOS reload cases

Add interface to check if a different TOS needs to be loaded than the
one which is which is already active on the SOC. Presently the interface
is restricted to specific variants of PSPv13.0.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Acked-by: Rajneesh Bhardwaj <[email protected]>
Tested-by: Rajneesh Bhardwaj <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Support reset-on-init on select SOCs
Lijo Lazar [Mon, 2 Sep 2024 06:04:39 +0000 (11:34 +0530)]
drm/amdgpu: Support reset-on-init on select SOCs

Add XGMI reset on init support to aldebaran and SOCs with GC v9.4.3.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Acked-by: Rajneesh Bhardwaj <[email protected]>
Tested-by: Rajneesh Bhardwaj <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Drop delayed reset work handler
Lijo Lazar [Mon, 2 Sep 2024 06:22:26 +0000 (11:52 +0530)]
drm/amdgpu: Drop delayed reset work handler

Drop delayed reset work handler as it is no longer used.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Acked-by: Rajneesh Bhardwaj <[email protected]>
Tested-by: Rajneesh Bhardwaj <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Refactor XGMI reset on init handling
Lijo Lazar [Mon, 26 Aug 2024 13:22:14 +0000 (18:52 +0530)]
drm/amdgpu: Refactor XGMI reset on init handling

Use XGMI hive information to rely on resetting XGMI devices on
initialization rather than using mgpu structure. mgpu structure may have
other devices as well.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Acked-by: Rajneesh Bhardwaj <[email protected]>
Tested-by: Rajneesh Bhardwaj <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Add helper to initialize badpage info
Lijo Lazar [Fri, 30 Aug 2024 05:51:43 +0000 (11:21 +0530)]
drm/amdgpu: Add helper to initialize badpage info

Add a separate function to read badpage data during initialization.
Reading bad pages will need hardware access and cannot be done during
reset. Hence in cases where device needs a full reset during
init itself, attempting to read will cause a deadlock.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Acked-by: Rajneesh Bhardwaj <[email protected]>
Tested-by: Rajneesh Bhardwaj <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Remove unused amdgpu_i2c functions
Dr. David Alan Gilbert [Mon, 23 Sep 2024 01:24:46 +0000 (02:24 +0100)]
drm/amdgpu: Remove unused amdgpu_i2c functions

amdgpu_i2c_add and amdgpu_i2c_init were added in 2015's commit
d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)")
but never used.

Remove them.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Remove unused amdgpu_gfx_bit_to_me_queue
Dr. David Alan Gilbert [Mon, 23 Sep 2024 01:24:45 +0000 (02:24 +0100)]
drm/amdgpu: Remove unused amdgpu_gfx_bit_to_me_queue

amdgpu_gfx_bit_to_me_queue has been unused since it was added in
commit 7470bfcf2014 ("drm/amdgpu: add helper function for gfx queue/bitmap
transition")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Remove unused amdgpu_gmc_vram_cpu_pa
Dr. David Alan Gilbert [Mon, 23 Sep 2024 01:24:44 +0000 (02:24 +0100)]
drm/amdgpu: Remove unused amdgpu_gmc_vram_cpu_pa

amdgpu_gmc_vram_cpu_pa has been unused since commit
087451f372bf ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Remove unused amdgpu_atpx functions
Dr. David Alan Gilbert [Mon, 23 Sep 2024 01:24:43 +0000 (02:24 +0100)]
drm/amdgpu: Remove unused amdgpu_atpx functions

amdgpu_atpx_dgpu_req_power_for_displays has been unused since
commit bdb1ccb080da ("drm/amdgpu: remove ATPX_DGPU_REQ_POWER_FOR_DISPLAYS
check when hotplug-in")

amdgpu_atpx_get_dhandle has been unused since commit
f9b7f3703ff9 ("drm/amdgpu/acpi: make ATPX/ATCS structures global (v2)")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Remove unused amdgpu_device_ip_is_idle
Dr. David Alan Gilbert [Mon, 23 Sep 2024 01:24:42 +0000 (02:24 +0100)]
drm/amdgpu: Remove unused amdgpu_device_ip_is_idle

amdgpu_device_ip_is_idle is unused.
It was renamed from 'amdgpu_is_idle' which was originally added in
commit 5dbbb60ba61e ("drm/amdgpu: add IP helpers for wait_for_idle and is_idle")

but hasn't been used.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Add reset on init handler for XGMI
Lijo Lazar [Wed, 21 Aug 2024 06:10:16 +0000 (11:40 +0530)]
drm/amdgpu: Add reset on init handler for XGMI

In some cases, device needs to be reset before first use. Add handlers
for doing device reset during driver init sequence.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Acked-by: Rajneesh Bhardwaj <[email protected]>
Tested-by: Rajneesh Bhardwaj <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd/display: fix typos in several function pointer checks
Vitaliy Shevtsov [Fri, 20 Sep 2024 21:43:40 +0000 (02:43 +0500)]
drm/amd/display: fix typos in several function pointer checks

Fix several copypaste mistakes in *_disable_link_output() functions where
an improper function pointer is checked before dereference.

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

Signed-off-by: Vitaliy Shevtsov <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Add callback get xcp resource info
Lijo Lazar [Mon, 9 Sep 2024 12:08:24 +0000 (17:38 +0530)]
drm/amdgpu: Add callback get xcp resource info

Add a callback interface to get the resource information of a partition
mode. Presently the information has number of resources and number of
entities sharing the resource.

Add the implementation for aquavanjaram SOCs.

Signed-off-by: Lijo Lazar <[email protected]>
Signed-off-by: Asad Kamal <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amd: Add helper to get partition config modes
Lijo Lazar [Tue, 17 Sep 2024 08:24:11 +0000 (16:24 +0800)]
drm/amd: Add helper to get partition config modes

Add helper to get supported/available partition config modes

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu: Fix typo "acccess" and improve the comment style here
WangYuli [Fri, 20 Sep 2024 02:27:55 +0000 (10:27 +0800)]
drm/amdgpu: Fix typo "acccess" and improve the comment style here

There are some spelling mistakes of 'acccess' in comments which
should be instead of 'access'.

And the comment style should be like this:
 /*
  * Text
  * Text
  */

Suggested-by: Christian König <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/
Acked-by: Thomas Zimmermann <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/
Reviewed-by: Christian König <[email protected]>
Signed-off-by: WangYuli <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu/gfx9: Explicitly halt CP before init
Alex Deucher [Mon, 16 Sep 2024 17:21:02 +0000 (13:21 -0400)]
drm/amdgpu/gfx9: Explicitly halt CP before init

Need to make sure it's halted as we don't know what state
the GPU may have been left in previously.

Reviewed-by: Srinivasan Shanmugam <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
5 months agodrm/amdgpu/gfx9: set additional bits on CP halt
Alex Deucher [Mon, 16 Sep 2024 17:16:53 +0000 (13:16 -0400)]
drm/amdgpu/gfx9: set additional bits on CP halt

Need to set the pipe reset and cache invalidation bits
on halt otherwise we can get stale state if the CP firmware
changes (e.g., on module unload and reload).

Reviewed-by: Srinivasan Shanmugam <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
This page took 0.105939 seconds and 4 git commands to generate.