]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd/display: fix brightness level after resume from suspend
authorRoman Li <Roman.Li@amd.com>
Thu, 29 Mar 2018 14:56:17 +0000 (10:56 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 May 2018 18:43:22 +0000 (13:43 -0500)
Adding missing call to cache current backlight values.
Otherwise the brightness resets to default value on resume.

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link.c
drivers/gpu/drm/amd/display/dc/dc_link.h
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c

index 0cd286f8eaa0200f9259ad84c6ac5194a4a48950..b44cf52090a5bb77fb73f3685ccd2c440b941593 100644 (file)
@@ -2018,6 +2018,19 @@ bool dc_link_set_backlight_level(const struct dc_link *link, uint32_t level,
        return true;
 }
 
+bool dc_link_set_abm_disable(const struct dc_link *link)
+{
+       struct dc  *core_dc = link->ctx->dc;
+       struct abm *abm = core_dc->res_pool->abm;
+
+       if ((abm == NULL) || (abm->funcs->set_backlight_level == NULL))
+               return false;
+
+       abm->funcs->set_abm_immediate_disable(abm);
+
+       return true;
+}
+
 bool dc_link_set_psr_enable(const struct dc_link *link, bool enable, bool wait)
 {
        struct dc  *core_dc = link->ctx->dc;
index eeff9874129330b55f8bc0225d5eaaf9497f14fe..8a716baa1203bdcd7b85f912aa6a22d523f57a5e 100644 (file)
@@ -141,6 +141,8 @@ static inline struct dc_link *dc_get_link_at_index(struct dc *dc, uint32_t link_
 bool dc_link_set_backlight_level(const struct dc_link *dc_link, uint32_t level,
                uint32_t frame_ramp, const struct dc_stream_state *stream);
 
+bool dc_link_set_abm_disable(const struct dc_link *dc_link);
+
 bool dc_link_set_psr_enable(const struct dc_link *dc_link, bool enable, bool wait);
 
 bool dc_link_get_psr_state(const struct dc_link *dc_link, uint32_t *psr_state);
index 68a182ce53c795d1ff45ad04c46b8020ec8a77cf..15897f0a9616ba8357c8d1be21d6c9303ef0e8db 100644 (file)
@@ -1046,8 +1046,10 @@ void dce110_blank_stream(struct pipe_ctx *pipe_ctx)
        struct dc_stream_state *stream = pipe_ctx->stream;
        struct dc_link *link = stream->sink->link;
 
-       if (link->local_sink && link->local_sink->sink_signal == SIGNAL_TYPE_EDP)
+       if (link->local_sink && link->local_sink->sink_signal == SIGNAL_TYPE_EDP) {
                link->dc->hwss.edp_backlight_control(link, false);
+               dc_link_set_abm_disable(link);
+       }
 
        if (dc_is_dp_signal(pipe_ctx->stream->signal))
                pipe_ctx->stream_res.stream_enc->funcs->dp_blank(pipe_ctx->stream_res.stream_enc);