Commit 17e68f89 authored by Leo Li's avatar Leo Li Committed by Alex Deucher

drm/amd/display: Run idle optimizations at end of vblank handler

[Why & How]
1. After allowing idle optimizations, hw programming is disallowed.
2. Before hw programming, we need to disallow idle optimizations.

Otherwise, in scenario 1, we will immediately kick hw out of idle
optimizations with register access.

Scenario 2 is less of a concern, since any register access will kick
hw out of idle optimizations. But we'll do it early for correctness.
Signed-off-by: default avatarLeo Li <sunpeng.li@amd.com>
Reviewed-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarRodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7fb363c5
......@@ -251,9 +251,10 @@ static void amdgpu_dm_crtc_vblank_control_worker(struct work_struct *work)
else if (dm->active_vblank_irq_count)
dm->active_vblank_irq_count--;
dc_allow_idle_optimizations(dm->dc, dm->active_vblank_irq_count == 0);
DRM_DEBUG_KMS("Allow idle optimizations (MALL): %d\n", dm->active_vblank_irq_count == 0);
if (dm->active_vblank_irq_count > 0) {
DRM_DEBUG_KMS("Allow idle optimizations (MALL): false\n");
dc_allow_idle_optimizations(dm->dc, false);
}
/*
* Control PSR based on vblank requirements from OS
......@@ -272,6 +273,11 @@ static void amdgpu_dm_crtc_vblank_control_worker(struct work_struct *work)
vblank_work->stream->link->replay_settings.replay_feature_enabled);
}
if (dm->active_vblank_irq_count == 0) {
DRM_DEBUG_KMS("Allow idle optimizations (MALL): true\n");
dc_allow_idle_optimizations(dm->dc, true);
}
mutex_unlock(&dm->dc_lock);
dc_stream_release(vblank_work->stream);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment