diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index 077e3df80a..d7937aabb4 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -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