drm/amdgpu/display: simplify backlight setting
Avoid the extra wrapper function. Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
1b1cbf9229
commit
3c8e99cc12
|
@ -3270,19 +3270,6 @@ static void amdgpu_dm_update_backlight_caps(struct amdgpu_display_manager *dm)
|
|||
#endif
|
||||
}
|
||||
|
||||
static int set_backlight_via_aux(struct dc_link *link, uint32_t brightness)
|
||||
{
|
||||
bool rc;
|
||||
|
||||
if (!link)
|
||||
return 1;
|
||||
|
||||
rc = dc_link_set_backlight_level_nits(link, true, brightness,
|
||||
AUX_BL_DEFAULT_TRANSITION_TIME_MS);
|
||||
|
||||
return rc ? 0 : 1;
|
||||
}
|
||||
|
||||
static int get_brightness_range(const struct amdgpu_dm_backlight_caps *caps,
|
||||
unsigned *min, unsigned *max)
|
||||
{
|
||||
|
@ -3345,9 +3332,10 @@ static int amdgpu_dm_backlight_update_status(struct backlight_device *bd)
|
|||
brightness = convert_brightness_from_user(&caps, bd->props.brightness);
|
||||
// Change brightness based on AUX property
|
||||
if (caps.aux_support)
|
||||
return set_backlight_via_aux(link, brightness);
|
||||
|
||||
rc = dc_link_set_backlight_level(dm->backlight_link, brightness, 0);
|
||||
rc = dc_link_set_backlight_level_nits(link, true, brightness,
|
||||
AUX_BL_DEFAULT_TRANSITION_TIME_MS);
|
||||
else
|
||||
rc = dc_link_set_backlight_level(dm->backlight_link, brightness, 0);
|
||||
|
||||
return rc ? 0 : 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue