drm/amd/display: Expand dc to use 16.16 bit backlight

[Why] We want to increase precision for backlight setting.
But DC interface takes 8 bit backlight level value only.

[How] DMCU already takes 16 bit backlight level.
Expand the DC interface to take 16.16 bit value.
Max 32 bit backlight value (0xFFFF) will represent
max backlight (100%)

Signed-off-by: Anthony Koo <Anthony.Koo@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Anthony Koo
2018-10-12 21:34:32 -04:00
committed by Alex Deucher
parent a7d8084b58
commit 262485a50f
7 changed files with 80 additions and 79 deletions

View File

@@ -1580,8 +1580,14 @@ static int amdgpu_dm_backlight_update_status(struct backlight_device *bd)
*/
if (bd->props.brightness < 1)
return 1;
/* backlight_pwm_u16_16 parameter is in unsigned 32 bit, 16 bit integer
* and 16 bit fractional, where 1.0 is max backlight value.
* bd->props.brightness is 8 bit format and needs to be converted by
* scaling via copy lower byte to upper byte of 16 bit value.
*/
if (dc_link_set_backlight_level(dm->backlight_link,
bd->props.brightness, 0, 0))
(bd->props.brightness * 0x101), 0, 0))
return 0;
else
return 1;