Skip to content

Commit 53761b7

Browse files
John Olenderalexdeucher
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]>
1 parent 9334c49 commit 53761b7

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
@@ -374,6 +374,8 @@ get_crtc_by_otg_inst(struct amdgpu_device *adev,
374374
static inline bool is_dc_timing_adjust_needed(struct dm_crtc_state *old_state,
375375
struct dm_crtc_state *new_state)
376376
{
377+
if (new_state->stream->adjust.timing_adjust_pending)
378+
return true;
377379
if (new_state->freesync_config.state == VRR_STATE_ACTIVE_FIXED)
378380
return true;
379381
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
@@ -441,9 +441,12 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
441441
* Don't adjust DRR while there's bandwidth optimizations pending to
442442
* avoid conflicting with firmware updates.
443443
*/
444-
if (dc->ctx->dce_version > DCE_VERSION_MAX)
445-
if (dc->optimized_required || dc->wm_optimized_required)
444+
if (dc->ctx->dce_version > DCE_VERSION_MAX) {
445+
if (dc->optimized_required || dc->wm_optimized_required) {
446+
stream->adjust.timing_adjust_pending = true;
446447
return false;
448+
}
449+
}
447450

448451
dc_exit_ips_for_hw_access(dc);
449452

@@ -3241,7 +3244,8 @@ static void copy_stream_update_to_stream(struct dc *dc,
32413244

32423245
if (update->crtc_timing_adjust) {
32433246
if (stream->adjust.v_total_min != update->crtc_timing_adjust->v_total_min ||
3244-
stream->adjust.v_total_max != update->crtc_timing_adjust->v_total_max)
3247+
stream->adjust.v_total_max != update->crtc_timing_adjust->v_total_max ||
3248+
stream->adjust.timing_adjust_pending)
32453249
update->crtc_timing_adjust->timing_adjust_pending = true;
32463250
stream->adjust = *update->crtc_timing_adjust;
32473251
update->crtc_timing_adjust->timing_adjust_pending = false;

0 commit comments

Comments
 (0)