Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: set clocks to 0 on suspend on dce80

[Why]
When a dce80 asic was suspended, the clocks were not set to 0.
Upon resume, the new clock was compared to the existing clock,
they were found to be the same, and so the clock was not set.
This resulted in a blackscreen.

[How]
In atomic commit, check to see if there are any active pipes.
If no, set clocks to 0

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org

authored by

Bhawanpreet Lakha and committed by
Alex Deucher
4ece61a2 9f7ddbea

+16 -3
+16 -3
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c
··· 790 790 struct dc *dc, 791 791 struct dc_state *context) 792 792 { 793 - /* TODO implement when needed but for now hardcode max value*/ 794 - context->bw.dce.dispclk_khz = 681000; 795 - context->bw.dce.yclk_khz = 250000 * MEMORY_TYPE_MULTIPLIER_CZ; 793 + int i; 794 + bool at_least_one_pipe = false; 795 + 796 + for (i = 0; i < dc->res_pool->pipe_count; i++) { 797 + if (context->res_ctx.pipe_ctx[i].stream) 798 + at_least_one_pipe = true; 799 + } 800 + 801 + if (at_least_one_pipe) { 802 + /* TODO implement when needed but for now hardcode max value*/ 803 + context->bw.dce.dispclk_khz = 681000; 804 + context->bw.dce.yclk_khz = 250000 * MEMORY_TYPE_MULTIPLIER_CZ; 805 + } else { 806 + context->bw.dce.dispclk_khz = 0; 807 + context->bw.dce.yclk_khz = 0; 808 + } 796 809 797 810 return true; 798 811 }