summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni.dodonov@intel.com>2011-10-31 14:43:22 -0200
committerChris Wilson <chris@chris-wilson.co.uk>2012-05-24 18:47:41 +0100
commitdf6ab02c3690eea8393ecc8c113e2f2891856cc6 (patch)
tree73cc04b76c7bd85442d684a895f388389ce54dd4 /src
parentae2be7e25bda46551381c19a673b321b4382e1f9 (diff)
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@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/intel_display.c1
-rw-r--r--src/intel_driver.c63
-rw-r--r--src/intel_driver.h2
-rw-r--r--src/intel_module.c9
-rw-r--r--src/intel_options.h73
-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_module.h2
-rw-r--r--src/sna/sna_video.c2
-rw-r--r--src/sna/sna_video_overlay.c2
-rw-r--r--src/sna/sna_video_sprite.c2
13 files changed, 90 insertions, 109 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index fd139ee2..d057e435 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 77a1cce1..89f7259b 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 b0554374..6b2ab803 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 98973e5d..f33d1352 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 c6f94f5b..ac6dae11 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 00000000..93677511
--- /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 879940dc..5f7b526a 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 b8cf3cc9..f1fcdbc0 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 d0b5bde3..5d42e69c 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 97d5dd5e..aa1ae0d3 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 c80ccfb7..1f6e210c 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 ba6f6714..eb39a25e 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 0e5f3ab4..fff31fb3 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>