]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drm/amd/display: Read back max backlight value at boot
authorDavid Francis <David.Francis@amd.com>
Wed, 18 Jul 2018 20:03:30 +0000 (16:03 -0400)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:47:09 +0000 (19:47 -0600)
BugLink: https://bugs.launchpad.net/bugs/1835972
[ Upstream commit 53a53f8687faf492df2644d8c18ff0217fc18730 ]

[Why]
If there is no program explicitly setting the backlight
brightness (for example, during a minimal install of linux), the
hardware defaults to maximum brightness but the backlight_device
defaults to 0 value.  Thus, settings displays the wrong brightness
value.

[How]
When creating the backlight device, set brightness to max

Signed-off-by: David Francis <David.Francis@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index d64c5c3cb165d1876287f937ca4590e4a3b62ae8..416ae05f4b8b2f4265ca913c8e30b6dba27780dd 100644 (file)
@@ -1320,6 +1320,7 @@ amdgpu_dm_register_backlight_device(struct amdgpu_display_manager *dm)
        struct backlight_properties props = { 0 };
 
        props.max_brightness = AMDGPU_MAX_BL_LEVEL;
+       props.brightness = AMDGPU_MAX_BL_LEVEL;
        props.type = BACKLIGHT_RAW;
 
        snprintf(bl_name, sizeof(bl_name), "amdgpu_bl%d",