OSDN Git Service

drm/amd/display: Get backlight from PWM if DMCU is not initialized
authorHarry Wentland <harry.wentland@amd.com>
Mon, 16 Aug 2021 19:57:12 +0000 (15:57 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 14 Sep 2021 19:57:10 +0000 (15:57 -0400)
commit9e0d55ae545f4a8f4c00339ad97ee2ef9e8e06ff
tree64d28d8ac508b6b5caef1d6cc32fb22b2e254896
parent7b89bf83181363a84f86da787159ddbbef505b8c
drm/amd/display: Get backlight from PWM if DMCU is not initialized

On Carrizo/Stoney systems we set backlight through panel_cntl, i.e.
directly via the PWM registers, if DMCU is not initialized. We
always read it back through ABM registers which leads to a
mismatch and forces atomic_commit to program the backlight
each time.

Instead make sure we use the same logic for backlight readback,
i.e. read it from panel_cntl if DMCU is not initialized.

We also need to remove some extraneous and incorrect calculations
at the end of dce_get_16_bit_backlight_from_pwm.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1666
Cc: stable@vger.kernel.org
Reviewed-by: Josip Pavic <josip.pavic@amd.com>
Acked-by: Mikita Lipski <mikita.lipski@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@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/dce/dce_panel_cntl.c