intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: don't forget the PCH backlight registers
@ 2012-07-14 14:57 Paulo Zanoni
  2012-07-14 16:15 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Paulo Zanoni @ 2012-07-14 14:57 UTC (permalink / raw)
  To: intel-gfx; +Cc: Paulo Zanoni

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

When we enable/disable the CPU backlight registers we can't forget to
enable/disable the PCH backlight registers. Since we're using the CPU
registers we should also unset the override bit.

Fixes a regression on the following commit:
  drm/i915: properly enable the blc controller on the right pipe

The commit just deleted the code that sets the PCH registers, so it
was relying on the values set by the BIOS. I told my BIOS to boot on
the DVI monitor instead of the LVDS panel, so I noticed the bug.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_panel.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)


I really think this patch fixes fd.o bug #51463. I'm waiting
confirmation from the bug reporter.

Also, I did not really do the git bisect: I understood it is a
regression from that commit just by reading the commit (and by
the fact that backlight used to work until I upgraded my
Kernel).

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 58c7ee7..10c7d39 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -289,11 +289,17 @@ void intel_panel_disable_backlight(struct drm_device *dev)
 	intel_panel_actually_set_backlight(dev, 0);
 
 	if (INTEL_INFO(dev)->gen >= 4) {
-		uint32_t reg;
+		uint32_t reg, tmp;
 
 		reg = HAS_PCH_SPLIT(dev) ? BLC_PWM_CPU_CTL2 : BLC_PWM_CTL2;
 
 		I915_WRITE(reg, I915_READ(reg) & ~BLM_PWM_ENABLE);
+
+		if (HAS_PCH_SPLIT(dev)) {
+			tmp = I915_READ(BLC_PWM_PCH_CTL1);
+			tmp &= ~BLM_PCH_PWM_ENABLE;
+			I915_WRITE(BLC_PWM_PCH_CTL1, tmp);
+		}
 	}
 }
 
@@ -333,6 +339,13 @@ void intel_panel_enable_backlight(struct drm_device *dev,
 		I915_WRITE(reg, tmp);
 		POSTING_READ(reg);
 		I915_WRITE(reg, tmp | BLM_PWM_ENABLE);
+
+		if (HAS_PCH_SPLIT(dev)) {
+			tmp = I915_READ(BLC_PWM_PCH_CTL1);
+			tmp |= BLM_PCH_PWM_ENABLE;
+			tmp &= ~BLM_PCH_OVERRIDE_ENABLE;
+			I915_WRITE(BLC_PWM_PCH_CTL1, tmp);
+		}
 	}
 }
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/i915: don't forget the PCH backlight registers
  2012-07-14 14:57 [PATCH] drm/i915: don't forget the PCH backlight registers Paulo Zanoni
@ 2012-07-14 16:15 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2012-07-14 16:15 UTC (permalink / raw)
  To: Paulo Zanoni; +Cc: intel-gfx, Paulo Zanoni

On Sat, Jul 14, 2012 at 11:57:12AM -0300, Paulo Zanoni wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> When we enable/disable the CPU backlight registers we can't forget to
> enable/disable the PCH backlight registers. Since we're using the CPU
> registers we should also unset the override bit.
> 
> Fixes a regression on the following commit:
>   drm/i915: properly enable the blc controller on the right pipe
> 
> The commit just deleted the code that sets the PCH registers, so it
> was relying on the values set by the BIOS. I told my BIOS to boot on
> the DVI monitor instead of the LVDS panel, so I noticed the bug.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Ok, I've double-check bspec, and at least on ilk, snb & ivb this seems to
be a sane thing to do. Patch queued for -next, thanks.
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-14 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-14 14:57 [PATCH] drm/i915: don't forget the PCH backlight registers Paulo Zanoni
2012-07-14 16:15 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).