Skip to content

Commit 874697e

Browse files
John Olenderalexdeucher
John Olender
authored andcommitted
drm/amd/display: Defer BW-optimization-blocked DRR adjustments
[Why & How] Instead of dropping DRR updates, defer them. This fixes issues where monitor continues to see incorrect refresh rate after VRR was turned off by userspace. Fixes: 3295348 ("drm/amd/display: Do not update DRR while BW optimizations pending") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3546 Reviewed-by: Sun peng Li <[email protected]> Signed-off-by: John Olender <[email protected]> Signed-off-by: Aurabindo Pillai <[email protected]> Signed-off-by: Ray Wu <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 53761b7) Cc: [email protected]
1 parent 190818d commit 874697e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ get_crtc_by_otg_inst(struct amdgpu_device *adev,
372372
static inline bool is_dc_timing_adjust_needed(struct dm_crtc_state *old_state,
373373
struct dm_crtc_state *new_state)
374374
{
375+
if (new_state->stream->adjust.timing_adjust_pending)
376+
return true;
375377
if (new_state->freesync_config.state == VRR_STATE_ACTIVE_FIXED)
376378
return true;
377379
else if (amdgpu_dm_crtc_vrr_active(old_state) != amdgpu_dm_crtc_vrr_active(new_state))

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,12 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
439439
* Don't adjust DRR while there's bandwidth optimizations pending to
440440
* avoid conflicting with firmware updates.
441441
*/
442-
if (dc->ctx->dce_version > DCE_VERSION_MAX)
443-
if (dc->optimized_required || dc->wm_optimized_required)
442+
if (dc->ctx->dce_version > DCE_VERSION_MAX) {
443+
if (dc->optimized_required || dc->wm_optimized_required) {
444+
stream->adjust.timing_adjust_pending = true;
444445
return false;
446+
}
447+
}
445448

446449
dc_exit_ips_for_hw_access(dc);
447450

@@ -3168,7 +3171,8 @@ static void copy_stream_update_to_stream(struct dc *dc,
31683171

31693172
if (update->crtc_timing_adjust) {
31703173
if (stream->adjust.v_total_min != update->crtc_timing_adjust->v_total_min ||
3171-
stream->adjust.v_total_max != update->crtc_timing_adjust->v_total_max)
3174+
stream->adjust.v_total_max != update->crtc_timing_adjust->v_total_max ||
3175+
stream->adjust.timing_adjust_pending)
31723176
update->crtc_timing_adjust->timing_adjust_pending = true;
31733177
stream->adjust = *update->crtc_timing_adjust;
31743178
update->crtc_timing_adjust->timing_adjust_pending = false;

0 commit comments

Comments
 (0)