Skip to content

Commit b231933

Browse files
Iswara Nagulendranalexdeucher
authored andcommitted
drm/amd/display: Read before writing Backlight Mode Set Register
[HOW&WHY] Reading the value from DP_EDP_BACKLIGHT_MODE_SET_REGISTER, DPCD 0x721 before setting the BP_EDP_PANEL_LUMINANC_CONTROL_ENABLE bit to ensure there are no accidental overwrites. Reviewed-by: Sreeja Golui <sreeja.golui@amd.com> Reviewed-by: Harry Vanzylldejong <harry.vanzylldejong@amd.com> Acked-by: Roman Li <roman.li@amd.com> Signed-off-by: Iswara Nagulendran <iswara.nagulendran@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 1b9ec7c commit b231933

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ bool edp_set_backlight_level_nits(struct dc_link *link,
182182
&backlight_control, 1) != DC_OK)
183183
return false;
184184
} else {
185-
const uint8_t backlight_enable = DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE;
185+
uint8_t backlight_enable = 0;
186186
struct target_luminance_value *target_luminance = NULL;
187187

188188
//if target luminance value is greater than 24 bits, clip the value to 24 bits
@@ -191,6 +191,11 @@ bool edp_set_backlight_level_nits(struct dc_link *link,
191191

192192
target_luminance = (struct target_luminance_value *)&backlight_millinits;
193193

194+
core_link_read_dpcd(link, DP_EDP_BACKLIGHT_MODE_SET_REGISTER,
195+
&backlight_enable, sizeof(uint8_t));
196+
197+
backlight_enable |= DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE;
198+
194199
if (core_link_write_dpcd(link, DP_EDP_BACKLIGHT_MODE_SET_REGISTER,
195200
&backlight_enable,
196201
sizeof(backlight_enable)) != DC_OK)

0 commit comments

Comments
 (0)