diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-09-30 15:37:20 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-09-30 15:40:35 +0100 |
commit | 1cf8d5134d8c6e73135ce368be7d92d49a5e27d2 (patch) | |
tree | 1ff524d06918615c9d3fa1c9876218fa13ff91be /src | |
parent | 1d6a9d4a422b351440df3496d3d6cdefa82ce6c3 (diff) |
sna: Honour Option "AccelMethod" "none"
If the user requests that acceleration be disabled either through
AccelMethod or NoAccel, do so.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_accel.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 9113d94e..48383717 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -15735,6 +15735,20 @@ static bool sna_picture_init(ScreenPtr screen) return true; } +static bool sna_option_accel_none(struct sna *sna) +{ + const char *s; + + if (xf86ReturnOptValBool(sna->Options, OPTION_ACCEL_DISABLE, FALSE)) + return true; + + s = xf86GetOptValString(sna->Options, OPTION_ACCEL_METHOD); + if (s == NULL) + return false; + + return strcasecmp(s, "none") == 0; +} + static bool sna_option_accel_blt(struct sna *sna) { const char *s; @@ -15823,7 +15837,10 @@ bool sna_accel_init(ScreenPtr screen, struct sna *sna) return false; backend = no_render_init(sna); - if (sna_option_accel_blt(sna) || sna->info->gen >= 0100) + if (sna_option_accel_none(sna)) { + backend = "disabled"; + sna->kgem.wedged = true; + } else if (sna_option_accel_blt(sna) || sna->info->gen >= 0100) (void)backend; else if (sna->info->gen >= 070) backend = gen7_render_init(sna, backend); |