drm/amd/display: Run idle optimizations at end of vblank handler
BugLink: https://bugs.launchpad.net/bugs/2101042 commit 17e68f89132b9ee4b144358b49e5df404b314181 upstream. [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: Leo Li <sunpeng.li@amd.com> Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
@@ -108,9 +108,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
|
||||
@@ -137,6 +138,11 @@ static void amdgpu_dm_crtc_vblank_control_worker(struct work_struct *work)
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user