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;
 }
 


