RE: [PATCH] Revert "drm/amd/display: Use HW lock mgr for PSR1"

2025-02-03 Thread Lin, Wayne
[Public] Feel free to add: Acked-by: Wayne Lin > -Original Message- > From: Tom Chung > Sent: Tuesday, February 4, 2025 3:13 PM > To: amd-gfx@lists.freedesktop.org > Cc: Lin, Wayne ; Li, Sun peng (Leo) > ; Chung, ChiaHsuan (Tom) > > Subject: [PATCH] Revert "drm/amd/display: Use HW lock

Re: [PATCH 06/11] drm/amdgpu/gfx10: manually control gfxoff for CS

2025-02-03 Thread Lazar, Lijo
On 2/4/2025 3:13 AM, Alex Deucher wrote: > Manually disallow and then allow gfxoff in begin_use > and end_use to avoid any potential FW races when > ringing the doorbell. There are no known issues > with gfxoff that this solves, but it shouldn't hurt anything > and shouldn't affect power usage

[PATCH] Revert "drm/amd/display: Use HW lock mgr for PSR1"

2025-02-03 Thread Tom Chung
This reverts commit 2a69ae1e1354 ("drm/amd/display: Use HW lock mgr for PSR1") Because it may cause system hang while connect with two edp panel. Signed-off-by: Tom Chung --- drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --gi

[PATCH 3/3] drm/amd/pm: Remove unnecessary device state checks

2025-02-03 Thread Lijo Lazar
For amdgpu_get_pp_force_state, amdgpu_get_pp_cur_state already takes care of device state check. In other cases, values are returned from driver cached variables and are not dependent on device state. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 14 -- 1 file ch

[PATCH 2/3] drm/amd/pm: Fix get_if_active usage

2025-02-03 Thread Lijo Lazar
If a device supports runtime pm, then pm_runtime_get_if_active returns 0 if a device is not active and 1 if already active. However, if a device doesn't support runtime pm, the API returns -EINVAL. A device not supporting runtime pm implies it's not affected by runtime pm and it's active. Hence no

[PATCH 1/3] drm/amd/pm: Add APIs for device access checks

2025-02-03 Thread Lijo Lazar
Wrap the checks before device access in helper functions and use them for device access. The generic order of APIs now is to do input argument validation first and check if device access is allowed. Signed-off-by: Lijo Lazar --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 616 +++---

Re: [PATCH V2 2/2] drm/amdkfd: use GTT for VRAM on APUs only if GTT is larger

2025-02-03 Thread Mario Limonciello
On 1/31/2025 11:21, Alex Deucher wrote: If the user has configured a large carveout on a small APU, only use GTT for VRAM allocations if GTT is larger than VRAM. v2: fix reversed check (Philip) Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 -- 1 file change

[PATCH 08/11] drm/amdgpu/gfx12: manually control gfxoff for CS

2025-02-03 Thread Alex Deucher
Manually disallow and then allow gfxoff in begin_use and end_use to avoid any potential FW races when ringing the doorbell. There are no known issues with gfxoff that this solves, but it shouldn't hurt anything and shouldn't affect power usage since we are only toggling it around the doorbell upda

[PATCH 10/11] drm/amdgpu/sdma6.0: manually control gfxoff for CS

2025-02-03 Thread Alex Deucher
Manually disallow and then allow gfxoff in begin_use and end_use to avoid any potential FW races when ringing the doorbell. There are no known issues with gfxoff that this solves, but it shouldn't hurt anything and shouldn't affect power usage since we are only toggling it around the doorbell upda

[PATCH 06/11] drm/amdgpu/gfx10: manually control gfxoff for CS

2025-02-03 Thread Alex Deucher
Manually disallow and then allow gfxoff in begin_use and end_use to avoid any potential FW races when ringing the doorbell. There are no known issues with gfxoff that this solves, but it shouldn't hurt anything and shouldn't affect power usage since we are only toggling it around the doorbell upda

[PATCH 04/11] drm/amdgpu/gfx9: use amdgpu_gfx_off_ctrl_immediate() for PG

2025-02-03 Thread Alex Deucher
Use amdgpu_gfx_off_ctrl_immediate() when powergating. There's no need for the delay in gfx off allow. The powergating is dynamically disabled/enabled as for RV/PCO on compute queues and allowing gfx off again as soon the job is submitted improves power savings. Suggested-by: Błażej Szczygieł Lin

[PATCH 07/11] drm/amdgpu/gfx11: manually control gfxoff for CS

2025-02-03 Thread Alex Deucher
Manually disallow and then allow gfxoff in begin_use and end_use to avoid any potential FW races when ringing the doorbell. There are no known issues with gfxoff that this solves, but it shouldn't hurt anything and shouldn't affect power usage since we are only toggling it around the doorbell upda

[PATCH 11/11] drm/amdgpu/sdma7.0: manually control gfxoff for CS

2025-02-03 Thread Alex Deucher
Manually disallow and then allow gfxoff in begin_use and end_use to avoid any potential FW races when ringing the doorbell. There are no known issues with gfxoff that this solves, but it shouldn't hurt anything and shouldn't affect power usage since we are only toggling it around the doorbell upda

[PATCH 05/11] drm/amdgpu/sdma5.2: use amdgpu_gfx_off_ctrl_immediate()

2025-02-03 Thread Alex Deucher
In begin_use/end_use use amdgpu_gfx_off_ctrl_immediate() rather than amdgpu_gfx_off_ctrl() as we don't need the extra delay before we allow gfxoff again. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[PATCH 02/11] drm/amdgpu: bump version for RV/PCO compute fix

2025-02-03 Thread Alex Deucher
Bump the driver version for RV/PCO compute stability fix so mesa can use this check to enable compute queues on RV/PCO. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_

[PATCH 09/11] drm/amdgpu/sdma5.0: manually control gfxoff for CS

2025-02-03 Thread Alex Deucher
Manually disallow and then allow gfxoff in begin_use and end_use to avoid any potential FW races when ringing the doorbell. There are no known issues with gfxoff that this solves, but it shouldn't hurt anything and shouldn't affect power usage since we are only toggling it around the doorbell upda

[PATCH 01/11] drm/amdgpu/gfx9: manually control gfxoff for CS on RV

2025-02-03 Thread Alex Deucher
When mesa started using compute queues more often we started seeing additional hangs with compute queues. Disabling gfxoff seems to mitigate that. Manually control gfxoff and gfx pg with command submissions to avoid any issues related to gfxoff. KFD already does the same thing for these chips. v

[PATCH 03/11] drm/amdgpu/gfx: add amdgpu_gfx_off_ctrl_immediate()

2025-02-03 Thread Alex Deucher
Same as amdgpu_gfx_off_ctrl(), but without the delay for gfxoff disallow. Suggested-by: Błażej Szczygieł Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 53 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 1 + 2 files changed, 41 insertions(+), 13

Re: [PATCH] drm/amdgpu: allow pinning DMA-bufs into VRAM if all importers can do P2P

2025-02-03 Thread James Zhu
On 2025-01-09 11:57, Felix Kuehling wrote: From: Christian König Try pinning into VRAM to allow P2P with RDMA NICs without ODP support if all attachments can do P2P. If any attachment can't do P2P just pin into GTT instead. Signed-off-by: Christian König Signed-off-by: Felix Kuehling Revie

Re: [PATCH 0/7] drm/amd/display: More deadcoding

2025-02-03 Thread Alex Deucher
Applied. Thanks! Alex On Sun, Feb 2, 2025 at 5:08 PM wrote: > > From: "Dr. David Alan Gilbert" > > Another small pile of deadcode patches. > > Signed-off-by: Dr. David Alan Gilbert > > > Dr. David Alan Gilbert (7): > drm/amd/display: Remove unused mpc1_is_mpcc_idle > drm/amd/display: Remo

Re: [PATCH] drm/amd/display: Respect user's CONFIG_FRAME_WARN more for dml files

2025-02-03 Thread Alex Deucher
Applied. Thanks! Alex On Fri, Jan 31, 2025 at 5:38 PM Nathan Chancellor wrote: > > Currently, there are several files in drm/amd/display that aim to have a > higher -Wframe-larger-than value to avoid instances of that warning with > a lower value from the user's configuration. However, with the

[PATCH] drm/amd/display: Replace pr_info in dc_validate_boot_timing()

2025-02-03 Thread Alex Hung
Use DC_LOG_DEBUG instead of pr_info to match other uses in dc.c. Fixes: eb8eec752038 ("drm/amd/display: Add debug messages for dc_validate_boot_timing()") Reviewed-by: Mario Limonciello Signed-off-by: Alex Hung --- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- 1 file changed, 1 insertion(+

Re: [PATCH] drm/amd/pm: Fix get_if_active usage

2025-02-03 Thread Lazar, Lijo
On 2/3/2025 9:36 PM, Alex Deucher wrote: > On Fri, Jan 31, 2025 at 11:53 PM Lijo Lazar wrote: >> >> If a device supports runtime pm, then pm_runtime_get_if_active returns 0 >> if a device is not active and 1 if already active. However, if a device >> doesn't support runtime pm, the API returns

Re: [PATCH] drm/amd/pm: Fix get_if_active usage

2025-02-03 Thread Alex Deucher
On Fri, Jan 31, 2025 at 11:53 PM Lijo Lazar wrote: > > If a device supports runtime pm, then pm_runtime_get_if_active returns 0 > if a device is not active and 1 if already active. However, if a device > doesn't support runtime pm, the API returns -EINVAL. A device not > supporting runtime pm impl

[PATCH] drm/amdgpu/sdma4: drop gfxoff calls in dump ip state

2025-02-03 Thread Alex Deucher
SDMA 4.x is not part of the GFX power domain so this is not necessary. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c index b48d9c0b2e1c3.

RE: [PATCH 00/10] DC Patches Jan 28, 2025

2025-02-03 Thread Wheeler, Daniel
[Public] Hi all, This week this patchset was tested on 4 systems, two dGPU and two APU based, and tested across multiple display and connection types. APU * Single Display eDP -> 1080p 60hz, 2560x1600 120hz, 1920x1200 165hz * Single Display DP (SST DSC) -> 4k144hz, 4k240hz

[PATCH 6.1] drm/amd/display: fix double free issue during amdgpu module unload

2025-02-03 Thread Anastasia Belova
From: Tim Huang [ Upstream commit 20b5a8f9f4670a8503aa9fa95ca632e77c6bf55d ] Flexible endpoints use DIGs from available inflexible endpoints, so only the encoders of inflexible links need to be freed. Otherwise, a double free issue may occur when unloading the amdgpu module. [ 279.190523] RIP:

[PATCH 4/6] drm/amdgpu: rework how isolation is enforced v2

2025-02-03 Thread Christian König
Limiting the number of available VMIDs to enforce isolation causes some issues with gang submit and applying certain HW workarounds which require multiple VMIDs to work correctly. So instead start to track all submissions to the relevant engines in a per partition data structure and use the dma_fe

[PATCH 6/6] drm/amdgpu: stop reserving VMIDs to enforce isolation

2025-02-03 Thread Christian König
That was quite troublesome for gang submit. Completely drop this approach and enforce the isolation separately. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 9 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 11

[PATCH 5/6] drm/amdgpu: rework how the cleaner shader is emitted v2

2025-02-03 Thread Christian König
Instead of emitting the cleaner shader for every job which has the enforce_isolation flag set only emit it for the first submission from every client. v2: add missing NULL check Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 25 - 1 file chan

[PATCH 3/6] drm/amdgpu: overwrite signaled fence in amdgpu_sync

2025-02-03 Thread Christian König
This allows using amdgpu_sync even without peeking into the fences for a long time. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c b/drivers/gp

[PATCH 2/6] drm/amdgpu: use GFP_NOWAIT for memory allocations

2025-02-03 Thread Christian König
In the critical submission path memory allocations can't wait for reclaim since that can potentially wait for submissions to finish. Finally clean that up and mark most memory allocations in the critical path with GFP_NOWAIT. The only exception left is the dma_fence_array() used when no VMID is av

[PATCH 1/6] drm/amdgpu: grab an additional reference on the gang fence

2025-02-03 Thread Christian König
We keep the gang submission fence around in adev, make sure that it stays alive. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev

[PATCH 2/7] drm/amd/display: Remove unused freesync functions

2025-02-03 Thread linux
From: "Dr. David Alan Gilbert" mod_freesync_get_vmin_vmax() and mod_freesync_get_v_position() were added in 2017 by commit 72ada5f76939 ("drm/amd/display: FreeSync Auto Sweep Support") mod_freesync_is_valid_range() was added in 2018 by commit e80e94460841 ("drm/amd/display: add method to check f

[PATCH 7/7] drm/amd/display: Remove unused link_enc_cfg_get_link_enc_used_by_stream

2025-02-03 Thread linux
From: "Dr. David Alan Gilbert" link_enc_cfg_get_link_enc_used_by_stream() is no longer used after 2021's: commit 6366b00346c0 ("drm/amd/display: Maintain consistent mode of operation during encoder assignment") which introduces and uses the _current version instead. Remove it. Signed-off-by: Dr

[PATCH 4/7] drm/amd/display: Remove unused get_clock_requirements_for_state

2025-02-03 Thread linux
From: "Dr. David Alan Gilbert" get_clock_requirements_for_state() was added in 2018 by commit 8ab2180f96f5 ("drm/amd/display: Add function to fetch clock requirements") but never used. Remove it. Signed-off-by: Dr. David Alan Gilbert --- drivers/gpu/drm/amd/display/dc/core/dc.c | 12 -

[Question] amdgpu: mmhub_v3_0_2.c

2025-02-03 Thread Gonzalo Silvalde Blanco
Hello, I was exploring the Linux kernel code and came across the following functions marked with //TODO in mmhub_v3_0_2.c: static void mmhub_v3_0_2_update_medium_grain_clock_gating(struct amdgpu_device *adev, bool enable) { //TODO } static void mmhub_v3_0_2_update_medium_grain_light_sleep(struct

hubbub/hubp, Missing struct assignments???

2025-02-03 Thread Dr. David Alan Gilbert
Hi Charlene, Alex, My scripts spotted that all 3 functions added by the commit dbc2309cac2a ("drm/amd/display: add hubbub_init related") are uncalled, and instead of deadcoding them, I wondered if it's actually a simple bug and they should be assigned somewhere. That patch also added a member

[PATCH] amdgpu: fix edp brightness control on some HP laptops

2025-02-03 Thread poscat
This is a workaround to this issue: https://gitlab.freedesktop.org/drm/amd/-/issues/3701 Signed-off-by: poscat --- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c

[PATCH 6/7] drm/amd/display: Remove unused get_max_support_fbc_buffersize

2025-02-03 Thread linux
From: "Dr. David Alan Gilbert" get_max_support_fbc_buffersize() is unused since 2021's commit 94f0d0c80cf3 ("drm/amd/display/dc/dce110/dce110_compressor: Remove unused function 'dce110_get_required_compressed_surfacesize") removed it's only caller. Remove it. Signed-off-by: Dr. David Alan Gilbe

[PATCH 1/7] drm/amd/display: Remove unused mpc1_is_mpcc_idle

2025-02-03 Thread linux
From: "Dr. David Alan Gilbert" mpc1_is_mpcc_idle() was added in 2017 by commit feb4a3cd8eb0 ("drm/amd/display: Integrating MPC pseudocode") but never used. Remove it. Signed-off-by: Dr. David Alan Gilbert --- .../gpu/drm/amd/display/dc/mpc/dcn10/dcn10_mpc.c | 16 .../gpu/drm/

[PATCH 0/7] drm/amd/display: More deadcoding

2025-02-03 Thread linux
From: "Dr. David Alan Gilbert" Another small pile of deadcode patches. Signed-off-by: Dr. David Alan Gilbert Dr. David Alan Gilbert (7): drm/amd/display: Remove unused mpc1_is_mpcc_idle drm/amd/display: Remove unused freesync functions drm/amd/display: Remove unused dc_stream_get_crtc_p

[PATCH 5/7] drm/amd/display: Remove unused hubbub1_toggle_watermark_change_req

2025-02-03 Thread linux
From: "Dr. David Alan Gilbert" hubbub1_toggle_watermark_change_req() last use was removed in 2017 by commit b8fce2c9d773 ("drm/amd/display: Optimize programming front end") Remove it. Signed-off-by: Dr. David Alan Gilbert --- .../amd/display/dc/hubbub/dcn10/dcn10_hubbub.c | 18 ---

[PATCH 3/7] drm/amd/display: Remove unused dc_stream_get_crtc_position

2025-02-03 Thread linux
From: "Dr. David Alan Gilbert" The last user of dc_stream_get_crtc_position() was mod_freesync_get_v_position() which is removed in a previous patch in this series. Remove it. Signed-off-by: Dr. David Alan Gilbert --- drivers/gpu/drm/amd/display/dc/core/dc.c | 27 -- dri