summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/intel_driver.c63
-rw-r--r--src/intel_module.c8
-rw-r--r--src/intel_opts.h67
-rw-r--r--src/sna/sna.h15
-rw-r--r--src/sna/sna_display.c2
-rw-r--r--src/sna/sna_driver.c25
-rw-r--r--src/sna/sna_video.c2
-rw-r--r--src/sna/sna_video_overlay.c2
8 files changed, 85 insertions, 99 deletions
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 09c306ce..09307c4e 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -75,58 +75,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i915_drm.h"
#include <xf86drmMode.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_USE_SNA,
-} 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_USE_SNA, "UseSna", OPTV_BOOLEAN, {0}, FALSE},
- {-1, NULL, OPTV_NONE, {0}, FALSE}
-};
-/* *INDENT-ON* */
+#include "intel_opts.h"
static void i830AdjustFrame(int scrnIndex, int x, int y, int flags);
static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen);
@@ -155,7 +104,7 @@ I830DPRINTF(const char *filename, int line, const char *function,
/* Export I830 options to i830 driver where necessary */
const OptionInfoRec *intel_uxa_available_options(int chipid, int busid)
{
- return I830Options;
+ return intelOptions;
}
static void
@@ -293,9 +242,9 @@ static Bool I830GetEarlyOptions(ScrnInfoPtr scrn)
/* Process the options */
xf86CollectOptions(scrn, NULL);
- if (!(intel->Options = malloc(sizeof(I830Options))))
+ if (!(intel->Options = malloc(sizeof(intelOptions))))
return FALSE;
- memcpy(intel->Options, I830Options, sizeof(I830Options));
+ memcpy(intel->Options, intelOptions, sizeof(intelOptions));
xf86ProcessOptions(scrn->scrnIndex, scrn->options, intel->Options);
intel->fallback_debug = xf86ReturnOptValBool(intel->Options,
@@ -1383,9 +1332,9 @@ static Bool intelPreInit(ScrnInfoPtr scrn, int flags)
* need SNA... */
xf86CollectOptions(scrn, NULL);
- if (!(Options = malloc(sizeof(I830Options))))
+ if (!(Options = malloc(sizeof(intelOptions))))
return FALSE;
- memcpy(Options, I830Options, sizeof(I830Options));
+ memcpy(Options, intelOptions, sizeof(intelOptions));
xf86ProcessOptions(scrn->scrnIndex, scrn->options, Options);
xf86DrvMsg(0, X_INFO, "Detecting SNA...\n");
diff --git a/src/intel_module.c b/src/intel_module.c
index 0f4b84a2..e3dbc34a 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -40,6 +40,8 @@
#include <xf86drmMode.h>
+#include "intel_opts.h"
+
static struct intel_device_info *chipset_info;
static const struct intel_device_info intel_i81x_info = {
@@ -381,11 +383,7 @@ intel_available_options(int chipid, int busid)
#endif
default:
-#if USE_SNA
- return sna_available_options(chipid, busid);
-#else
- return intel_uxa_available_options(chipid, busid);
-#endif
+ return intelOptions;
}
}
diff --git a/src/intel_opts.h b/src/intel_opts.h
new file mode 100644
index 00000000..200e45cb
--- /dev/null
+++ b/src/intel_opts.h
@@ -0,0 +1,67 @@
+/* *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_USE_SNA,
+#ifdef USE_SNA
+ OPTION_THROTTLE,
+ OPTION_VMAP,
+ OPTION_ZAPHOD,
+ OPTION_DELAYED_FLUSH,
+#endif
+ NUM_OPTIONS,
+} intelOpts;
+
+static OptionInfoRec intelOptions[] = {
+ {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_USE_SNA, "UseSna", OPTV_BOOLEAN, {0}, FALSE},
+#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
+ {-1, NULL, OPTV_NONE, {0}, FALSE}
+};
+/* *INDENT-ON* */
+
+
diff --git a/src/sna/sna.h b/src/sna/sna.h
index d79e9a85..97e094f5 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -195,21 +195,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,
EXPIRE_TIMER,
NUM_TIMERS
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index e8d2c2a5..2993d636 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -43,6 +43,8 @@
#include "sna.h"
#include "sna_reg.h"
+#include "intel_opts.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 bd20969a..7e562e21 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -65,6 +65,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "sna_video.h"
#include "intel_driver.h"
+#include "intel_opts.h"
#include <sys/ioctl.h>
#include <sys/fcntl.h>
@@ -80,31 +81,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define DBG(x) ErrorF x
#endif
-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)
@@ -284,10 +265,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(intelOptions))))
return FALSE;
- memcpy(sna->Options, sna_options, sizeof(sna_options));
+ memcpy(sna->Options, intelOptions, sizeof(intelOptions));
xf86ProcessOptions(scrn->scrnIndex, scrn->options, sna->Options);
return TRUE;
diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c
index d3788fd0..f0f291ef 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_opts.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 9ba78ef4..284ee75b 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_opts.h"
+
#if DEBUG_VIDEO_OVERLAY
#undef DBG
#define DBG(x) ErrorF x