diff mbox

drm/i915: fix startup hang on some non-mobile platforms

Message ID 20090916150500.26e075e1@jbarnes-g45 (mailing list archive)
State Accepted
Headers show

Commit Message

Jesse Barnes Sept. 16, 2009, 10:05 p.m. UTC
On Mon, 14 Sep 2009 12:22:31 -0700
Jesse Barnes <jbarnes@virtuousgeek.org> wrote:

> Due to a bogus FBC support check and failing to check for FBC support
> in the right places, mode setting on non-mobile platforms could fail
> and hang in the FBC disable routine.  Fix it up.
> 
> This fix highlights the need for cleanups in this area (function
> pointers and better feature support checks).  Patches for that to
> follow.
> 
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

oops, use this one.  It doesn't have the superfluous hotplug debug hunk.

Comments

Kenny Graunke Sept. 17, 2009, 8:25 a.m. UTC | #1
On Wednesday 16 September 2009 15:05:00 Jesse Barnes wrote:
> On Mon, 14 Sep 2009 12:22:31 -0700
> 
> Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> > Due to a bogus FBC support check and failing to check for FBC support
> > in the right places, mode setting on non-mobile platforms could fail
> > and hang in the FBC disable routine.  Fix it up.
> >
> > This fix highlights the need for cleanups in this area (function
> > pointers and better feature support checks).  Patches for that to
> > follow.
> >
> > Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> 
> oops, use this one.  It doesn't have the superfluous hotplug debug hunk.

With the latest drm-intel-next kernel, my G965 based system hangs on the 
initial modeset.  Applying this patch fixes the issue - thanks Jesse!

Tested-by: Kenny Graunke <kenny@whitecape.org>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 0344afd..09e9874 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -929,7 +929,7 @@  extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
 
 #define HAS_FW_BLC(dev) (IS_I9XX(dev) || IS_G4X(dev) || IS_IGDNG(dev))
 #define HAS_PIPE_CXSR(dev) (IS_G4X(dev) || IS_IGDNG(dev))
-#define I915_HAS_FBC(dev) (IS_I9XX(dev) || IS_I965G(dev))
+#define I915_HAS_FBC(dev) (IS_MOBILE(dev) && (IS_I9XX(dev) || IS_I965G(dev)))
 
 #define PRIMARY_RINGBUFFER_SIZE         (128*1024)
 
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index cadb9ef..36a36d7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1005,6 +1005,9 @@  void i8xx_disable_fbc(struct drm_device *dev)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	u32 fbc_ctl;
 
+	if (!I915_HAS_FBC(dev))
+		return;
+
 	/* Disable compression */
 	fbc_ctl = I915_READ(FBC_CONTROL);
 	fbc_ctl &= ~FBC_CTL_EN;