diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-16 15:00:21 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-16 15:22:58 +0000 |
commit | 4580bbeac0051417cb03f272112b0cfe697e31b3 (patch) | |
tree | 6ea57241c9742803d8d8e08baedd699a7e25cf0e | |
parent | 58770b7d6401d2d81f7fee1c8c0e788d44149712 (diff) |
intel: Support debugging through AccelMethod
Ease debugging by allowing all acceleration or render acceleration to be
disabled through AccelMethod:
Option "AccelMethod" "off" -> disable all acceleration
Option "AccelMethod" "blt" -> disable render acceleration (only use BLT)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | man/intel.man | 3 | ||||
-rw-r--r-- | src/intel_driver.c | 3 | ||||
-rw-r--r-- | src/intel_uxa.c | 14 | ||||
-rw-r--r-- | src/sna/sna.h | 1 | ||||
-rw-r--r-- | src/sna/sna_accel.c | 16 | ||||
-rw-r--r-- | src/sna/sna_driver.c | 3 |
6 files changed, 33 insertions, 7 deletions
diff --git a/man/intel.man b/man/intel.man index 33ccb2dd..16db5211 100644 --- a/man/intel.man +++ b/man/intel.man @@ -128,6 +128,9 @@ Acceleration Architecture) is the mature backend that was introduced to support the GEM driver model. It is in the process of being superseded by \*qSNA\*q (Sandybridge's New Acceleration). Until that process is complete, the ability to choose which backend to use remains for backwards compatibility. +In addition, there are a pair of sub-options to limit the acceleration for +debuging use. Specify \*qoff\*q to disable all acceleration, or \*qblt\*q to +disable render acceleration and only use the BLT engine. .IP Default: use UXA (render acceleration) .TP diff --git a/src/intel_driver.c b/src/intel_driver.c index 5a176dcb..5d3e1033 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -405,7 +405,8 @@ static Bool can_accelerate_blt(struct intel_screen_private *intel) if (INTEL_INFO(intel)->gen == -1) return FALSE; - if (xf86ReturnOptValBool(intel->Options, OPTION_ACCEL_DISABLE, FALSE)) { + if (xf86ReturnOptValBool(intel->Options, OPTION_ACCEL_DISABLE, FALSE) || + !intel_option_cast_string_to_bool(intel, OPTION_ACCEL_METHOD, TRUE)) { xf86DrvMsg(intel->scrn->scrnIndex, X_CONFIG, "Disabling hardware acceleration.\n"); return FALSE; diff --git a/src/intel_uxa.c b/src/intel_uxa.c index 76a3146f..60ab3a64 100644 --- a/src/intel_uxa.c +++ b/src/intel_uxa.c @@ -1292,6 +1292,17 @@ intel_limits_init(intel_screen_private *intel) } } +static Bool intel_option_accel_blt(intel_screen_private *intel) +{ + const char *s; + + s = xf86GetOptValString(intel->Options, OPTION_ACCEL_METHOD); + if (s == NULL) + return false; + + return strcasecmp(s, "blt") == 0; +} + Bool intel_uxa_init(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); @@ -1338,7 +1349,8 @@ Bool intel_uxa_init(ScreenPtr screen) intel->uxa_driver->done_copy = intel_uxa_done; /* Composite */ - if (IS_GEN2(intel)) { + if (intel_option_accel_blt(intel)) { + } else if (IS_GEN2(intel)) { intel->uxa_driver->check_composite = i830_check_composite; intel->uxa_driver->check_composite_target = i830_check_composite_target; intel->uxa_driver->check_composite_texture = i830_check_composite_texture; diff --git a/src/sna/sna.h b/src/sna/sna.h index 8861fd9a..c7ebbd93 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -79,7 +79,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define DBG(x) #endif -#define DEBUG_NO_RENDER 0 #define DEBUG_NO_BLT 0 #define DEBUG_FLUSH_BATCH 0 diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index f59f153c..2c6347d6 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -29,6 +29,7 @@ #include "config.h" #endif +#include "intel_options.h" #include "sna.h" #include "sna_reg.h" #include "rop.h" @@ -14208,6 +14209,17 @@ static bool sna_picture_init(ScreenPtr screen) return true; } +static bool sna_option_accel_blt(struct sna *sna) +{ + const char *s; + + s = xf86GetOptValString(sna->Options, OPTION_ACCEL_METHOD); + if (s == NULL) + return false; + + return strcasecmp(s, "blt") == 0; +} + bool sna_accel_init(ScreenPtr screen, struct sna *sna) { const char *backend; @@ -14286,8 +14298,7 @@ bool sna_accel_init(ScreenPtr screen, struct sna *sna) sna->have_render = false; no_render_init(sna); -#if !DEBUG_NO_RENDER - if (sna->info->gen >= 0100) { + if (sna_option_accel_blt(sna) || sna->info->gen >= 0100) { } else if (sna->info->gen >= 070) { if ((sna->have_render = gen7_render_init(sna))) backend = "IvyBridge"; @@ -14307,7 +14318,6 @@ bool sna_accel_init(ScreenPtr screen, struct sna *sna) if ((sna->have_render = gen2_render_init(sna))) backend = "gen2"; } -#endif DBG(("%s(backend=%s, have_render=%d)\n", __FUNCTION__, backend, sna->have_render)); diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index 22770c79..ff0c776c 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -473,7 +473,8 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags) 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)) { + if (xf86ReturnOptValBool(sna->Options, OPTION_ACCEL_DISABLE, FALSE) || + !sna_option_cast_to_bool(sna, OPTION_ACCEL_METHOD, TRUE)) { xf86DrvMsg(sna->scrn->scrnIndex, X_CONFIG, "Disabling hardware acceleration.\n"); sna->kgem.wedged = true; |