Skip to content

drm/amd: fix DCN3.2 flicker/hangs after OD_MCLK (VRAM overclock)

Ilya Shidlovskiy amd-gfx 2 versions – Applied

Status from this message: Applied the series. Thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyApplied
  2. v23 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- Rebased on top of Kevin Wang's "preserve committed OD features" patches for SMU 13.0.0/13.0.7 and 14.0.2. v2 was based on an older amd-staging-drm-next that did not have them yet, so it did not apply; sorry about the wrong confirmation earlier. Only patch 2/3 needed a conflict resolution: the UCLK check now uses Kevin's next_mask, with the same logic as before (details in the patch notes). Kenneth, please double-check that your Reviewed-by still holds for it.
- Added Kenneth's Reviewed-by.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/3drm/amd/display: dcn32: rebuild WM range table when memclk states changedrivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c+4 -40 replies
2/3drm/amd/pm: smu13.0.0: refresh the UCLK DPM table after an OD_MCLK changedrivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c+49 -00 replies
3/3drm/amd: let DC re-read UCLK DPM levels after an OD_MCLK changedrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h drivers/gpu/drm/amd/display/dc/core/dc.c +3 more+72 -00 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchKenneth FengLeo Li
1/3R-b A-b
2/3R-b
3/3R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/3] drm/amd: fix DCN3.2 flicker/hangs after OD_MCLK (VRAM overclock)

On DCN3.2 (Navi31, RX 7900 GRE here), raising the UCLK max through OD_MCLK makes the display flicker (full-width stripes) and eventually hang the whole system, if the current mode does not allow memory P-state switching. DC reads the UCLK DPM levels from PMFW only in init_hw, so after the OD commit it keeps asking for the old top level as UCLK hard min ("set UCLK min = max"). That is no longer the top level, so PMFW switches UCLK outside of vblank.

The series makes DC re-read the UCLK levels (bounding box and WM ranges included) after an OD commit/restore that changed UCLK, and on resume after the user OD settings are restored. It also refreshes the SMU driver's UCLK DPM table, so pp_dpm_mclk shows the real levels.

Bug report and review of v1: https://gitlab.freedesktop.org/drm/amd/-/issues/6009
(v1 was posted there as a comment, not to the list.)

Changes in v3:
- Rebased on top of Kevin Wang's "preserve committed OD features" patches for SMU 13.0.0/13.0.7 and 14.0.2. v2 was based on an older amd-staging-drm-next that did not have them yet, so it did not apply; sorry about the wrong confirmation earlier. Only patch 2/3 needed a conflict resolution: the UCLK check now uses Kevin's next_mask, with the same logic as before (details in the patch notes). Kenneth, please double-check that your Reviewed-by still holds for it.
- Added Kenneth's Reviewed-by.

Changes in v2:
- Only act when the user has customized UCLK (user_od_feature_mask & PP_OD_FEATURE_UCLK_BIT), instead of on every OD commit (Kenneth). PP_OD_FEATURE_UCLK_BIT is ASIC specific, so the check is done in the smu13.0.0 code, which sets a flag that the generic code reads.
- The SMU patch now comes before the DC patch, which depends on it.
- Rebased on amd-staging-drm-next.
- Added Leo's ack for the display parts.

Testing:
v3 is build-tested (W=1, no new warnings) against amd-staging-drm-next ba496bb83, which includes Kevin's patches. The hardware test is on an equivalent backport to the Ubuntu 7.3.0-9 kernel (same code, plus a small local backport of the user_od_feature_mask tracking, which Ubuntu 7.3 does not have yet).

Hardware: RX 7900 GRE (Navi31, SMU 13.0.0), 5120x1440@144 (DSC, ODM 4:1)
+ 2560x1440@100, UCLK OD max 1124 -> 1300 MHz, toggled via LACT.

v1 results:
- On OD commit, DC logs the new max UCLK (1300 MHz). pp_dpm_mclk shows 1300 as the top level, and the current level stays at 1300 (20/20 samples, no drops to 772).
- About 4 minutes of heavy window switching on the 5120x1440@144 output:
no stripes, no hang, no amdgpu errors.
- 3 OC on/off toggles: one short flash exactly at the switch (memory retraining during scanout, expected), then clean.
- Same scenario with the stock module: stripes, then a full system hang.

v2 results:
v2 hardware test (same RX 7900 GRE, 5120x1440@144 + 2560x1440@100; v2 backported to the Ubuntu 7.3.0-9 amdgpu, LACT applying power cap / voltage offset at boot):
- boot and login with stock VRAM: no "DC memclk states refreshed" at all, so non-UCLK OD commits (power cap, voltage offset) no longer touch DC; the short login flash seen with v1 is gone;
- VRAM OC on (OD_MCLK 1300): exactly one refresh, "max UCLK 1300 MHz"; pp_dpm_mclk top level 1300 and current level 1300 (12/12 samples);
- VRAM OC off: exactly one refresh, "max UCLK 1124 MHz";
- desktop stays clean, no stripes, no hangs.

Known limitations (unchanged from v1):
- The OD commit itself still happens during scanout, hence the single flash at the switch.
- Only DCN3.2/SMU 13.0.0 is handled. Other ASICs with OD_MCLK probably need the same hook in their ppt code.

Ilya Shidlovskiy (3):
drm/amd/display: dcn32: rebuild WM range table when memclk states
change
drm/amd/pm: smu13.0.0: refresh the UCLK DPM table after an OD_MCLK
change
drm/amd: let DC re-read UCLK DPM levels after an OD_MCLK change

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 33 +++++++++++++++++++
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |  6 ++++
 .../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c  |  8 ++---
 drivers/gpu/drm/amd/display/dc/core/dc.c      | 21 ++++++++++++
 drivers/gpu/drm/amd/display/dc/dc.h           |  2 ++
 drivers/gpu/drm/amd/pm/amdgpu_dpm.c           |  7 ++++
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c     | 19 +++++++++++
 drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h |  3 ++
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c  | 30 +++++++++++++++++
 9 files changed, 125 insertions(+), 4 deletions(-)

base-commit: ba496bb837882eb1af58f41572fc289e46c77b8c

Signature · 1 line
2.55.0