Xext: xv: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros

Use the new macros to make request struct parsing / field swapping
much easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2024-07-08 21:32:14 +02:00
parent 39d6fa6591
commit 237ff20eb5

View File

@@ -31,6 +31,7 @@ SOFTWARE.
#include <X11/extensions/Xvproto.h>
#include "dix/dix_priv.h"
#include "dix/request_priv.h"
#include "dix/rpcbuf_priv.h"
#include "dix/request_priv.h"
#include "dix/screenint_priv.h"
@@ -186,7 +187,7 @@ SingleXvPutVideo(ClientPtr client)
GCPtr pGC;
int status;
REQUEST(xvPutVideoReq);
REQUEST_HEAD_STRUCT(xvPutVideoReq);
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
@@ -237,13 +238,13 @@ ProcXvPutVideo(ClientPtr client)
static int
SingleXvPutStill(ClientPtr client)
{
REQUEST_HEAD_STRUCT(xvPutStillReq);
DrawablePtr pDraw;
XvPortPtr pPort;
GCPtr pGC;
int status;
REQUEST(xvPutStillReq);
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
@@ -439,12 +440,14 @@ ProcXvUngrabPort(ClientPtr client)
static int
SingleXvStopVideo(ClientPtr client)
{
REQUEST_HEAD_STRUCT(xvStopVideoReq);
REQUEST_FIELD_CARD32(port);
REQUEST_FIELD_CARD32(drawable);
int ret;
DrawablePtr pDraw;
XvPortPtr pPort;
REQUEST(xvStopVideoReq);
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
@@ -475,11 +478,13 @@ ProcXvStopVideo(ClientPtr client)
static int
SingleXvSetPortAttribute(ClientPtr client)
{
REQUEST_HEAD_STRUCT(xvSetPortAttributeReq);
REQUEST_FIELD_CARD32(port);
REQUEST_FIELD_CARD32(attribute);
REQUEST_FIELD_CARD32(value);
int status;
XvPortPtr pPort;
REQUEST(xvSetPortAttributeReq);
VALIDATE_XV_PORT(stuff->port, pPort, DixSetAttrAccess);
if (!ValidAtom(stuff->attribute)) {
@@ -626,6 +631,8 @@ ProcXvQueryPortAttributes(ClientPtr client)
static int
SingleXvPutImage(ClientPtr client)
{
REQUEST_HEAD_AT_LEAST(xvPutImageReq);
DrawablePtr pDraw;
XvPortPtr pPort;
XvImagePtr pImage = NULL;
@@ -633,8 +640,6 @@ SingleXvPutImage(ClientPtr client)
int status, i, size;
CARD16 width, height;
REQUEST(xvPutImageReq);
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
@@ -715,6 +720,8 @@ ProcXvPutImage(ClientPtr client)
static int
SingleXvShmPutImage(ClientPtr client)
{
REQUEST_HEAD_STRUCT(xvShmPutImageReq);
ShmDescPtr shmdesc;
DrawablePtr pDraw;
XvPortPtr pPort;
@@ -723,8 +730,6 @@ SingleXvShmPutImage(ClientPtr client)
int status, size_needed, i;
CARD16 width, height;
REQUEST(xvShmPutImageReq);
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);