mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-25 04:09:24 +00:00
xfree86: dri: ProcXF86DRIGetDeviceInfo() use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly and X_SEND_REPLY_WITH_RPCBUF() for sending it all out. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
74f93c4022
commit
31b110cf28
@@ -421,11 +421,6 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client)
|
||||
static int
|
||||
ProcXF86DRIGetDeviceInfo(register ClientPtr client)
|
||||
{
|
||||
xXF86DRIGetDeviceInfoReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = 0
|
||||
};
|
||||
drm_handle_t hFrameBuffer;
|
||||
void *pDevPrivate;
|
||||
|
||||
@@ -436,6 +431,8 @@ ProcXF86DRIGetDeviceInfo(register ClientPtr client)
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
xXF86DRIGetDeviceInfoReply rep = { 0 };
|
||||
|
||||
if (!DRIGetDeviceInfo(screenInfo.screens[stuff->screen],
|
||||
&hFrameBuffer,
|
||||
(int *) &rep.framebufferOrigin,
|
||||
@@ -452,16 +449,10 @@ ProcXF86DRIGetDeviceInfo(register ClientPtr client)
|
||||
rep.hFrameBufferHigh = 0;
|
||||
#endif
|
||||
|
||||
if (rep.devPrivateSize) {
|
||||
rep.length = X_REPLY_HEADER_UNITS(xXF86DRIGetDeviceInfoReply)
|
||||
+ bytes_to_int32(rep.devPrivateSize);
|
||||
}
|
||||
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
|
||||
x_rpcbuf_write_CARD8s(&rpcbuf, pDevPrivate, rep.devPrivateSize);
|
||||
|
||||
WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), &rep);
|
||||
if (rep.length) {
|
||||
WriteToClient(client, rep.devPrivateSize, pDevPrivate);
|
||||
}
|
||||
return Success;
|
||||
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user