Skip to content

Commit 6ec8a5c

Browse files
superm1alexdeucher
authored andcommitted
drm/amd/display: Revert "drm/amd/display: Fix AMDGPU_MAX_BL_LEVEL value"
This reverts commit 66abb99. This broke custom brightness curves but it wasn't obvious because of other related changes. Custom brightness curves are always from a 0-255 input signal. The correct fix was to fix the default value which was done by [1]. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4412 Link: https://lore.kernel.org/amd-gfx/[email protected]/T/#m69f875a7e69aa22df3370b3e3a9e69f4a61fdaf2 Reviewed-by: Alex Hung <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Roman Li <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 2e72fdb commit 6ec8a5c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4800,16 +4800,16 @@ static int get_brightness_range(const struct amdgpu_dm_backlight_caps *caps,
48004800
return 1;
48014801
}
48024802

4803-
/* Rescale from [min..max] to [0..MAX_BACKLIGHT_LEVEL] */
4803+
/* Rescale from [min..max] to [0..AMDGPU_MAX_BL_LEVEL] */
48044804
static inline u32 scale_input_to_fw(int min, int max, u64 input)
48054805
{
4806-
return DIV_ROUND_CLOSEST_ULL(input * MAX_BACKLIGHT_LEVEL, max - min);
4806+
return DIV_ROUND_CLOSEST_ULL(input * AMDGPU_MAX_BL_LEVEL, max - min);
48074807
}
48084808

4809-
/* Rescale from [0..MAX_BACKLIGHT_LEVEL] to [min..max] */
4809+
/* Rescale from [0..AMDGPU_MAX_BL_LEVEL] to [min..max] */
48104810
static inline u32 scale_fw_to_input(int min, int max, u64 input)
48114811
{
4812-
return min + DIV_ROUND_CLOSEST_ULL(input * (max - min), MAX_BACKLIGHT_LEVEL);
4812+
return min + DIV_ROUND_CLOSEST_ULL(input * (max - min), AMDGPU_MAX_BL_LEVEL);
48134813
}
48144814

48154815
static void convert_custom_brightness(const struct amdgpu_dm_backlight_caps *caps,

0 commit comments

Comments
 (0)