Skip to content

Commit 68f3c04

Browse files
superm1alexdeucher
authored andcommitted
drm/amd/display: Indicate when custom brightness curves are in use
[Why] There is a `scale` sysfs attribute that can be used to indicate when non-linear brightness scaling is in use. As Custom brightness curves work by linear interpolation of points the scale is no longer linear. [How] Indicate non-linear scaling when custom brightness curves in use and linear scaling otherwise. Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Mario Limonciello <superm1@kernel.org> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 895b613 commit 68f3c04

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5060,8 +5060,11 @@ amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector)
50605060
} else
50615061
props.brightness = props.max_brightness = MAX_BACKLIGHT_LEVEL;
50625062

5063-
if (caps->data_points && !(amdgpu_dc_debug_mask & DC_DISABLE_CUSTOM_BRIGHTNESS_CURVE))
5063+
if (caps->data_points && !(amdgpu_dc_debug_mask & DC_DISABLE_CUSTOM_BRIGHTNESS_CURVE)) {
50645064
drm_info(drm, "Using custom brightness curve\n");
5065+
props.scale = BACKLIGHT_SCALE_NON_LINEAR;
5066+
} else
5067+
props.scale = BACKLIGHT_SCALE_LINEAR;
50655068
props.type = BACKLIGHT_RAW;
50665069

50675070
snprintf(bl_name, sizeof(bl_name), "amdgpu_bl%d",

0 commit comments

Comments
 (0)