aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/0660-drm-amd-display-set-backlight-level-limit-to-1.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/0660-drm-amd-display-set-backlight-level-limit-to-1.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/0660-drm-amd-display-set-backlight-level-limit-to-1.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/0660-drm-amd-display-set-backlight-level-limit-to-1.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/0660-drm-amd-display-set-backlight-level-limit-to-1.patch
new file mode 100644
index 00000000..dd1eb9a2
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/0660-drm-amd-display-set-backlight-level-limit-to-1.patch
@@ -0,0 +1,44 @@
+From 62c9ca9cd1bc0e0f78b9890945b518504403c0d0 Mon Sep 17 00:00:00 2001
+From: "Guttula, Suresh" <Suresh.Guttula@amd.com>
+Date: Mon, 29 Oct 2018 05:23:25 +0000
+Subject: [PATCH 0660/2940] drm/amd/display: set backlight level limit to 1
+
+This patch will work as workaround for silicon limitation
+related to PWM dutycycle when the backlight level goes to 0.
+
+Actually PWM value is 16 bit value and valid range from 1-65535.
+when ever user requested to set this PWM value to 0 which is not
+fall in the range, in VBIOS taken care this by limiting to 1.
+This patch here will do the same. Either driver or VBIOS can not
+pass 0 value as it is not a valid range for PWM and it will
+give a high PWM pulse which is not the intended behaviour as
+per HW constraints.
+
+Signed-off-by: suresh guttula <suresh.guttula@amd.com>
+Reviewed-by: Harry Wentland <harry.wentland@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+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 d90f15605161..16115ca7a0d6 100644
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -1523,6 +1523,13 @@ static int amdgpu_dm_backlight_update_status(struct backlight_device *bd)
+ {
+ struct amdgpu_display_manager *dm = bl_get_data(bd);
+
++ /*
++ * PWM interperts 0 as 100% rather than 0% because of HW
++ * limitation for level 0.So limiting minimum brightness level
++ * to 1.
++ */
++ if (bd->props.brightness < 1)
++ return 1;
+ if (dc_link_set_backlight_level(dm->backlight_link,
+ bd->props.brightness, 0, 0))
+ return 0;
+--
+2.17.1
+