]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amd/display: fix DMCU hang when going into Modern Standby
authorZi Yu Liao <ziyu.liao@amd.com>
Thu, 20 Jun 2019 14:55:26 +0000 (10:55 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 18 Jul 2019 19:18:10 +0000 (14:18 -0500)
[why]
When the system is going into suspend, set_backlight gets called
after the eDP got blanked. Since smooth brightness is enabled,
the driver will make a call into the DMCU to ramp the brightness.
The DMCU would try to enable ABM to do so. But since the display is
blanked, this ends up causing ABM1_ACE_DBUF_REG_UPDATE_PENDING to
get stuck at 1, which results in a dead lock in the DMCU firmware.

[how]
Disable brightness ramping when the eDP display is blanked.

Signed-off-by: Zi Yu Liao <ziyu.liao@amd.com>
Reviewed-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link.c

index d685cde284ecb3e22b7530385a4cffe70eccd35a..5852dd512e2eef538fc6163495b2539f47f883b7 100644 (file)
@@ -2352,7 +2352,7 @@ bool dc_link_set_backlight_level(const struct dc_link *link,
                        if (core_dc->current_state->res_ctx.pipe_ctx[i].stream) {
                                if (core_dc->current_state->res_ctx.
                                                pipe_ctx[i].stream->link
-                                               == link)
+                                               == link) {
                                        /* DMCU -1 for all controller id values,
                                         * therefore +1 here
                                         */
@@ -2360,6 +2360,13 @@ bool dc_link_set_backlight_level(const struct dc_link *link,
                                                core_dc->current_state->
                                                res_ctx.pipe_ctx[i].stream_res.tg->inst +
                                                1;
+
+                                       /* Disable brightness ramping when the display is blanked
+                                        * as it can hang the DMCU
+                                        */
+                                       if (core_dc->current_state->res_ctx.pipe_ctx[i].plane_state == NULL)
+                                               frame_ramp = 0;
+                               }
                        }
                }
                abm->funcs->set_backlight_level_pwm(