aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamal Mostafa <kamal@canonical.com>2013-07-19 18:02:01 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-07-20 04:52:53 -0400
commite85843bec6c2ea7c10ec61238396891cc2b753a9 (patch)
tree27e7e17dab67a95cc87bd1dd75049c83ea4915a7
parent94a335dba34ff47cad3d6d0c29b452d43a1be3c8 (diff)
drm/i915: quirk no PCH_PWM_ENABLE for Dell XPS13 backlight
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=47941 BugLink: https://bugs.launchpad.net/bugs/1163720 BugLink: https://bugs.launchpad.net/bugs/1162026 Some machines suffer from non-functional backlight controls if BLM_PCH_PWM_ENABLE is set, so provide a quirk to avoid doing so. Apply this quirk to Dell XPS 13 models. Tested-by: Eric Griffith <EGriffith92@gmail.com> Tested-by: Kent Baxley <kent.baxley@canonical.com> Cc: <stable@vger.kernel.org> # v3.8+ Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h1
-rw-r--r--drivers/gpu/drm/i915/intel_display.c16
-rw-r--r--drivers/gpu/drm/i915/intel_panel.c3
3 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index a416645bcd23..204c3eca0fb2 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -555,6 +555,7 @@ enum intel_sbi_destination {
555#define QUIRK_PIPEA_FORCE (1<<0) 555#define QUIRK_PIPEA_FORCE (1<<0)
556#define QUIRK_LVDS_SSC_DISABLE (1<<1) 556#define QUIRK_LVDS_SSC_DISABLE (1<<1)
557#define QUIRK_INVERT_BRIGHTNESS (1<<2) 557#define QUIRK_INVERT_BRIGHTNESS (1<<2)
558#define QUIRK_NO_PCH_PWM_ENABLE (1<<3)
558 559
559struct intel_fbdev; 560struct intel_fbdev;
560struct intel_fbc_work; 561struct intel_fbc_work;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 76b034be2c7c..5fb305840db8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9400,6 +9400,17 @@ static void quirk_invert_brightness(struct drm_device *dev)
9400 DRM_INFO("applying inverted panel brightness quirk\n"); 9400 DRM_INFO("applying inverted panel brightness quirk\n");
9401} 9401}
9402 9402
9403/*
9404 * Some machines (Dell XPS13) suffer broken backlight controls if
9405 * BLM_PCH_PWM_ENABLE is set.
9406 */
9407static void quirk_no_pcm_pwm_enable(struct drm_device *dev)
9408{
9409 struct drm_i915_private *dev_priv = dev->dev_private;
9410 dev_priv->quirks |= QUIRK_NO_PCH_PWM_ENABLE;
9411 DRM_INFO("applying no-PCH_PWM_ENABLE quirk\n");
9412}
9413
9403struct intel_quirk { 9414struct intel_quirk {
9404 int device; 9415 int device;
9405 int subsystem_vendor; 9416 int subsystem_vendor;
@@ -9469,6 +9480,11 @@ static struct intel_quirk intel_quirks[] = {
9469 9480
9470 /* Acer Aspire 4736Z */ 9481 /* Acer Aspire 4736Z */
9471 { 0x2a42, 0x1025, 0x0260, quirk_invert_brightness }, 9482 { 0x2a42, 0x1025, 0x0260, quirk_invert_brightness },
9483
9484 /* Dell XPS13 HD Sandy Bridge */
9485 { 0x0116, 0x1028, 0x052e, quirk_no_pcm_pwm_enable },
9486 /* Dell XPS13 HD and XPS13 FHD Ivy Bridge */
9487 { 0x0166, 0x1028, 0x058b, quirk_no_pcm_pwm_enable },
9472}; 9488};
9473 9489
9474static void intel_init_quirks(struct drm_device *dev) 9490static void intel_init_quirks(struct drm_device *dev)
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 45010bb5d132..67e2c1f1c9a8 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -583,7 +583,8 @@ void intel_panel_enable_backlight(struct drm_device *dev,
583 POSTING_READ(reg); 583 POSTING_READ(reg);
584 I915_WRITE(reg, tmp | BLM_PWM_ENABLE); 584 I915_WRITE(reg, tmp | BLM_PWM_ENABLE);
585 585
586 if (HAS_PCH_SPLIT(dev)) { 586 if (HAS_PCH_SPLIT(dev) &&
587 !(dev_priv->quirks & QUIRK_NO_PCH_PWM_ENABLE)) {
587 tmp = I915_READ(BLC_PWM_PCH_CTL1); 588 tmp = I915_READ(BLC_PWM_PCH_CTL1);
588 tmp |= BLM_PCH_PWM_ENABLE; 589 tmp |= BLM_PCH_PWM_ENABLE;
589 tmp &= ~BLM_PCH_OVERRIDE_ENABLE; 590 tmp &= ~BLM_PCH_OVERRIDE_ENABLE;