Thread (3 messages) 3 messages, 2 authors, 2017-08-04

Re: [PATCH] drm/i915: fix backlight invert for non-zero minimum brightness

From: Jani Nikula <hidden>
Date: 2017-08-04 12:37:55
Also in: intel-gfx

On Wed, 31 May 2017, Daniel Vetter [off-list ref] wrote:
On Wed, May 31, 2017 at 11:33:55AM +0300, Jani Nikula wrote:
quoted
When we started following the backlight minimum brightness in
6dda730e55f4 ("drm/i915: respect the VBT minimum backlight brightness")
we overlooked the brightness invert quirk. Even if we invert the
brightness, we need to take the min limit into account. We probably
missed this because the invert has only been required on gen4 for proper
operation.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101127
Fixes: 6dda730e55f4 ("drm/i915: respect the VBT minimum backlight brightness")
Cc: Daniel Vetter <redacted>
Cc: <redacted> # v3.17+
Not sure the cc: stable is justified, but makes sense otherwise

Reviewed-by: Daniel Vetter <redacted>
Had forgotten about this, pushed now, without cc: stable.

Thanks for the review.

BR,
Jani.

quoted
Signed-off-by: Jani Nikula <redacted>
---
 drivers/gpu/drm/i915/intel_panel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index cb50c527401f..bcde9f34527a 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -469,7 +469,7 @@ static u32 intel_panel_compute_brightness(struct intel_connector *connector,
 
 	if (i915.invert_brightness > 0 ||
 	    dev_priv->quirks & QUIRK_INVERT_BRIGHTNESS) {
-		return panel->backlight.max - val;
+		return panel->backlight.max - val + panel->backlight.min;
 	}
 
 	return val;
-- 
2.11.0
-- 
Jani Nikula, Intel Open Source Technology Center
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help