summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2014-01-24 03:21:18 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2014-01-24 03:21:18 +0000
commit49eebfae85b9a834a79a6f942109ef6b8f83a07a (patch)
tree3aff107bb289094b3012dca7ae90ef4656817715
parent696e8dfb53c5c751b57984a9ec788c0f9f024c2a (diff)
drm/i915: quirk no PCH_PWM_ENABLE for Dell XPS13 backlight
From Kamal Mostafa 9f5b330036e6f771438b22770f6c49e2c2eaf0e1 in ubuntu 3.8 e85843bec6c2ea7c10ec61238396891cc2b753a9 in mainline linux
-rw-r--r--sys/dev/pci/drm/i915/i915_drv.h3
-rw-r--r--sys/dev/pci/drm/i915/intel_display.c18
-rw-r--r--sys/dev/pci/drm/i915/intel_panel.c5
3 files changed, 22 insertions, 4 deletions
diff --git a/sys/dev/pci/drm/i915/i915_drv.h b/sys/dev/pci/drm/i915/i915_drv.h
index af73df29b4b..c545fef2cc3 100644
--- a/sys/dev/pci/drm/i915/i915_drv.h
+++ b/sys/dev/pci/drm/i915/i915_drv.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_drv.h,v 1.46 2014/01/23 10:42:57 jsg Exp $ */
+/* $OpenBSD: i915_drv.h,v 1.47 2014/01/24 03:21:17 jsg Exp $ */
/* i915_drv.h -- Private header for the I915 driver -*- linux-c -*-
*/
/*
@@ -281,6 +281,7 @@ enum intel_sbi_destination {
#define QUIRK_PIPEA_FORCE (1<<0)
#define QUIRK_LVDS_SSC_DISABLE (1<<1)
#define QUIRK_INVERT_BRIGHTNESS (1<<2)
+#define QUIRK_NO_PCH_PWM_ENABLE (1<<3)
struct intel_fbdev;
diff --git a/sys/dev/pci/drm/i915/intel_display.c b/sys/dev/pci/drm/i915/intel_display.c
index 0278cf83e3e..75c5250194a 100644
--- a/sys/dev/pci/drm/i915/intel_display.c
+++ b/sys/dev/pci/drm/i915/intel_display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_display.c,v 1.23 2014/01/24 01:07:00 jsg Exp $ */
+/* $OpenBSD: intel_display.c,v 1.24 2014/01/24 03:21:17 jsg Exp $ */
/*
* Copyright © 2006-2007 Intel Corporation
*
@@ -8955,6 +8955,17 @@ static void quirk_invert_brightness(struct drm_device *dev)
DRM_INFO("applying inverted panel brightness quirk\n");
}
+/*
+ * Some machines (Dell XPS13) suffer broken backlight controls if
+ * BLM_PCH_PWM_ENABLE is set.
+ */
+static void quirk_no_pcm_pwm_enable(struct drm_device *dev)
+{
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ dev_priv->quirks |= QUIRK_NO_PCH_PWM_ENABLE;
+ DRM_INFO("applying no-PCH_PWM_ENABLE quirk\n");
+}
+
struct intel_quirk {
int device;
int subsystem_vendor;
@@ -9013,6 +9024,11 @@ static struct intel_quirk intel_quirks[] = {
/* Acer Aspire 4736Z */
{ 0x2a42, 0x1025, 0x0260, quirk_invert_brightness },
+
+ /* Dell XPS13 HD Sandy Bridge */
+ { 0x0116, 0x1028, 0x052e, quirk_no_pcm_pwm_enable },
+ /* Dell XPS13 HD and XPS13 FHD Ivy Bridge */
+ { 0x0166, 0x1028, 0x058b, quirk_no_pcm_pwm_enable },
};
static void intel_init_quirks(struct drm_device *dev)
diff --git a/sys/dev/pci/drm/i915/intel_panel.c b/sys/dev/pci/drm/i915/intel_panel.c
index 191fe4a5802..b577e9d90bf 100644
--- a/sys/dev/pci/drm/i915/intel_panel.c
+++ b/sys/dev/pci/drm/i915/intel_panel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_panel.c,v 1.4 2013/08/13 10:23:52 jsg Exp $ */
+/* $OpenBSD: intel_panel.c,v 1.5 2014/01/24 03:21:17 jsg Exp $ */
/*
* Copyright © 2006-2010 Intel Corporation
* Copyright (c) 2006 Dave Airlie <airlied@linux.ie>
@@ -353,7 +353,8 @@ void intel_panel_enable_backlight(struct drm_device *dev,
POSTING_READ(reg);
I915_WRITE(reg, tmp | BLM_PWM_ENABLE);
- if (HAS_PCH_SPLIT(dev)) {
+ if (HAS_PCH_SPLIT(dev) &&
+ !(dev_priv->quirks & QUIRK_NO_PCH_PWM_ENABLE)) {
tmp = I915_READ(BLC_PWM_PCH_CTL1);
tmp |= BLM_PCH_PWM_ENABLE;
tmp &= ~BLM_PCH_OVERRIDE_ENABLE;