All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH 2/2] drm/i915: pnv has a backlight polarity control bit, too
Date: Mon, 23 Apr 2012 11:32:15 +0200	[thread overview]
Message-ID: <1335173535-14811-2-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1335173535-14811-1-git-send-email-daniel.vetter@ffwll.ch>

So let's use it.

We already correctly ignore bit0 on gen < 4, now we also now why ;-)
I've decided that losing that single bit of precision isn't worth the
trouble to sprinkle IS_PINEVIEW checks all over the backlight control
code - that code is way too fragile imo.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_reg.h    |    2 ++
 drivers/gpu/drm/i915/intel_panel.c |    5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 67c4ca0..45d5568 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -1805,6 +1805,8 @@
  */
 #define   BACKLIGHT_DUTY_CYCLE_SHIFT		(0)
 #define   BACKLIGHT_DUTY_CYCLE_MASK		(0xffff)
+#define   BACKLIGHT_DUTY_CYCLE_MASK_PNV		(0xfffe)
+#define   BLM_POLARITY_PNV			(1 << 0) /* pnv only */
 
 #define BLC_HIST_CTL		0x61260
 
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 1874517..e519221 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -212,8 +212,9 @@ static u32 intel_panel_compute_brightness(struct drm_device *dev, u32 val)
 	    dev_priv->quirks & QUIRK_INVERT_BRIGHTNESS)
 		return intel_panel_get_max_backlight(dev) - val;
 
-	/* gen4 has a polarity bit */
-	if (IS_GEN4(dev) && (I915_READ(BLC_PWM_CTL2) & BLM_POLARITY_I965))
+	/* gen4/pnv has a polarity bit */
+	if (IS_GEN4(dev) && (I915_READ(BLC_PWM_CTL2) & BLM_POLARITY_I965) ||
+	    IS_PINEVIEW(dev) && (I915_READ(BLC_PWM_CTL) & BLM_POLARITY_PNV))
 			return intel_panel_get_max_backlight(dev) - val;
 
 	return val;
-- 
1.7.10

  reply	other threads:[~2012-04-23  9:31 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23  9:32 [PATCH 1/2] drm/i915: clear up backlight inversion confusion on gen4 Daniel Vetter
2012-04-23  9:32 ` Daniel Vetter [this message]
2012-04-23 10:27   ` [PATCH 2/2] drm/i915: pnv has a backlight polarity control bit, too Chris Wilson
2012-04-23  9:53 ` [PATCH 1/2] drm/i915: clear up backlight inversion confusion on gen4 Chris Wilson
2012-04-23 12:21   ` Daniel Vetter
2012-04-23 12:32     ` Chris Wilson
2012-04-23 13:48       ` Daniel Vetter
     [not found] ` <4F9542EF.3010208@osadl.org>
2012-04-23 12:32   ` Daniel Vetter
2012-04-23 12:36     ` Daniel Vetter
2012-04-23 13:15       ` Carsten Emde
2012-04-23 13:39         ` Daniel Vetter
2012-04-23 14:00           ` Carsten Emde
2012-04-23 14:22             ` Daniel Vetter
2012-04-23 15:06               ` Carsten Emde
2012-04-23 15:22                 ` Daniel Vetter
2012-04-23 15:38                   ` Carsten Emde
2012-04-23 15:56                     ` Daniel Vetter
2012-04-23 16:55                       ` Carsten Emde
2012-04-26 16:48 ` [PATCH 0/4] drm/i915: " Carsten Emde
2012-04-26 16:48   ` [PATCH 1/4] drm/i915: " Carsten Emde
2012-04-26 16:48   ` [PATCH 2/4] drm/i915: completely revert the invert brightness quirk Carsten Emde
2012-04-26 16:48   ` [PATCH 3/4] drm/i915: add quirk to indicate that an alt bit is used for brightness inversion Carsten Emde
2012-04-26 17:08     ` Daniel Vetter
2012-04-26 17:25       ` [PATCH] properly enable the blc controller on the right pipe Daniel Vetter
2012-04-26 17:27         ` Daniel Vetter
2012-04-26 19:12         ` Carsten Emde
2012-04-26 19:30           ` Daniel Vetter
2012-04-27 20:18             ` Carsten Emde
2012-06-02 23:08               ` Daniel Vetter
2012-06-11  8:51                 ` Daniel Vetter
2012-07-19 14:00                   ` Carsten Emde
2012-07-19 14:40                     ` Daniel Vetter
2012-07-19 22:51                       ` Carsten Emde
2012-07-20  8:10                         ` Daniel Vetter
2012-07-24  7:30                           ` Carsten Emde
2012-07-25 22:35                             ` Carsten Emde
2012-07-26 11:55                               ` [PATCH] drm/i915 disable combination mode Daniel Vetter
2012-07-26 12:20                               ` Daniel Vetter
2012-07-26 12:36                               ` Daniel Vetter
2012-07-26 14:09                               ` Daniel Vetter
2012-04-26 16:48   ` [PATCH 4/4] drm/i915: assign the brightness inversion quirk to Acer Aspire 5734Z Carsten Emde
2012-04-27 16:17   ` [PATCH 0/4] drm/i915: Re: clear up backlight inversion confusion on gen4 Monark Gondaliya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335173535-14811-2-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.