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

This commit is contained in:
Maxim Levitsky 2008-11-05 13:47:09 -08:00 committed by Eric Anholt
parent 040d9bf9d8
commit d828b0802c
4 changed files with 24 additions and 2 deletions

View File

@ -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

View File

@ -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;

View File

@ -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))) {

View File

@ -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)