Skip to content

Commit 8e6a18c

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]> (cherry picked from commit 6ec8a5c) Cc: [email protected]
1 parent 1bcf63a commit 8e6a18c

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
@@ -4756,16 +4756,16 @@ static int get_brightness_range(const struct amdgpu_dm_backlight_caps *caps,
47564756
return 1;
47574757
}
47584758

4759-
/* Rescale from [min..max] to [0..MAX_BACKLIGHT_LEVEL] */
4759+
/* Rescale from [min..max] to [0..AMDGPU_MAX_BL_LEVEL] */
47604760
static inline u32 scale_input_to_fw(int min, int max, u64 input)
47614761
{
4762-
return DIV_ROUND_CLOSEST_ULL(input * MAX_BACKLIGHT_LEVEL, max - min);
4762+
return DIV_ROUND_CLOSEST_ULL(input * AMDGPU_MAX_BL_LEVEL, max - min);
47634763
}
47644764

4765-
/* Rescale from [0..MAX_BACKLIGHT_LEVEL] to [min..max] */
4765+
/* Rescale from [0..AMDGPU_MAX_BL_LEVEL] to [min..max] */
47664766
static inline u32 scale_fw_to_input(int min, int max, u64 input)
47674767
{
4768-
return min + DIV_ROUND_CLOSEST_ULL(input * (max - min), MAX_BACKLIGHT_LEVEL);
4768+
return min + DIV_ROUND_CLOSEST_ULL(input * (max - min), AMDGPU_MAX_BL_LEVEL);
47694769
}
47704770

47714771
static void convert_custom_brightness(const struct amdgpu_dm_backlight_caps *caps,

0 commit comments

Comments
 (0)