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

drm/amd/display: fix brightness level after resume from suspend

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>

authored by

Roman Li and committed by
Alex Deucher
c3d7bad8 af2ac326

+18 -1
+13
drivers/gpu/drm/amd/display/dc/core/dc_link.c
··· 1997 1997 return true; 1998 1998 } 1999 1999 2000 + bool dc_link_set_abm_disable(const struct dc_link *link) 2001 + { 2002 + struct dc *core_dc = link->ctx->dc; 2003 + struct abm *abm = core_dc->res_pool->abm; 2004 + 2005 + if ((abm == NULL) || (abm->funcs->set_backlight_level == NULL)) 2006 + return false; 2007 + 2008 + abm->funcs->set_abm_immediate_disable(abm); 2009 + 2010 + return true; 2011 + } 2012 + 2000 2013 bool dc_link_set_psr_enable(const struct dc_link *link, bool enable, bool wait) 2001 2014 { 2002 2015 struct dc *core_dc = link->ctx->dc;
+2
drivers/gpu/drm/amd/display/dc/dc_link.h
··· 132 132 bool dc_link_set_backlight_level(const struct dc_link *dc_link, uint32_t level, 133 133 uint32_t frame_ramp, const struct dc_stream_state *stream); 134 134 135 + bool dc_link_set_abm_disable(const struct dc_link *dc_link); 136 + 135 137 bool dc_link_set_psr_enable(const struct dc_link *dc_link, bool enable, bool wait); 136 138 137 139 bool dc_link_get_psr_state(const struct dc_link *dc_link, uint32_t *psr_state);
+3 -1
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
··· 1016 1016 struct dc_stream_state *stream = pipe_ctx->stream; 1017 1017 struct dc_link *link = stream->sink->link; 1018 1018 1019 - if (link->local_sink && link->local_sink->sink_signal == SIGNAL_TYPE_EDP) 1019 + if (link->local_sink && link->local_sink->sink_signal == SIGNAL_TYPE_EDP) { 1020 1020 link->dc->hwss.edp_backlight_control(link, false); 1021 + dc_link_set_abm_disable(link); 1022 + } 1021 1023 1022 1024 if (dc_is_dp_signal(pipe_ctx->stream->signal)) 1023 1025 pipe_ctx->stream_res.stream_enc->funcs->dp_blank(pipe_ctx->stream_res.stream_enc);