aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/xvdisp.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xext/xvdisp.c')
-rw-r--r--xorg-server/Xext/xvdisp.c98
1 files changed, 6 insertions, 92 deletions
diff --git a/xorg-server/Xext/xvdisp.c b/xorg-server/Xext/xvdisp.c
index f2d49a2b8..0bdfed370 100644
--- a/xorg-server/Xext/xvdisp.c
+++ b/xorg-server/Xext/xvdisp.c
@@ -297,9 +297,6 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep)
if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \
else WriteToClient(_c, sz_xvImageFormatInfo, _d)
-#define _AllocatePort(_i,_p) \
- ((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success
-
static int
ProcXvQueryExtension(ClientPtr client)
{
@@ -356,8 +353,6 @@ ProcXvQueryAdaptors(ClientPtr client)
return Success;
}
- (*pxvs->ddQueryAdaptors) (pScreen, &pxvs->pAdaptors, &pxvs->nAdaptors);
-
rep = (xvQueryAdaptorsReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
@@ -422,18 +417,12 @@ ProcXvQueryEncodings(ClientPtr client)
XvPortPtr pPort;
int ne;
XvEncodingPtr pe;
- int status;
REQUEST(xvQueryEncodingsReq);
REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
rep = (xvQueryEncodingsReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
@@ -485,11 +474,6 @@ ProcXvPutVideo(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
if (!(pPort->pAdaptor->type & XvInputMask) ||
!(pPort->pAdaptor->type & XvVideoMask)) {
client->errorValue = stuff->port;
@@ -520,11 +504,6 @@ ProcXvPutStill(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
if (!(pPort->pAdaptor->type & XvInputMask) ||
!(pPort->pAdaptor->type & XvStillMask)) {
client->errorValue = stuff->port;
@@ -555,11 +534,6 @@ ProcXvGetVideo(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
if (!(pPort->pAdaptor->type & XvOutputMask) ||
!(pPort->pAdaptor->type & XvVideoMask)) {
client->errorValue = stuff->port;
@@ -590,11 +564,6 @@ ProcXvGetStill(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixReadAccess);
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
if (!(pPort->pAdaptor->type & XvOutputMask) ||
!(pPort->pAdaptor->type & XvStillMask)) {
client->errorValue = stuff->port;
@@ -631,7 +600,6 @@ ProcXvSelectVideoNotify(ClientPtr client)
static int
ProcXvSelectPortNotify(ClientPtr client)
{
- int status;
XvPortPtr pPort;
REQUEST(xvSelectPortNotifyReq);
@@ -639,11 +607,6 @@ ProcXvSelectPortNotify(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
return XvdiSelectPortNotify(client, pPort, stuff->onoff);
}
@@ -659,11 +622,6 @@ ProcXvGrabPort(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
status = XvdiGrabPort(client, pPort, stuff->time, &result);
if (status != Success) {
@@ -684,7 +642,6 @@ ProcXvGrabPort(ClientPtr client)
static int
ProcXvUngrabPort(ClientPtr client)
{
- int status;
XvPortPtr pPort;
REQUEST(xvGrabPortReq);
@@ -692,18 +649,13 @@ ProcXvUngrabPort(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
return XvdiUngrabPort(client, pPort, stuff->time);
}
static int
ProcXvStopVideo(ClientPtr client)
{
- int status, ret;
+ int ret;
DrawablePtr pDraw;
XvPortPtr pPort;
@@ -712,11 +664,6 @@ ProcXvStopVideo(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
if (ret != Success)
return ret;
@@ -735,11 +682,6 @@ ProcXvSetPortAttribute(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixSetAttrAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
if (!ValidAtom(stuff->attribute)) {
client->errorValue = stuff->attribute;
return BadAtom;
@@ -769,11 +711,6 @@ ProcXvGetPortAttribute(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
if (!ValidAtom(stuff->attribute)) {
client->errorValue = stuff->attribute;
return BadAtom;
@@ -800,7 +737,6 @@ ProcXvGetPortAttribute(ClientPtr client)
static int
ProcXvQueryBestSize(ClientPtr client)
{
- int status;
unsigned int actual_width, actual_height;
XvPortPtr pPort;
xvQueryBestSizeReply rep;
@@ -810,12 +746,7 @@ ProcXvQueryBestSize(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
- (*pPort->pAdaptor->ddQueryBestSize) (client, pPort, stuff->motion,
+ (*pPort->pAdaptor->ddQueryBestSize) (pPort, stuff->motion,
stuff->vid_w, stuff->vid_h,
stuff->drw_w, stuff->drw_h,
&actual_width, &actual_height);
@@ -836,7 +767,7 @@ ProcXvQueryBestSize(ClientPtr client)
static int
ProcXvQueryPortAttributes(ClientPtr client)
{
- int status, size, i;
+ int size, i;
XvPortPtr pPort;
XvAttributePtr pAtt;
xvQueryPortAttributesReply rep;
@@ -847,11 +778,6 @@ ProcXvQueryPortAttributes(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
rep = (xvQueryPortAttributesReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
@@ -902,11 +828,6 @@ ProcXvPutImage(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
if (!(pPort->pAdaptor->type & XvImageMask) ||
!(pPort->pAdaptor->type & XvInputMask)) {
client->errorValue = stuff->port;
@@ -930,8 +851,7 @@ ProcXvPutImage(ClientPtr client)
width = stuff->width;
height = stuff->height;
- size = (*pPort->pAdaptor->ddQueryImageAttributes) (client,
- pPort, pImage, &width,
+ size = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width,
&height, NULL, NULL);
size += sizeof(xvPutImageReq);
size = bytes_to_int32(size);
@@ -968,11 +888,6 @@ ProcXvShmPutImage(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
- if ((status = _AllocatePort(stuff->port, pPort)) != Success) {
- client->errorValue = stuff->port;
- return status;
- }
-
if (!(pPort->pAdaptor->type & XvImageMask) ||
!(pPort->pAdaptor->type & XvInputMask)) {
client->errorValue = stuff->port;
@@ -1001,8 +916,7 @@ ProcXvShmPutImage(ClientPtr client)
width = stuff->width;
height = stuff->height;
- size_needed = (*pPort->pAdaptor->ddQueryImageAttributes) (client,
- pPort, pImage,
+ size_needed = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage,
&width, &height,
NULL, NULL);
if ((size_needed + stuff->offset) > shmdesc->size)
@@ -1086,7 +1000,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
width = stuff->width;
height = stuff->height;
- size = (*pPort->pAdaptor->ddQueryImageAttributes) (client, pPort, pImage,
+ size = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage,
&width, &height, offsets,
pitches);