From 1cf8d5134d8c6e73135ce368be7d92d49a5e27d2 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 30 Sep 2013 15:37:20 +0100 Subject: 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 --- src/sna/sna_accel.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3