summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Verhaegen <libv@skynet.be>2009-10-26 14:29:17 +0100
committerLuc Verhaegen <libv@skynet.be>2009-11-04 15:13:02 +0100
commit8f8952c549c7462a3e452bc26691bac529c12393 (patch)
tree08d08ac2b03b74828128defb4ecf2dce9613b913
parent98f84368d942fef3a0f3a600311c7fc8b8977b4f (diff)
XvMC: Turns out we do not need to tell xine about our Status.
Serverside sync everything on its own anyway. Ain't that nice.
-rw-r--r--lib/xvmc/xvmc_unichrome.c44
-rw-r--r--lib/xvmc/xvmce.c34
-rw-r--r--lib/xvmc/xvmce.h2
-rw-r--r--lib/xvmc/xvmce_proto.h36
-rw-r--r--src/via_mpeg.c1
-rw-r--r--src/via_xvmc.c45
6 files changed, 7 insertions, 155 deletions
diff --git a/lib/xvmc/xvmc_unichrome.c b/lib/xvmc/xvmc_unichrome.c
index 23b4840..ee54ff0 100644
--- a/lib/xvmc/xvmc_unichrome.c
+++ b/lib/xvmc/xvmc_unichrome.c
@@ -316,30 +316,11 @@ XvMCFlushSurface(Display *display, XvMCSurface *surface)
_X_EXPORT Status
XvMCGetSurfaceStatus(Display *display, XvMCSurface *surface, int *stat)
{
- Status status;
- int StatusFlags;
-
MPEGDebug(printf("%s: 0x%08X\n", __func__, surface->surface_id));
- status = XVMCEBufferStatus(display, XvMCPortID,
- surface->surface_id, &StatusFlags);
- if (status != Success) {
- fprintf(stderr, "%s: XvMCEBufferStatusGet failed: %d\n",
- __func__, status);
- return status;
- }
-
- /* since we are slightly smarter than the state that XvMC tracks... */
+ /* Ah, the advantage of tracking everything serverside.
+ - to check whether some */
*stat = 0;
- if (StatusFlags) {
- if (StatusFlags & XVMCE_BUFFERSTATUS_DECODING)
- /* Just like surface, rendering is for 3d. */
- *stat |= XVMC_RENDERING;
- /* ignore XVMCE_BUFFERSTATUS_REFERENCED */
- if (StatusFlags & XVMCE_BUFFERSTATUS_DISPLAYING)
- *stat |= XVMC_DISPLAYING;
- } else
- *stat = 0;
return Success;
}
@@ -351,27 +332,12 @@ XvMCGetSurfaceStatus(Display *display, XvMCSurface *surface, int *stat)
_X_EXPORT Status
XvMCSyncSurface(Display *display, XvMCSurface *surface)
{
- Status status;
- int StatusFlags, i;
-
MPEGDebug(printf("%s: 0x%08X\n", __func__, surface->surface_id));
- for (i = 0; i < 0x1000; i++) {
- status = XVMCEBufferStatus(display, XvMCPortID,
- surface->surface_id, &StatusFlags);
- if (status != Success) {
- fprintf(stderr, "%s: XvMCEBufferStatusGet failed: %d\n",
- __func__, status);
- return status;
- }
-
- if (!StatusFlags)
- return Success;
- }
+ /* This implementation syncs right before flipping at the end of the
+ XvPutImage. */
- fprintf(stderr, "%s: time out when syncing Buffer 0x%X.\n",
- __func__, surface->surface_id);
- return BadValue; /* whatever */
+ return Success;
}
diff --git a/lib/xvmc/xvmce.c b/lib/xvmc/xvmce.c
index ea9db43..6a068c7 100644
--- a/lib/xvmc/xvmce.c
+++ b/lib/xvmc/xvmce.c
@@ -163,40 +163,6 @@ XvMCEQMatrixSend(Display *dpy, XvPortID port, char type,
*
*/
Status
-XVMCEBufferStatus(Display *dpy, XvPortID port, XID Buffer, int *StatusFlags)
-{
- XExtDisplayInfo *info = XvMCEFindDisplay(dpy);
- xvmceBufferStatusReq *req;
- xvmceBufferStatusReply reply;
- Status status;
-
- XvMCECheckExtension(dpy, info, BadImplementation);
-
- LockDisplay(dpy);
-
- XvMCEGetReq(BufferStatus, req);
-
- req->Port = port;
- req->Buffer = Buffer;
-
- if (_XReply(dpy, (xReply *)&reply, 0, xFalse)) {
- *StatusFlags = reply.StatusFlags;
- status = Success;
- } else {
- fprintf(stderr, "%s; Xreply failed.\n", __func__);
- status = BadAccess;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return status;
-}
-
-/*
- *
- */
-Status
XVMCEBufferSliceInit(Display *dpy, XvPortID port, XID Buffer,
CARD8 PictureType, CARD8 SliceFlags,
Bool HasBackwardsReference, XID BackwardsReference,
diff --git a/lib/xvmc/xvmce.h b/lib/xvmc/xvmce.h
index fae1f2f..7144381 100644
--- a/lib/xvmc/xvmce.h
+++ b/lib/xvmc/xvmce.h
@@ -28,8 +28,6 @@ Status XvMCEQueryExtension(Display *display, int *Version, int *Release,
int *event_basep, int *error_basep);
Status XvMCEQMatrixSend(Display *display, XvPortID port, char type,
const unsigned char qmatrix[64]);
-Status XVMCEBufferStatus(Display *dpy, XvPortID port, XID Buffer,
- int *StatusFlags);
Status XVMCEBufferSliceInit(Display *dpy, XvPortID port, XID Buffer,
CARD8 PictureType, CARD8 SliceFlags,
Bool HasBackwardsReference, XID BackwardsReference,
diff --git a/lib/xvmc/xvmce_proto.h b/lib/xvmc/xvmce_proto.h
index 47777f1..e396c20 100644
--- a/lib/xvmc/xvmce_proto.h
+++ b/lib/xvmc/xvmce_proto.h
@@ -34,9 +34,8 @@
#define xvmce_QueryExtension 0
#define xvmce_QMatrixSend 1
-#define xvmce_BufferStatus 2
-#define xvmce_BufferSliceInit 3
-#define xvmce_BufferSliceSend 4
+#define xvmce_BufferSliceInit 2
+#define xvmce_BufferSliceSend 3
/*
* Version, are we compatible?
@@ -78,37 +77,6 @@ typedef struct {
} xvmceQMatrixSendReq;
#define sz_xvmceQMatrixSendReq 12
-
-/*
- *
- */
-typedef struct {
- CARD8 reqType;
- CARD8 xvmceReqType; /* xvmce_BufferStatus */
- CARD16 length B16;
- CARD32 Port B32;
- CARD32 Buffer B32;
-} xvmceBufferStatusReq;
-#define sz_xvmceBufferStatusReq 12
-
-typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad0;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
-#define XVMCE_BUFFERSTATUS_DECODING 1
-#define XVMCE_BUFFERSTATUS_REFERENCED 2
-#define XVMCE_BUFFERSTATUS_DISPLAYING 4
- CARD32 StatusFlags B32;
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
-} xvmceBufferStatusReply;
-#define sz_xvmceBufferStatusReply 32
-
-
/*
*
*/
diff --git a/src/via_mpeg.c b/src/via_mpeg.c
index 935fe48..c1a7ba4 100644
--- a/src/via_mpeg.c
+++ b/src/via_mpeg.c
@@ -571,4 +571,3 @@ ViaMpegDestroy(ScrnInfoPtr pScrn)
xfree(Swov->Mpeg);
Swov->Mpeg = NULL;
}
-
diff --git a/src/via_xvmc.c b/src/via_xvmc.c
index d775f79..fbf153e 100644
--- a/src/via_xvmc.c
+++ b/src/via_xvmc.c
@@ -124,49 +124,6 @@ XvMCEProcQMatrixSend(ClientPtr client)
*
*/
static int
-XvMCEProcBufferStatus(ClientPtr client)
-{
- ExtensionEntry *XvMCE_Ext;
- struct XvMCEPrivates *Private;
- ScrnInfoPtr pScrn;
- XvPortPtr Port;
- xvmceBufferStatusReply reply;
-
- REQUEST(xvmceBufferStatusReq);
- REQUEST_SIZE_MATCH(xvmceBufferStatusReq);
-
- XvMCE_Ext = CheckExtension(XVMCE_EXT_NAME);
- if (!XvMCE_Ext || !XvMCE_Ext->extPrivate) {
- xf86Msg(X_WARNING, "%s: Extension not initialised.\n", __func__);
- return BadMatch;
- }
-
- Private = XvMCE_Ext->extPrivate;
- pScrn = xf86Screens[Private->scrnIndex];
-
- /* Does our client own this port? */
- Port = LookupIDByType(stuff->Port, XvGetRTPort());
- if (!Port) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "%s: Client doesn't own this Xv Port.\n", __func__);
- return BadAccess;
- }
-
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = (sizeof(xvmceBufferStatusReply) - sizeof(xGenericReply)) >> 2;
- // FIXME !!!
- reply.StatusFlags = 0;
-
- WriteToClient(client, sizeof(xvmceBufferStatusReply), (char *)&reply);
-
- return (client->noClientException);
-}
-
-/*
- *
- */
-static int
XvMCEProcBufferSliceInit(ClientPtr client)
{
ExtensionEntry *XvMCE_Ext;
@@ -342,8 +299,6 @@ XvMCEHandler(ClientPtr client)
return XvMCEProcQueryExtension(client);
case xvmce_QMatrixSend:
return XvMCEProcQMatrixSend(client);
- case xvmce_BufferStatus:
- return XvMCEProcBufferStatus(client);
case xvmce_BufferSliceInit:
return XvMCEProcBufferSliceInit(client);
case xvmce_BufferSliceSend: