xf86-video-intel: src/intel_driver.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Nov 3 11:19:45 PDT 2010


 src/intel_driver.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

New commits:
commit 18839aaec505f8bbdb0690fe694162bf09a87d5c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Nov 3 18:14:29 2010 +0000

    Fallback to shadow for Sandybridge if we don't have access to the BLT
    
    If we attempt to emit BLT batches without kernel support, we just end up
    with EINVAL and no rendering. Prevent this, and avoid uncached
    rendering, by restoring the shadow fallback paths if there is no BLT
    support.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_driver.c b/src/intel_driver.c
index fd51899..926c7e3 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -468,6 +468,24 @@ static void I830XvInit(ScrnInfoPtr scrn)
 		   intel->colorKey);
 }
 
+static Bool can_accelerate_2d(struct intel_screen_private *intel)
+{
+	if (INTEL_INFO(intel)->gen >= 60) {
+		drm_i915_getparam_t gp;
+		int value;
+
+		/* On Sandybridge we need the BLT in order to do anything since
+		 * it so frequently used in the acceleration code paths.
+		 */
+		gp.value = &value;
+		gp.param = I915_PARAM_HAS_BLT;
+		if (drmIoctl(intel->drmSubFD, DRM_IOCTL_I915_GETPARAM, &gp))
+			return FALSE;
+	}
+
+	return TRUE;
+}
+
 /**
  * This is called before ScreenInit to do any require probing of screen
  * configuration.
@@ -575,6 +593,8 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags)
 	}
 
 	intel->use_shadow = FALSE;
+	if (!can_accelerate_2d(intel))
+		intel->use_shadow = TRUE;
 
 	if (xf86IsOptionSet(intel->Options, OPTION_SHADOW)) {
 		intel->use_shadow =


More information about the xorg-commit mailing list