All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carsten Emde <C.Emde@osadl.org>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: [PATCH 1/4] drm/i915: clear up backlight inversion confusion on gen4
Date: Thu, 26 Apr 2012 18:48:34 +0200	[thread overview]
Message-ID: <20120426165033.143738779@osadl.org> (raw)
In-Reply-To: 20120426164833.823221567@osadl.org

[-- Attachment #1: drivers-gpu-drm-i915-invert-brightness-if-required.patch --]
[-- Type: text/plain, Size: 3144 bytes --]

There's a bit in the docs for gen4 only that says whether the
backlight control is inverted. And both the quirk we have and
all bugs only concern i965gm and gm45 (and mostly Acer) afaics.

So lets drop the quirk and use the bit instead.

Also clean up the BLC register definitions a bit by correctly
grouping the CTL and CTL2 definitions together.

This quirk was originally added in

commit 5a15ab5b93e4a3ebcd4fa6c76cf646a45e9cf806
Author: Carsten Emde <C.Emde@osadl.org>
Date:   Thu Mar 15 15:56:27 2012 +0100

    drm/i915: panel: invert brightness acer aspire 5734z

References: https://bugzilla.kernel.org/show_bug.cgi?id=31522
References: https://bugs.freedesktop.org/show_bug.cgi?id=37986
References: https://bugs.freedesktop.org/show_bug.cgi?id=40455

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Carsten Emde <C.Emde@osadl.org>

---
 drivers/gpu/drm/i915/i915_reg.h      |    7 ++++---
 drivers/gpu/drm/i915/intel_display.c |    3 ---
 drivers/gpu/drm/i915/intel_panel.c   |    4 ++++
 3 files changed, 8 insertions(+), 6 deletions(-)

Index: linux-tip/drivers/gpu/drm/i915/i915_reg.h
===================================================================
--- linux-tip.orig/drivers/gpu/drm/i915/i915_reg.h
+++ linux-tip/drivers/gpu/drm/i915/i915_reg.h
@@ -1683,16 +1683,17 @@
 #define PFIT_AUTO_RATIOS 0x61238
 
 /* Backlight control */
-#define BLC_PWM_CTL		0x61254
-#define   BACKLIGHT_MODULATION_FREQ_SHIFT		(17)
 #define BLC_PWM_CTL2		0x61250 /* 965+ only */
-#define   BLM_COMBINATION_MODE (1 << 30)
+#define   BLM_COMBINATION_MODE	(1 << 30)
+#define   BLM_POLARITY_I965	(1 << 28) /* gen4 only */
+#define BLC_PWM_CTL		0x61254
 /*
  * This is the most significant 15 bits of the number of backlight cycles in a
  * complete cycle of the modulated backlight control.
  *
  * The actual value is this field multiplied by two.
  */
+#define   BACKLIGHT_MODULATION_FREQ_SHIFT		(17)
 #define   BACKLIGHT_MODULATION_FREQ_MASK		(0x7fff << 17)
 #define   BLM_LEGACY_MODE				(1 << 16)
 /*
Index: linux-tip/drivers/gpu/drm/i915/intel_display.c
===================================================================
--- linux-tip.orig/drivers/gpu/drm/i915/intel_display.c
+++ linux-tip/drivers/gpu/drm/i915/intel_display.c
@@ -9143,9 +9143,6 @@ struct intel_quirk intel_quirks[] = {
 
 	/* Sony Vaio Y cannot use SSC on LVDS */
 	{ 0x0046, 0x104d, 0x9076, quirk_ssc_force_disable },
-
-	/* Acer Aspire 5734Z must invert backlight brightness */
-	{ 0x2a42, 0x1025, 0x0459, quirk_invert_brightness },
 };
 
 static void intel_init_quirks(struct drm_device *dev)
Index: linux-tip/drivers/gpu/drm/i915/intel_panel.c
===================================================================
--- linux-tip.orig/drivers/gpu/drm/i915/intel_panel.c
+++ linux-tip/drivers/gpu/drm/i915/intel_panel.c
@@ -208,6 +208,10 @@ static u32 intel_panel_compute_brightnes
 	    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))
+			return intel_panel_get_max_backlight(dev) - val;
+
 	return val;
 }

  reply	other threads:[~2012-04-26 17:00 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 ` [PATCH 2/2] drm/i915: pnv has a backlight polarity control bit, too Daniel Vetter
2012-04-23 10:27   ` 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   ` Carsten Emde [this message]
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=20120426165033.143738779@osadl.org \
    --to=c.emde@osadl.org \
    --cc=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.