From 9f3fc9ec49f0caf53344577896ef9b6468cd3d4f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 28 Jan 2014 21:56:23 +0000 Subject: [PATCH] Allow selection of glamor as the default acceleration method Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74162 Signed-off-by: Chris Wilson --- configure.ac | 19 ++++++++++++++++--- src/intel_module.c | 8 +++++--- src/uxa/intel_glamor.c | 3 ++- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 9ceb37dd..ce4822fa 100644 --- a/configure.ac +++ b/configure.ac @@ -535,11 +535,24 @@ if test "x$accel" = "xuxa"; then AC_MSG_ERROR([UXA requested as default, but is not enabled]) fi fi -AC_MSG_RESULT($accel) -if test "x$accel" = "xnone" -a "x$KMS" = "xyes"; then - AC_MSG_ERROR([No default acceleration option]) + +if test "x$accel" = "xglamor"; then + if test "x$GLAMOR" != "xno"; then + AC_DEFINE(DEFAULT_ACCEL_METHOD, GLAMOR, [Default acceleration method]) + have_accel="yes" + else + AC_MSG_ERROR([glamor acceleration requested as default, but is not enabled]) + fi fi +if test "x$have_accel" = "xnone"; then + if test "x$KMS" = "xyes"; then + AC_MSG_ERROR([Invalid default acceleration option]) + fi + accel="none" +fi +AC_MSG_RESULT($accel) + xp_msg="" AC_ARG_ENABLE(rendernode, diff --git a/src/intel_module.c b/src/intel_module.c index fb8734a9..51de62ad 100644 --- a/src/intel_module.c +++ b/src/intel_module.c @@ -441,7 +441,7 @@ _xf86findDriver(const char *ident, XF86ConfDevicePtr p) return NULL; } -static enum accel_method { UXA, SNA } get_accel_method(void) +static enum accel_method { SNA, UXA, GLAMOR } get_accel_method(void) { enum accel_method accel_method = DEFAULT_ACCEL_METHOD; XF86ConfDevicePtr dev; @@ -460,7 +460,7 @@ static enum accel_method { UXA, SNA } get_accel_method(void) else if (strcasecmp(s, "uxa") == 0) accel_method = UXA; else if (strcasecmp(s, "glamor") == 0) - accel_method = UXA; + accel_method = GLAMOR; } } @@ -517,7 +517,9 @@ intel_scrn_create(DriverPtr driver, case SNA: return sna_init_scrn(scrn, entity_num); #endif #if USE_UXA - case UXA: return intel_init_scrn(scrn); + case GLAMOR: + case UXA: + return intel_init_scrn(scrn); #endif default: break; diff --git a/src/uxa/intel_glamor.c b/src/uxa/intel_glamor.c index 7f59e29a..4d1c7679 100644 --- a/src/uxa/intel_glamor.c +++ b/src/uxa/intel_glamor.c @@ -76,11 +76,12 @@ 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 FALSE; + return default_accel_method == GLAMOR; return strcasecmp(s, "glamor") == 0; }