static int ProcXF86DRIGetDeviceInfo( register ClientPtr client ) { xXF86DRIGetDeviceInfoReply rep; drm_handle_t hFrameBuffer; void *pDevPrivate; REQUEST(xXF86DRIGetDeviceInfoReq); REQUEST_SIZE_MATCH(xXF86DRIGetDeviceInfoReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; if (!DRIGetDeviceInfo( screenInfo.screens[stuff->screen], &hFrameBuffer, (int*)&rep.framebufferOrigin, (int*)&rep.framebufferSize, (int*)&rep.framebufferStride, (int*)&rep.devPrivateSize, &pDevPrivate)) { return BadValue; } rep.hFrameBufferLow = (CARD32)(hFrameBuffer & 0xffffffff); #if defined(LONG64) && !defined(__linux__) rep.hFrameBufferHigh = (CARD32)(hFrameBuffer >> 32); #else rep.hFrameBufferHigh = 0; #endif rep.length = 0; if (rep.devPrivateSize) { rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetDeviceInfoReply) - SIZEOF(xGenericReply) + pad_to_int32(rep.devPrivateSize)); } WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), (char *)&rep); if (rep.length) { WriteToClient(client, rep.devPrivateSize, (char *)pDevPrivate); } return Success; }
static int ProcXF86DRIGetDeviceInfo( register ClientPtr client ) { xXF86DRIGetDeviceInfoReply rep; drm_handle_t hFrameBuffer; void *pDevPrivate; REQUEST(xXF86DRIGetDeviceInfoReq); REQUEST_SIZE_MATCH(xXF86DRIGetDeviceInfoReq); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; if (!DRIGetDeviceInfo( screenInfo.screens[stuff->screen], &hFrameBuffer, (int*)&rep.framebufferOrigin, (int*)&rep.framebufferSize, (int*)&rep.framebufferStride, (int*)&rep.devPrivateSize, &pDevPrivate)) { return BadValue; } rep.hFrameBufferLow = (CARD32)(hFrameBuffer & 0xffffffff); #ifdef LONG64 rep.hFrameBufferHigh = (CARD32)(hFrameBuffer >> 32); #else rep.hFrameBufferHigh = 0; #endif rep.length = 0; if (rep.devPrivateSize) { rep.length = (SIZEOF(xXF86DRIGetDeviceInfoReply) - SIZEOF(xGenericReply) + ((rep.devPrivateSize + 3) & ~3)) >> 2; }