xf86-video-intel: 2 commits - src/intel_driver.c src/intel_options.c src/intel_options.h src/sna/kgem.c src/sna/sna_driver.c

Chris Wilson ickle at kemper.freedesktop.org
Sun Jul 29 14:57:45 PDT 2012


 src/intel_driver.c   |   15 +++------------
 src/intel_options.c  |    1 +
 src/intel_options.h  |    1 +
 src/sna/kgem.c       |   18 +++++++++---------
 src/sna/sna_driver.c |    7 +++++++
 5 files changed, 21 insertions(+), 21 deletions(-)

New commits:
commit cb4d789f98e6e05ec29e5242887018c7450ddf10
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Jul 29 22:55:44 2012 +0100

    sna: Disable the warning for a hung GPU is we manually set wedged
    
    Only warn about a hung GPU if we encounter an EIO during operation, but
    don't warn if we set wedged during initialisation based on unsupported
    hw or user request.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 204b40f..515b1ae 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -2238,19 +2238,17 @@ void _kgem_submit(struct kgem *kgem)
 
 void kgem_throttle(struct kgem *kgem)
 {
-	static int warned;
+	kgem->need_throttle = 0;
+	if (kgem->wedged)
+		return;
 
-	kgem->wedged |= __kgem_throttle(kgem);
-	DBG(("%s: wedged=%d\n", __FUNCTION__, kgem->wedged));
-	if (kgem->wedged && !warned) {
+	kgem->wedged = __kgem_throttle(kgem);
+	if (kgem->wedged) {
 		xf86DrvMsg(kgem_get_screen_index(kgem), X_ERROR,
 			   "Detected a hung GPU, disabling acceleration.\n");
 		xf86DrvMsg(kgem_get_screen_index(kgem), X_ERROR,
 			   "When reporting this, please include i915_error_state from debugfs and the full dmesg.\n");
-		warned = 1;
 	}
-
-	kgem->need_throttle = 0;
 }
 
 void kgem_purge_cache(struct kgem *kgem)
commit 0fd680ff52f7ce0a101c617dfb8997c4e228e3ad
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Jul 29 22:51:26 2012 +0100

    Don't disable acceleration on 830/845g by default
    
    Run the risk of a GPU hang (it shouldn't endanger the entire machine
    normally) and let the user elect to disable it through
    
      Option "NoAccel" "true"
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_driver.c b/src/intel_driver.c
index 8cb098a..0e27c48 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -390,18 +390,9 @@ static Bool can_accelerate_blt(struct intel_screen_private *intel)
 	if (INTEL_INFO(intel)->gen == -1)
 		return FALSE;
 
-	if (0 && (IS_I830(intel) || IS_845G(intel))) {
-		/* These pair of i8xx chipsets have a crippling erratum
-		 * that prevents the use of a PTE entry by the BLT
-		 * engine immediately following updating that
-		 * entry in the GATT.
-		 *
-		 * As the BLT is fundamental to our 2D acceleration,
-		 * and the workaround is lost in the midst of time,
-		 * fallback.
-		 *
-		 * XXX disabled for release as causes regressions in GL.
-		 */
+	if (xf86ReturnOptValBool(intel->Options, OPTION_ACCEL_DISABLE, FALSE)) {
+		xf86DrvMsg(intel->scrn->scrnIndex, X_CONFIG,
+			   "Disabling hardware acceleration.\n");
 		return FALSE;
 	}
 
diff --git a/src/intel_options.c b/src/intel_options.c
index 77832aa..7dbbc7e 100644
--- a/src/intel_options.c
+++ b/src/intel_options.c
@@ -5,6 +5,7 @@
 #include "intel_options.h"
 
 const OptionInfoRec intel_options[] = {
+	{OPTION_ACCEL_DISABLE,	"NoAccel",	OPTV_BOOLEAN,	{0},	0},
 	{OPTION_ACCEL_METHOD,	"AccelMethod",	OPTV_STRING,	{0},	0},
 	{OPTION_DRI,		"DRI",		OPTV_BOOLEAN,	{0},	1},
 	{OPTION_COLOR_KEY,	"ColorKey",	OPTV_INTEGER,	{0},	0},
diff --git a/src/intel_options.h b/src/intel_options.h
index 233908c..6c16a07 100644
--- a/src/intel_options.h
+++ b/src/intel_options.h
@@ -11,6 +11,7 @@
  */
 
 enum intel_options {
+	OPTION_ACCEL_DISABLE,
 	OPTION_ACCEL_METHOD,
 	OPTION_DRI,
 	OPTION_VIDEO_KEY,
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 19ebdef..204b40f 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -652,8 +652,10 @@ static bool is_hw_supported(struct kgem *kgem,
 	if (kgem->gen == (unsigned)-1) /* unknown chipset, assume future gen */
 		return kgem->has_blt;
 
-	if (kgem->gen <= 20) /* dynamic GTT is fubar */
-		return false;
+	/* Although pre-855gm the GMCH is fubar, it works mostly. So
+	 * let the user decide through "NoAccel" whether or not to risk
+	 * hw acceleration.
+	 */
 
 	if (kgem->gen == 60 && dev->revision < 8) {
 		/* pre-production SNB with dysfunctional BLT */
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 3f2ff2e..bd31996 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -439,7 +439,14 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 		return FALSE;
 
 	sna->info = intel_detect_chipset(scrn, sna->pEnt, sna->PciInfo);
+
 	kgem_init(&sna->kgem, fd, sna->PciInfo, sna->info->gen);
+	if (xf86ReturnOptValBool(sna->Options, OPTION_ACCEL_DISABLE, FALSE)) {
+		xf86DrvMsg(sna->scrn->scrnIndex, X_CONFIG,
+			   "Disabling hardware acceleration.\n");
+		sna->kgem.wedged = true;
+	}
+
 	if (!xf86ReturnOptValBool(sna->Options,
 				  OPTION_RELAXED_FENCING,
 				  sna->kgem.has_relaxed_fencing)) {


More information about the xorg-commit mailing list