[Intel-gfx] [RFC PATCH 1/2] drm/i915: preserve min brightness across backlight disable/enable

Jani Nikula jani.nikula at intel.com
Thu Nov 19 02:29:35 PST 2015


We try to preserve the backlight brightness across backlight
disable/enable, except for minimum brightness. Currently, if the
backlight is at minimum, we crank the backlight to max on
enable. Preserve the minimum too, and turn the code into a sanity check
instead.

Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Clint Taylor <clinton.a.taylor at intel.com>
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/i915/intel_panel.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index a24df35e11e7..7ab63486adce 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -1116,8 +1116,9 @@ void intel_panel_enable_backlight(struct intel_connector *connector)
 
 	WARN_ON(panel->backlight.max == 0);
 
-	if (panel->backlight.level <= panel->backlight.min) {
-		panel->backlight.level = panel->backlight.max;
+	if (panel->backlight.level < panel->backlight.min) {
+		DRM_DEBUG_KMS("backlight level was below minimum\n");
+		panel->backlight.level = panel->backlight.min;
 		if (panel->backlight.device)
 			panel->backlight.device->props.brightness =
 				scale_hw_to_user(connector,
-- 
2.1.4



More information about the Intel-gfx mailing list