summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-07-27 07:15:19 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-07-27 07:15:19 +0100
commit997a5d28021ece0e81845d0217a1b6feb765e6fa (patch)
tree5a88a9a64ad69635c19d7032417cfed4dffa4a2a
parentcac1548a9c48db4707fc3c885b1ea568ae2fbc54 (diff)
configure: Expose no acceleration by default (--with-default-accel=none)
Why? I am not sure, but it seems equally as valid as allowing the switch to uxa/glamor as default. The runtime equivalent is Option "AccelMethod". Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--configure.ac20
-rw-r--r--src/intel_driver.h5
-rw-r--r--src/intel_module.c13
-rw-r--r--src/sna/sna_accel.c2
-rw-r--r--src/uxa/intel_glamor.c3
-rw-r--r--src/uxa/intel_uxa.c14
6 files changed, 49 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 5c3dd20c..94959f7d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -646,7 +646,7 @@ fi
AC_ARG_WITH(default-accel,
AS_HELP_STRING([--with-default-accel],
- [Select the default acceleration method [default=sna if enabled, otherwise uxa]]),
+ [Select the default acceleration method out of glamor, none, sna, or uxa [default is sna if enabled, otherwise uxa]]),
[accel="$withval"],
[accel="auto"])
if test "x$accel" = "xyes"; then
@@ -698,7 +698,11 @@ fi
if test "x$have_accel" = "xnone"; then
if test "x$KMS" = "xyes"; then
- AC_MSG_ERROR([Invalid default acceleration option])
+ if test "x$SNA" != "xno" -o "x$UXA" != "xno"; then
+ AC_DEFINE(DEFAULT_ACCEL_METHOD, NONE, [Default acceleration method])
+ else
+ AC_MSG_ERROR([Invalid default acceleration option])
+ fi
fi
accel="none"
fi
@@ -865,6 +869,11 @@ test -e `pwd $0`/README && cat `pwd $0`/README
accel_msg=""
if test "x$SNA" != "xno"; then
+ if test "$accel" = "none"; then
+ accel_msg="$accel_msg *none"
+ else
+ accel_msg="$accel_msg none"
+ fi
if test "$accel" = "sna"; then
accel_msg="$accel_msg *sna"
else
@@ -872,6 +881,13 @@ if test "x$SNA" != "xno"; then
fi
fi
if test "x$UXA" != "xno"; then
+ if test "x$SNA" = "xno"; then
+ if test "$accel" = "none"; then
+ accel_msg="$accel_msg *none"
+ else
+ accel_msg="$accel_msg none"
+ fi
+ fi
if test "$accel" = "uxa"; then
accel_msg="$accel_msg *uxa"
else
diff --git a/src/intel_driver.h b/src/intel_driver.h
index 4f6a7641..7ce6b752 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -135,6 +135,11 @@ int intel_get_master(ScrnInfoPtr scrn);
int intel_put_master(ScrnInfoPtr scrn);
void intel_put_device(ScrnInfoPtr scrn);
+#define IS_DEFAULT_ACCEL_METHOD(x) ({ \
+ enum { SNA, UXA, GLAMOR, NONE } default_accel_method__ = DEFAULT_ACCEL_METHOD; \
+ default_accel_method__ == x; \
+})
+
#define hosted() (0)
#endif /* INTEL_DRIVER_H */
diff --git a/src/intel_module.c b/src/intel_module.c
index d6a0d3c5..95200d0c 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -489,7 +489,7 @@ _xf86findDriver(const char *ident, XF86ConfDevicePtr p)
return NULL;
}
-static enum accel_method { SNA, UXA, GLAMOR } get_accel_method(void)
+static enum accel_method { NONE, SNA, UXA, GLAMOR } get_accel_method(void)
{
enum accel_method accel_method = DEFAULT_ACCEL_METHOD;
XF86ConfDevicePtr dev;
@@ -503,7 +503,9 @@ static enum accel_method { SNA, UXA, GLAMOR } get_accel_method(void)
s = xf86FindOptionValue(dev->dev_option_lst, "AccelMethod");
if (s ) {
- if (strcasecmp(s, "sna") == 0)
+ if (strcasecmp(s, "none") == 0)
+ accel_method = NONE;
+ else if (strcasecmp(s, "sna") == 0)
accel_method = SNA;
else if (strcasecmp(s, "uxa") == 0)
accel_method = UXA;
@@ -562,9 +564,14 @@ intel_scrn_create(DriverPtr driver,
#if KMS
switch (get_accel_method()) {
#if USE_SNA
- case SNA: return sna_init_scrn(scrn, entity_num);
+ case NONE:
+ case SNA:
+ return sna_init_scrn(scrn, entity_num);
#endif
#if USE_UXA
+#if !USE_SNA
+ case NONE:
+#endif
case GLAMOR:
case UXA:
return intel_init_scrn(scrn);
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index e4d6f82f..00ff492a 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -17625,7 +17625,7 @@ static bool sna_option_accel_none(struct sna *sna)
s = xf86GetOptValString(sna->Options, OPTION_ACCEL_METHOD);
if (s == NULL)
- return false;
+ return IS_DEFAULT_ACCEL_METHOD(NONE);
return strcasecmp(s, "none") == 0;
}
diff --git a/src/uxa/intel_glamor.c b/src/uxa/intel_glamor.c
index 0be87b80..9d2792f9 100644
--- a/src/uxa/intel_glamor.c
+++ b/src/uxa/intel_glamor.c
@@ -87,12 +87,11 @@ intel_glamor_create_screen_resources(ScreenPtr screen)
static Bool
intel_glamor_enabled(intel_screen_private *intel)
{
- enum { SNA, UXA, GLAMOR } default_accel_method = DEFAULT_ACCEL_METHOD;
const char *s;
s = xf86GetOptValString(intel->Options, OPTION_ACCEL_METHOD);
if (s == NULL)
- return default_accel_method == GLAMOR;
+ return IS_DEFAULT_ACCEL_METHOD(GLAMOR);
return strcasecmp(s, "glamor") == 0;
}
diff --git a/src/uxa/intel_uxa.c b/src/uxa/intel_uxa.c
index b3961881..255a245f 100644
--- a/src/uxa/intel_uxa.c
+++ b/src/uxa/intel_uxa.c
@@ -1421,6 +1421,17 @@ intel_limits_init(intel_screen_private *intel)
}
}
+static Bool intel_option_accel_none(intel_screen_private *intel)
+{
+ const char *s;
+
+ s = xf86GetOptValString(intel->Options, OPTION_ACCEL_METHOD);
+ if (s == NULL)
+ return IS_DEFAULT_ACCEL_METHOD(NONE);
+
+ return strcasecmp(s, "none") == 0;
+}
+
static Bool intel_option_accel_blt(intel_screen_private *intel)
{
const char *s;
@@ -1542,6 +1553,9 @@ Bool intel_uxa_init(ScreenPtr screen)
return FALSE;
}
+ if (intel_option_accel_none(intel))
+ intel->force_fallback = true;
+
uxa_set_fallback_debug(screen, intel->fallback_debug);
uxa_set_force_fallback(screen, intel->force_fallback);