xf86-video-intel: man/intel.man src/i830_driver.c src/i830.h src/i830_video.c

Eric Anholt anholt at kemper.freedesktop.org
Wed Nov 5 13:51:20 PST 2008


 man/intel.man     |    9 +++++++++
 src/i830.h        |    1 +
 src/i830_driver.c |    4 ++++
 src/i830_video.c  |   12 ++++++++++--
 4 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit d828b0802c939cb12664db4dd157a4944a4db01b
Author: Maxim Levitsky <maximlevitsky at gmail.com>
Date:   Wed Nov 5 13:47:09 2008 -0800

    Add an option to make the overlay be the first XV adaptor.

diff --git a/man/intel.man b/man/intel.man
index 15ab234..1d30d1c 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 12aecf8..8d57fa0 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 26fef83..bb92836 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 316bc61..216ed47 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)


More information about the xorg-commit mailing list