xf86-video-intel: 2 commits - configure.ac src/common.h src/intel_display.c src/intel_driver.c src/intel_driver.h src/intel_glamor.c src/intel_module.c src/intel_options.h src/legacy/i810 src/legacy/legacy.h src/Makefile.am src/sna/sna_display.c src/sna/sna_driver.c src/sna/sna.h src/sna/sna_module.h src/sna/sna_video.c src/sna/sna_video_overlay.c src/sna/sna_video_sprite.c
Chris Wilson
ickle at kemper.freedesktop.org
Thu May 24 11:03:46 PDT 2012
configure.ac | 38 +++++++++++++++++
src/Makefile.am | 1
src/common.h | 2
src/intel_display.c | 1
src/intel_driver.c | 66 ++----------------------------
src/intel_driver.h | 2
src/intel_glamor.c | 15 +++++++
src/intel_module.c | 90 ++++++++++++++++++++++++++++--------------
src/intel_options.h | 75 +++++++++++++++++++++++++++++++++++
src/legacy/i810/i810_driver.c | 3 -
src/legacy/legacy.h | 2
src/sna/sna.h | 15 -------
src/sna/sna_display.c | 2
src/sna/sna_driver.c | 32 ++++----------
src/sna/sna_module.h | 4 -
src/sna/sna_video.c | 2
src/sna/sna_video_overlay.c | 2
src/sna/sna_video_sprite.c | 2
18 files changed, 217 insertions(+), 137 deletions(-)
New commits:
commit e45629135065d0cc73c285f8df35ab4e1d07c6dc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu May 24 18:22:45 2012 +0100
Allow runtime switching of AccelMethod between uxa/sna and even glamor
Section "Device"
Option "AccelMethod" "uxa/glamor/sna"
EndSection
The appropriate backend must also be enabled at compile time for the
runtime option to be available (i.e. --enable-uxa (default) --enable-sna
--enable-glamor)
Demanded-by: Adam Jackson <ajax at redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50290
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/configure.ac b/configure.ac
index c031a26..a025521 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,6 +158,43 @@ if test "x$GLAMOR" != "xno"; then
AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration])
fi
+AC_ARG_WITH(default-accel,
+ AS_HELP_STRING([--with-default-accel],
+ [Select the default acceleration method [default=sna if enabled, otherwise uxa]]),
+ [accel="$withval"],
+ [accel=auto])
+
+AC_MSG_CHECKING([which acceleration method to use by default])
+if test "x$accel" = xauto; then
+ if test "x$UXA" != "xno"; then
+ accel=uxa
+ else
+ if test "x$SNA" != "xno"; then
+ accel=sna
+ fi
+ fi
+ if test "x$accel" = xauto; then
+ AC_MSG_ERROR([No default acceleration option])
+ fi
+fi
+
+if test "x$accel" = xsna; then
+ if test "x$SNA" != "xno"; then
+ AC_DEFINE(DEFAULT_ACCEL_METHOD, SNA, [Default acceleration method])
+ else
+ AC_MSG_ERROR([SNA requested as default, but is not enabled])
+ fi
+fi
+
+if test "x$accel" = xuxa; then
+ if test "x$UXA" != "xno"; then
+ AC_DEFINE(DEFAULT_ACCEL_METHOD, UXA, [Default acceleration method])
+ else
+ AC_MSG_ERROR([UXA requested as default, but is not enabled])
+ fi
+fi
+AC_MSG_RESULT($accel)
+
AC_ARG_ENABLE(vmap,
AS_HELP_STRING([--enable-vmap],
[Enable use of vmap [default=no]]),
@@ -174,7 +211,6 @@ AC_ARG_ENABLE(debug,
[Enables internal debugging [default=no]]),
[DEBUG="$enableval"],
[DEBUG=no])
-
# Store the list of server defined optional extensions in REQUIRED_MODULES
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
diff --git a/src/common.h b/src/common.h
index 06b2192..e3ab1f2 100644
--- a/src/common.h
+++ b/src/common.h
@@ -63,7 +63,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* I830 hooks for the I810 driver setup/probe. */
extern const OptionInfoRec *I830AvailableOptions(int chipid, int busid);
-extern void intel_init_scrn(ScrnInfoPtr scrn);
+extern Bool intel_init_scrn(ScrnInfoPtr scrn);
/* Symbol lists shared by the i810 and i830 parts. */
extern int I830EntityIndex;
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 6b2ab80..60f43bb 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -1236,7 +1236,7 @@ static Bool I830PMEvent(int scrnIndex, pmEvent event, Bool undo)
return TRUE;
}
-void intel_init_scrn(ScrnInfoPtr scrn)
+Bool intel_init_scrn(ScrnInfoPtr scrn)
{
scrn->PreInit = I830PreInit;
scrn->ScreenInit = I830ScreenInit;
@@ -1247,4 +1247,5 @@ void intel_init_scrn(ScrnInfoPtr scrn)
scrn->FreeScreen = I830FreeScreen;
scrn->ValidMode = I830ValidMode;
scrn->PMEvent = I830PMEvent;
+ return TRUE;
}
diff --git a/src/intel_glamor.c b/src/intel_glamor.c
index 4741d58..5c0186e 100644
--- a/src/intel_glamor.c
+++ b/src/intel_glamor.c
@@ -172,6 +172,18 @@ intel_glamor_finish_access(PixmapPtr pixmap, uxa_access_t access)
return;
}
+static Bool
+intel_glamor_enabled(intel_screen_private *intel)
+{
+ const char *s;
+
+ s = xf86GetOptString(intel->Options, ACCEL_METHOD);
+ if (s == NULL)
+ return FALSE;
+
+ return strcasecmp(s, "glamor") == 0;
+}
+
Bool
intel_glamor_init(ScreenPtr screen)
{
@@ -181,6 +193,9 @@ intel_glamor_init(ScreenPtr screen)
if ((intel->uxa_flags & UXA_GLAMOR_EGL_INITIALIZED) == 0)
goto fail;
+ if (!intel_glamor_enabled(intel))
+ goto fail;
+
if (!glamor_init(screen, GLAMOR_INVERTED_Y_AXIS | GLAMOR_USE_EGL_SCREEN)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Failed to initialize glamor.\n");
diff --git a/src/intel_module.c b/src/intel_module.c
index ac6dae1..4430ac6 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -31,6 +31,7 @@
#include <xf86.h>
#include <xf86_OSproc.h>
#include <xf86cmap.h>
+#include <xf86Parser.h>
#include <xf86drmMode.h>
#include <xorgVersion.h>
@@ -292,6 +293,43 @@ static Bool has_kernel_mode_setting(struct pci_device *dev)
return ret == 0;
}
+extern XF86ConfigPtr xf86configptr;
+
+static XF86ConfDevicePtr
+_xf86findDriver(const char *ident, XF86ConfDevicePtr p)
+{
+ while (p) {
+ if (xf86nameCompare(ident, p->dev_driver) == 0)
+ return p;
+
+ p = p->list.next;
+ }
+ return NULL;
+}
+
+static enum accel_method { UXA, SNA } get_accel_method(void)
+{
+ enum accel_method accel_method = DEFAULT_ACCEL_METHOD;
+ XF86ConfDevicePtr dev;
+
+ dev = _xf86findDriver("intel", xf86configptr->conf_device_lst);
+ if (dev && dev->dev_option_lst) {
+ const char *s;
+
+ s = xf86FindOptionValue(dev->dev_option_lst, "AccelMethod");
+ if (s ) {
+ if (strcasecmp(s, "sna") == 0)
+ accel_method = SNA;
+ else if (strcasecmp(s, "uxa") == 0)
+ accel_method = UXA;
+ else if (strcasecmp(s, "glamor") == 0)
+ accel_method = UXA;
+ }
+ }
+
+ return accel_method;
+}
+
/*
* intel_pci_probe --
*
@@ -338,34 +376,35 @@ static Bool intel_pci_probe(DriverPtr driver,
scrn = xf86ConfigPciEntity(NULL, 0, entity_num, intel_pci_chipsets,
NULL, NULL, NULL, NULL, NULL);
- if (scrn != NULL) {
- scrn->driverVersion = INTEL_VERSION;
- scrn->driverName = INTEL_DRIVER_NAME;
- scrn->name = INTEL_NAME;
- scrn->Probe = NULL;
+ if (scrn == NULL)
+ return FALSE;
+
+ scrn->driverVersion = INTEL_VERSION;
+ scrn->driverName = INTEL_DRIVER_NAME;
+ scrn->name = INTEL_NAME;
+ scrn->Probe = NULL;
- switch (DEVICE_ID(device)) {
#if !KMS_ONLY
- case PCI_CHIP_I810:
- case PCI_CHIP_I810_DC100:
- case PCI_CHIP_I810_E:
- case PCI_CHIP_I815:
- lg_i810_init(scrn);
- break;
+ switch (DEVICE_ID(device)) {
+ case PCI_CHIP_I810:
+ case PCI_CHIP_I810_DC100:
+ case PCI_CHIP_I810_E:
+ case PCI_CHIP_I815:
+ return lg_i810_init(scrn);
+ }
#endif
- default:
+ switch (get_accel_method()) {
#if USE_SNA
- sna_init_scrn(scrn, entity_num);
-#elif USE_UXA
- intel_init_scrn(scrn);
-#else
- scrn = NULL;
+ case SNA: return sna_init_scrn(scrn, entity_num);
#endif
- break;
- }
+
+#if USE_UXA
+ case UXA: return intel_init_scrn(scrn);
+#endif
+
+ default: return FALSE;
}
- return scrn != NULL;
}
#ifdef XFree86LOADER
diff --git a/src/intel_options.h b/src/intel_options.h
index 9367751..8863878 100644
--- a/src/intel_options.h
+++ b/src/intel_options.h
@@ -8,6 +8,7 @@
*/
enum intel_options {
+ OPTION_ACCEL_METHOD,
OPTION_DRI,
OPTION_VIDEO_KEY,
OPTION_COLOR_KEY,
@@ -40,6 +41,7 @@ enum intel_options {
};
static OptionInfoRec intel_options[] = {
+ {OPTION_ACCEL_METHOD, "AccelMethod", OPTV_STRING, {0}, 0},
{OPTION_DRI, "DRI", OPTV_BOOLEAN, {0}, TRUE},
{OPTION_COLOR_KEY, "ColorKey", OPTV_INTEGER, {0}, FALSE},
{OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE},
diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
index 09d52c5..6ead393 100644
--- a/src/legacy/i810/i810_driver.c
+++ b/src/legacy/i810/i810_driver.c
@@ -2102,7 +2102,7 @@ lg_i810_available_options(int chipid, int busid)
}
-void lg_i810_init(ScrnInfoPtr scrn)
+Bool lg_i810_init(ScrnInfoPtr scrn)
{
scrn->PreInit = I810PreInit;
scrn->ScreenInit = I810ScreenInit;
@@ -2112,4 +2112,5 @@ void lg_i810_init(ScrnInfoPtr scrn)
scrn->LeaveVT = I810LeaveVT;
scrn->FreeScreen = I810FreeScreen;
scrn->ValidMode = I810ValidMode;
+ return TRUE;
}
diff --git a/src/legacy/legacy.h b/src/legacy/legacy.h
index 7bdd172..0ff3299 100644
--- a/src/legacy/legacy.h
+++ b/src/legacy/legacy.h
@@ -1,3 +1,3 @@
/* The old i810 (only) driver. */
const OptionInfoRec *lg_i810_available_options(int chipid, int busid);
-void lg_i810_init(ScrnInfoPtr scrn);
+Bool lg_i810_init(ScrnInfoPtr scrn);
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 5d42e69..fb54a24 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -1047,7 +1047,7 @@ static Bool sna_pm_event(int scrnIndex, pmEvent event, Bool undo)
return TRUE;
}
-void sna_init_scrn(ScrnInfoPtr scrn, int entity_num)
+Bool sna_init_scrn(ScrnInfoPtr scrn, int entity_num)
{
EntityInfoPtr entity;
@@ -1081,8 +1081,13 @@ void sna_init_scrn(ScrnInfoPtr scrn, int entity_num)
xf86SetEntitySharable(scrn->entityList[0]);
entity = xf86GetEntityInfo(entity_num);
+ if (!entity)
+ return FALSE;
+
xf86SetEntityInstanceForScreen(scrn,
entity->index,
xf86GetNumEntityInstances(entity->index)-1);
free(entity);
+
+ return TRUE;
}
diff --git a/src/sna/sna_module.h b/src/sna/sna_module.h
index aa1ae0d..1b46cb7 100644
--- a/src/sna/sna_module.h
+++ b/src/sna/sna_module.h
@@ -1 +1 @@
-void sna_init_scrn(ScrnInfoPtr scrn, int entity_num);
+Bool sna_init_scrn(ScrnInfoPtr scrn, int entity_num);
commit df6ab02c3690eea8393ecc8c113e2f2891856cc6
Author: Eugeni Dodonov <eugeni.dodonov at intel.com>
Date: Mon Oct 31 14:43:22 2011 -0200
Unify options handling between UXA and SNA
Unifies available options for both UXA and SNA drivers, and
moves them into a common header file, intel_opts.h.
Signed-off-by: Eugeni Dodonov <eugeni.dodonov at intel.com>
diff --git a/src/Makefile.am b/src/Makefile.am
index fd139ee..d057e43 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -42,6 +42,7 @@ NULL:=#
intel_drv_la_SOURCES = \
intel_list.h \
+ intel_options.h \
intel_module.c \
compat-api.h \
$(NULL)
diff --git a/src/intel_display.c b/src/intel_display.c
index 77a1cce..89f7259 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -1702,7 +1702,6 @@ int intel_crtc_to_pipe(xf86CrtcPtr crtc)
Bool intel_crtc_on(xf86CrtcPtr crtc)
{
- ScrnInfoPtr scrn = crtc->scrn;
struct intel_crtc *intel_crtc = crtc->driver_private;
drmModeCrtcPtr drm_crtc;
Bool ret;
diff --git a/src/intel_driver.c b/src/intel_driver.c
index b055437..6b2ab80 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -78,59 +78,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <xf86drmMode.h>
#include "intel_glamor.h"
-
-/* *INDENT-OFF* */
-/*
- * Note: "ColorKey" is provided for compatibility with the i810 driver.
- * However, the correct option name is "VideoKey". "ColorKey" usually
- * refers to the tranparency key for 8+24 overlays, not for video overlays.
- */
-
-typedef enum {
- OPTION_DRI,
- OPTION_VIDEO_KEY,
- OPTION_COLOR_KEY,
- OPTION_FALLBACKDEBUG,
- OPTION_TILING_FB,
- OPTION_TILING_2D,
- OPTION_SHADOW,
- OPTION_SWAPBUFFERS_WAIT,
- OPTION_TRIPLE_BUFFER,
-#ifdef INTEL_XVMC
- OPTION_XVMC,
-#endif
- OPTION_PREFER_OVERLAY,
- OPTION_DEBUG_FLUSH_BATCHES,
- OPTION_DEBUG_FLUSH_CACHES,
- OPTION_DEBUG_WAIT,
- OPTION_HOTPLUG,
- OPTION_RELAXED_FENCING,
- OPTION_BUFFER_CACHE,
-} I830Opts;
-
-static OptionInfoRec I830Options[] = {
- {OPTION_DRI, "DRI", OPTV_BOOLEAN, {0}, TRUE},
- {OPTION_COLOR_KEY, "ColorKey", OPTV_INTEGER, {0}, FALSE},
- {OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE},
- {OPTION_FALLBACKDEBUG, "FallbackDebug", OPTV_BOOLEAN, {0}, FALSE},
- {OPTION_TILING_2D, "Tiling", OPTV_BOOLEAN, {0}, TRUE},
- {OPTION_TILING_FB, "LinearFramebuffer", OPTV_BOOLEAN, {0}, FALSE},
- {OPTION_SHADOW, "Shadow", OPTV_BOOLEAN, {0}, FALSE},
- {OPTION_SWAPBUFFERS_WAIT, "SwapbuffersWait", OPTV_BOOLEAN, {0}, TRUE},
- {OPTION_TRIPLE_BUFFER, "TripleBuffer", OPTV_BOOLEAN, {0}, TRUE},
-#ifdef INTEL_XVMC
- {OPTION_XVMC, "XvMC", OPTV_BOOLEAN, {0}, TRUE},
-#endif
- {OPTION_PREFER_OVERLAY, "XvPreferOverlay", OPTV_BOOLEAN, {0}, FALSE},
- {OPTION_DEBUG_FLUSH_BATCHES, "DebugFlushBatches", OPTV_BOOLEAN, {0}, FALSE},
- {OPTION_DEBUG_FLUSH_CACHES, "DebugFlushCaches", OPTV_BOOLEAN, {0}, FALSE},
- {OPTION_DEBUG_WAIT, "DebugWait", OPTV_BOOLEAN, {0}, FALSE},
- {OPTION_HOTPLUG, "HotPlug", OPTV_BOOLEAN, {0}, TRUE},
- {OPTION_RELAXED_FENCING, "RelaxedFencing", OPTV_BOOLEAN, {0}, TRUE},
- {OPTION_BUFFER_CACHE, "BufferCache", OPTV_BOOLEAN, {0}, TRUE},
- {-1, NULL, OPTV_NONE, {0}, FALSE}
-};
-/* *INDENT-ON* */
+#include "intel_options.h"
static void i830AdjustFrame(int scrnIndex, int x, int y, int flags);
static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen);
@@ -140,11 +88,6 @@ static Bool I830EnterVT(int scrnIndex, int flags);
extern void xf86SetCursor(ScreenPtr screen, CursorPtr pCurs, int x, int y);
/* Export I830 options to i830 driver where necessary */
-const OptionInfoRec *intel_uxa_available_options(int chipid, int busid)
-{
- return I830Options;
-}
-
static void
I830LoadPalette(ScrnInfoPtr scrn, int numColors, int *indices,
LOCO * colors, VisualPtr pVisual)
@@ -278,9 +221,9 @@ static Bool I830GetEarlyOptions(ScrnInfoPtr scrn)
/* Process the options */
xf86CollectOptions(scrn, NULL);
- if (!(intel->Options = malloc(sizeof(I830Options))))
+ if (!(intel->Options = malloc(sizeof(intel_options))))
return FALSE;
- memcpy(intel->Options, I830Options, sizeof(I830Options));
+ memcpy(intel->Options, intel_options, sizeof(intel_options));
xf86ProcessOptions(scrn->scrnIndex, scrn->options, intel->Options);
intel->fallback_debug = xf86ReturnOptValBool(intel->Options,
diff --git a/src/intel_driver.h b/src/intel_driver.h
index 98973e5..f33d135 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -247,7 +247,5 @@ void intel_detect_chipset(ScrnInfoPtr scrn,
struct pci_device *pci,
struct intel_chipset *chipset);
-const OptionInfoRec *intel_uxa_available_options(int chipid, int busid);
-
#endif /* INTEL_DRIVER_H */
diff --git a/src/intel_module.c b/src/intel_module.c
index c6f94f5..ac6dae1 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -41,6 +41,7 @@
#include "common.h"
#include "intel_driver.h"
+#include "intel_options.h"
#include "legacy/legacy.h"
#include "sna/sna_module.h"
@@ -397,13 +398,7 @@ intel_available_options(int chipid, int busid)
#endif
default:
-#if USE_SNA
- return sna_available_options(chipid, busid);
-#elif USE_UXA
- return intel_uxa_available_options(chipid, busid);
-#else
- return NULL;
-#endif
+ return intel_options;
}
}
diff --git a/src/intel_options.h b/src/intel_options.h
new file mode 100644
index 0000000..9367751
--- /dev/null
+++ b/src/intel_options.h
@@ -0,0 +1,73 @@
+#ifndef INTEL_OPTIONS_H
+#define INTEL_OPTIONS_H
+
+/*
+ * Note: "ColorKey" is provided for compatibility with the i810 driver.
+ * However, the correct option name is "VideoKey". "ColorKey" usually
+ * refers to the tranparency key for 8+24 overlays, not for video overlays.
+ */
+
+enum intel_options {
+ OPTION_DRI,
+ OPTION_VIDEO_KEY,
+ OPTION_COLOR_KEY,
+ OPTION_TILING_FB,
+ OPTION_TILING_2D,
+ OPTION_SHADOW,
+ OPTION_SWAPBUFFERS_WAIT,
+ OPTION_TRIPLE_BUFFER,
+#ifdef INTEL_XVMC
+ OPTION_XVMC,
+#endif
+ OPTION_PREFER_OVERLAY,
+ OPTION_DEBUG_FLUSH_BATCHES,
+ OPTION_DEBUG_FLUSH_CACHES,
+ OPTION_DEBUG_WAIT,
+ OPTION_HOTPLUG,
+ OPTION_RELAXED_FENCING,
+ OPTION_USE_SNA,
+#ifdef USE_SNA
+ OPTION_THROTTLE,
+ OPTION_VMAP,
+ OPTION_ZAPHOD,
+ OPTION_DELAYED_FLUSH,
+#endif
+#ifdef USE_UXA
+ OPTION_FALLBACKDEBUG,
+ OPTION_BUFFER_CACHE,
+#endif
+ NUM_OPTIONS,
+};
+
+static OptionInfoRec intel_options[] = {
+ {OPTION_DRI, "DRI", OPTV_BOOLEAN, {0}, TRUE},
+ {OPTION_COLOR_KEY, "ColorKey", OPTV_INTEGER, {0}, FALSE},
+ {OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE},
+ {OPTION_TILING_2D, "Tiling", OPTV_BOOLEAN, {0}, TRUE},
+ {OPTION_TILING_FB, "LinearFramebuffer", OPTV_BOOLEAN, {0}, FALSE},
+ {OPTION_SHADOW, "Shadow", OPTV_BOOLEAN, {0}, FALSE},
+ {OPTION_SWAPBUFFERS_WAIT, "SwapbuffersWait", OPTV_BOOLEAN, {0}, TRUE},
+ {OPTION_TRIPLE_BUFFER, "TripleBuffer", OPTV_BOOLEAN, {0}, TRUE},
+#ifdef INTEL_XVMC
+ {OPTION_XVMC, "XvMC", OPTV_BOOLEAN, {0}, TRUE},
+#endif
+ {OPTION_PREFER_OVERLAY, "XvPreferOverlay", OPTV_BOOLEAN, {0}, FALSE},
+ {OPTION_DEBUG_FLUSH_BATCHES, "DebugFlushBatches", OPTV_BOOLEAN, {0}, FALSE},
+ {OPTION_DEBUG_FLUSH_CACHES, "DebugFlushCaches", OPTV_BOOLEAN, {0}, FALSE},
+ {OPTION_DEBUG_WAIT, "DebugWait", OPTV_BOOLEAN, {0}, FALSE},
+ {OPTION_HOTPLUG, "HotPlug", OPTV_BOOLEAN, {0}, TRUE},
+ {OPTION_RELAXED_FENCING, "RelaxedFencing", OPTV_BOOLEAN, {0}, TRUE},
+#ifdef USE_SNA
+ {OPTION_THROTTLE, "Throttle", OPTV_BOOLEAN, {0}, TRUE},
+ {OPTION_VMAP, "UseVmap", OPTV_BOOLEAN, {0}, TRUE},
+ {OPTION_ZAPHOD, "ZaphodHeads", OPTV_STRING, {0}, FALSE},
+ {OPTION_DELAYED_FLUSH, "DelayedFlush", OPTV_BOOLEAN, {0}, TRUE},
+#endif
+#ifdef USE_UXA
+ {OPTION_FALLBACKDEBUG, "FallbackDebug", OPTV_BOOLEAN, {0}, FALSE},
+ {OPTION_BUFFER_CACHE, "BufferCache", OPTV_BOOLEAN, {0}, TRUE},
+#endif
+ {-1, NULL, OPTV_NONE, {0}, FALSE}
+};
+
+#endif /* INTEL_OPTIONS_H */
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 879940d..5f7b526 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -194,21 +194,6 @@ static inline struct sna_gc *sna_gc(GCPtr gc)
}
enum {
- OPTION_TILING_FB,
- OPTION_TILING_2D,
- OPTION_PREFER_OVERLAY,
- OPTION_COLOR_KEY,
- OPTION_VIDEO_KEY,
- OPTION_HOTPLUG,
- OPTION_THROTTLE,
- OPTION_RELAXED_FENCING,
- OPTION_VMAP,
- OPTION_ZAPHOD,
- OPTION_DELAYED_FLUSH,
- NUM_OPTIONS
-};
-
-enum {
FLUSH_TIMER = 0,
THROTTLE_TIMER,
EXPIRE_TIMER,
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index b8cf3cc..f1fcdbc 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -45,6 +45,8 @@
#include "sna.h"
#include "sna_reg.h"
+#include "intel_options.h"
+
#if DEBUG_DISPLAY
#undef DBG
#define DBG(x) ErrorF x
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index d0b5bde..5d42e69 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -55,6 +55,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "sna_video.h"
#include "intel_driver.h"
+#include "intel_options.h"
#include <sys/ioctl.h>
#include <sys/fcntl.h>
@@ -76,31 +77,11 @@ DevPrivateKeyRec sna_gc_index;
DevPrivateKeyRec sna_glyph_key;
DevPrivateKeyRec sna_glyph_image_key;
-static OptionInfoRec sna_options[] = {
- {OPTION_TILING_FB, "LinearFramebuffer", OPTV_BOOLEAN, {0}, FALSE},
- {OPTION_TILING_2D, "Tiling", OPTV_BOOLEAN, {0}, TRUE},
- {OPTION_PREFER_OVERLAY, "XvPreferOverlay", OPTV_BOOLEAN, {0}, FALSE},
- {OPTION_COLOR_KEY, "ColorKey", OPTV_INTEGER, {0}, FALSE},
- {OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE},
- {OPTION_HOTPLUG, "HotPlug", OPTV_BOOLEAN, {0}, TRUE},
- {OPTION_THROTTLE, "Throttle", OPTV_BOOLEAN, {0}, TRUE},
- {OPTION_RELAXED_FENCING, "UseRelaxedFencing", OPTV_BOOLEAN, {0}, TRUE},
- {OPTION_VMAP, "UseVmap", OPTV_BOOLEAN, {0}, TRUE},
- {OPTION_ZAPHOD, "ZaphodHeads", OPTV_STRING, {0}, FALSE},
- {OPTION_DELAYED_FLUSH, "DelayedFlush", OPTV_BOOLEAN, {0}, TRUE},
- {-1, NULL, OPTV_NONE, {0}, FALSE}
-};
-
static Bool sna_enter_vt(int scrnIndex, int flags);
/* temporary */
extern void xf86SetCursor(ScreenPtr screen, CursorPtr pCurs, int x, int y);
-const OptionInfoRec *sna_available_options(int chipid, int busid)
-{
- return sna_options;
-}
-
static void
sna_load_palette(ScrnInfoPtr scrn, int numColors, int *indices,
LOCO * colors, VisualPtr pVisual)
@@ -280,10 +261,10 @@ static Bool sna_get_early_options(ScrnInfoPtr scrn)
/* Process the options */
xf86CollectOptions(scrn, NULL);
- if (!(sna->Options = malloc(sizeof(sna_options))))
+ if (!(sna->Options = malloc(sizeof(intel_options))))
return FALSE;
- memcpy(sna->Options, sna_options, sizeof(sna_options));
+ memcpy(sna->Options, intel_options, sizeof(intel_options));
xf86ProcessOptions(scrn->scrnIndex, scrn->options, sna->Options);
return TRUE;
diff --git a/src/sna/sna_module.h b/src/sna/sna_module.h
index 97d5dd5..aa1ae0d 100644
--- a/src/sna/sna_module.h
+++ b/src/sna/sna_module.h
@@ -1,3 +1 @@
-const OptionInfoRec *sna_available_options(int chipid, int busid);
void sna_init_scrn(ScrnInfoPtr scrn, int entity_num);
-
diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c
index c80ccfb..1f6e210 100644
--- a/src/sna/sna_video.c
+++ b/src/sna/sna_video.c
@@ -57,6 +57,8 @@
#include "sna_reg.h"
#include "sna_video.h"
+#include "intel_options.h"
+
#include <xf86xv.h>
#include <X11/extensions/Xv.h>
diff --git a/src/sna/sna_video_overlay.c b/src/sna/sna_video_overlay.c
index ba6f671..eb39a25 100644
--- a/src/sna/sna_video_overlay.c
+++ b/src/sna/sna_video_overlay.c
@@ -36,6 +36,8 @@
#include <fourcc.h>
#include <i915_drm.h>
+#include "intel_options.h"
+
#if DEBUG_VIDEO_OVERLAY
#undef DBG
#define DBG(x) ErrorF x
diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c
index 0e5f3ab..fff31fb 100644
--- a/src/sna/sna_video_sprite.c
+++ b/src/sna/sna_video_sprite.c
@@ -31,6 +31,8 @@
#include "sna.h"
#include "sna_video.h"
+#include "intel_options.h"
+
#include <xf86xv.h>
#include <X11/extensions/Xv.h>
#include <fourcc.h>
More information about the xorg-commit
mailing list