summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Levitsky <maximlevitsky at gmail.com>2008-11-05 13:47:09 -0800
committerEric Anholt <eric@anholt.net>2008-11-05 13:51:19 -0800
commitd828b0802c939cb12664db4dd157a4944a4db01b (patch)
treec63e232352a69319fec78340b315e4a56cd40185
parent040d9bf9d8748d1ed8f977a6356d198def978b51 (diff)
Add an option to make the overlay be the first XV adaptor.
-rw-r--r--man/intel.man9
-rw-r--r--src/i830.h1
-rw-r--r--src/i830_driver.c4
-rw-r--r--src/i830_video.c12
4 files changed, 24 insertions, 2 deletions
diff --git a/man/intel.man b/man/intel.man
index 15ab2345..1d30d1c3 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -134,6 +134,15 @@ other drivers.
Disable or enable XVideo support.
Default: XVideo is enabled for configurations where it is supported.
.TP
+.BI "Option \*qXvPreferOverlay\*q \*q" boolean \*q
+Make hardware overlay be the first XV adaptor.
+The overlay behaves incorrectly in the presence of compositing, but some prefer
+it due to it syncing to vblank in the absence of compositing. While most
+XV-using applications have options to select which XV adaptor to use, this
+option can be used to place the overlay first for applications which don't
+have options for selecting adaptors.
+Default: Textured video adaptor is preferred.
+.TP
.BI "Option \*qLegacy3D\*q \*q" boolean \*q
Enable support for the non-GEM mode of the 3D driver on i830 and newer.
This will allocate a large static area for older Mesa to use for its texture
diff --git a/src/i830.h b/src/i830.h
index 12aecf8b..8d57fa08 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -554,6 +554,7 @@ typedef struct _I830Rec {
Bool XvDisabled; /* Xv disabled in PreInit. */
Bool XvEnabled; /* Xv enabled for this generation. */
+ Bool XvPreferOverlay;
#ifdef I830_XV
int colorKey;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 26fef83c..bb92836e 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -313,6 +313,7 @@ typedef enum {
OPTION_XVMC,
#endif
OPTION_FORCE_SDVO_DETECT,
+ OPTION_PREFER_OVERLAY,
} I830Opts;
static OptionInfoRec I830Options[] = {
@@ -339,6 +340,7 @@ static OptionInfoRec I830Options[] = {
{OPTION_XVMC, "XvMC", OPTV_BOOLEAN, {0}, TRUE},
#endif
{OPTION_FORCE_SDVO_DETECT, "ForceSDVODetect", OPTV_BOOLEAN, {0}, FALSE},
+ {OPTION_PREFER_OVERLAY, "XvPreferOverlay", OPTV_BOOLEAN, {0}, FALSE},
{-1, NULL, OPTV_NONE, {0}, FALSE}
};
/* *INDENT-ON* */
@@ -1665,6 +1667,8 @@ I830XvInit(ScrnInfoPtr pScrn)
pI830->XvDisabled =
!xf86ReturnOptValBool(pI830->Options, OPTION_XVIDEO, TRUE);
+ pI830->XvPreferOverlay = xf86ReturnOptValBool(pI830->Options, OPTION_PREFER_OVERLAY, FALSE);
+
#ifdef I830_XV
if (xf86GetOptValInteger(pI830->Options, OPTION_VIDEO_KEY,
&(pI830->colorKey))) {
diff --git a/src/i830_video.c b/src/i830_video.c
index 316bc61e..216ed476 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -611,7 +611,6 @@ I830InitVideo(ScreenPtr pScreen)
{
texturedAdaptor = I830SetupImageVideoTextured(pScreen);
if (texturedAdaptor != NULL) {
- adaptors[num_adaptors++] = texturedAdaptor;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Set up textured video\n");
} else {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -625,7 +624,6 @@ I830InitVideo(ScreenPtr pScreen)
{
overlayAdaptor = I830SetupImageVideoOverlay(pScreen);
if (overlayAdaptor != NULL) {
- adaptors[num_adaptors++] = overlayAdaptor;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Set up overlay video\n");
} else {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -633,6 +631,16 @@ I830InitVideo(ScreenPtr pScreen)
}
I830InitOffscreenImages(pScreen);
}
+
+ if (overlayAdaptor && pI830->XvPreferOverlay)
+ adaptors[num_adaptors++] = overlayAdaptor;
+
+ if (texturedAdaptor)
+ adaptors[num_adaptors++] = texturedAdaptor;
+
+ if (overlayAdaptor && !pI830->XvPreferOverlay)
+ adaptors[num_adaptors++] = overlayAdaptor;
+
#ifdef INTEL_XVMC
if (intel_xvmc_probe(pScrn)) {
if (texturedAdaptor)