diff options
author | 2025-02-28 12:51:45 -0600 | |
---|---|---|
committer | 2025-03-05 10:42:57 -0500 | |
commit | 36d63ce5dbc0dc37b5af90f6b7c3b92ab26403b7 (patch) | |
tree | 66513da55e0a27a43e2159ea0f0e5029e3f1d3dd /drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |
parent | drm/amd/display: Add support for custom brightness curve (diff) | |
download | linux-rng-36d63ce5dbc0dc37b5af90f6b7c3b92ab26403b7.tar.xz linux-rng-36d63ce5dbc0dc37b5af90f6b7c3b92ab26403b7.zip |
drm/amd/display: Add a new dcdebugmask to allow turning off brightness curve
Upgrading the kernel may cause some systems that were previously not using
a firmware specified brightness curve to use one.
In the event of problems with this curve (for example an interpolation
error) add a new dcdebugmask value that can be used to turn it off. Also
add an info message to show that custom brightness curves are currently in
use.
Reviewed-by: Alex Hung <alex.hung@amd.com>
Link: https://lore.kernel.org/r/20250228185145.186319-6-mario.limonciello@amd.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 5e049b8f877d..58848d6b475a 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -4758,6 +4758,9 @@ static u32 convert_brightness_from_user(const struct amdgpu_dm_backlight_caps *c for (int i = 0; i < caps->data_points; i++) { u8 signal, lum; + if (amdgpu_dc_debug_mask & DC_DISABLE_CUSTOM_BRIGHTNESS_CURVE) + break; + signal = caps->luminance_data[i].input_signal; lum = caps->luminance_data[i].luminance; @@ -4942,6 +4945,8 @@ amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector) } else props.brightness = AMDGPU_MAX_BL_LEVEL; + if (caps.data_points && !(amdgpu_dc_debug_mask & DC_DISABLE_CUSTOM_BRIGHTNESS_CURVE)) + drm_info(drm, "Using custom brightness curve\n"); props.max_brightness = AMDGPU_MAX_BL_LEVEL; props.type = BACKLIGHT_RAW; |