Unverified Commit d6872d4e authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/simplify_nxshm' into 3.6.x

parents 7afe9553 6fd0ffc9
......@@ -490,9 +490,12 @@ ProcShmDetach(client)
return(client->noClientException);
}
#ifndef NXAGENT_SERVER
static void
#ifdef NXAGENT_SERVER
xorg_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
#else
miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
#endif
DrawablePtr dst;
GCPtr pGC;
int depth, w, h, sx, sy, sw, sh, dx, dy;
......@@ -525,6 +528,7 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
(*pmap->drawable.pScreen->DestroyPixmap)(pmap);
}
#ifndef NXAGENT_SERVER
static void
fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
DrawablePtr dst;
......@@ -1138,9 +1142,12 @@ CreatePmap:
return (BadAlloc);
}
#ifndef NXAGENT_SERVER
static int
#ifdef NXAGENT_SERVER
xorg_ProcShmDispatch (client)
#else
ProcShmDispatch (client)
#endif
register ClientPtr client;
{
REQUEST(xReq);
......@@ -1174,7 +1181,6 @@ ProcShmDispatch (client)
return BadRequest;
}
}
#endif /* NXAGENT_SERVER */
static void
SShmCompletionEvent(from, to)
......@@ -1278,9 +1284,12 @@ SProcShmCreatePixmap(client)
return ProcShmCreatePixmap(client);
}
#ifndef NXAGENT_SERVER
static int
#ifdef NXAGENT_SERVER
xorg_SProcShmDispatch (client)
#else
SProcShmDispatch (client)
#endif
register ClientPtr client;
{
REQUEST(xReq);
......@@ -1302,4 +1311,3 @@ SProcShmDispatch (client)
return BadRequest;
}
}
#endif /* NXAGENT_SERVER */
......@@ -164,42 +164,6 @@ ShmExtensionInit(void)
}
static void
nxagent_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
DrawablePtr dst;
GCPtr pGC;
int depth, w, h, sx, sy, sw, sh, dx, dy;
unsigned int format;
char *data;
{
PixmapPtr pmap;
GCPtr putGC;
putGC = GetScratchGC(depth, dst->pScreen);
if (!putGC)
{
return;
}
pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pmap)
{
FreeScratchGC(putGC);
return;
}
ValidateGC((DrawablePtr)pmap, putGC);
(*putGC->ops->PutImage)((DrawablePtr)pmap, putGC, depth, -sx, -sy, w, h, 0,
(format == XYPixmap) ? XYPixmap : ZPixmap, data);
FreeScratchGC(putGC);
if (format == XYBitmap)
(void)(*pGC->ops->CopyPlane)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh,
dx, dy, 1L);
else
(void)(*pGC->ops->CopyArea)((DrawablePtr)pmap, dst, pGC, 0, 0, sw, sh,
dx, dy);
(*pmap->drawable.pScreen->DestroyPixmap)(pmap);
}
static void
miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
DrawablePtr dst;
GCPtr pGC;
......@@ -211,7 +175,7 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
nxagentShmTrap = 0;
nxagent_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data);
xorg_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data);
nxagentShmTrap = 1;
......@@ -486,77 +450,26 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
return result;
}
/* A wrapper that handles the trap. This construct is used
to keep the derived code closer to the original
*/
static int
nxagent_ProcShmDispatch (client)
register ClientPtr client;
ProcShmDispatch (register ClientPtr client)
{
REQUEST(xReq);
int result;
#ifdef NXAGENT_SERVER
#ifdef TEST
fprintf(stderr, "ProcShmDispatch: Going to execute operation [%d] for client [%d].\n",
stuff -> data, client -> index);
REQUEST(xReq);
if (stuff->data <= X_ShmCreatePixmap)
{
fprintf(stderr, "ProcShmDispatch: Request [%s] OPCODE#%d.\n",
nxagentShmRequestLiteral[stuff->data], stuff->data);
fprintf(stderr, "ProcShmDispatch: Request [%s] OPCODE [%d] for client [%d].\n",
nxagentShmRequestLiteral[stuff->data], stuff->data, client->index);
}
#endif
#endif
switch (stuff->data)
{
case X_ShmQueryVersion:
return ProcShmQueryVersion(client);
case X_ShmAttach:
return ProcShmAttach(client);
case X_ShmDetach:
return ProcShmDetach(client);
case X_ShmPutImage:
{
#ifdef NXAGENT_SERVER
#ifdef TEST
fprintf(stderr, "ProcShmDispatch: Going to execute ProcShmPutImage() for client [%d].\n",
client -> index);
#endif
#endif
#ifdef PANORAMIX
if ( !noPanoramiXExtension )
return ProcPanoramiXShmPutImage(client);
#endif
return ProcShmPutImage(client);
}
case X_ShmGetImage:
#ifdef PANORAMIX
if ( !noPanoramiXExtension )
return ProcPanoramiXShmGetImage(client);
#endif
return ProcShmGetImage(client);
case X_ShmCreatePixmap:
#ifdef PANORAMIX
if ( !noPanoramiXExtension )
return ProcPanoramiXShmCreatePixmap(client);
#endif
return ProcShmCreatePixmap(client);
default:
return BadRequest;
}
}
/* A wrapper that handles the trap. This construct is used
to keep the derived code closer to the original
*/
static int
ProcShmDispatch (register ClientPtr client)
{
int result;
nxagentShmTrap = 1;
result = nxagent_ProcShmDispatch(client);
result = xorg_ProcShmDispatch(client);
nxagentShmTrap = 0;
......@@ -564,55 +477,24 @@ ProcShmDispatch (register ClientPtr client)
}
static int
SProcShmDispatch (client)
register ClientPtr client;
SProcShmDispatch (register ClientPtr client)
{
REQUEST(xReq);
int result;
#ifdef TEST
fprintf(stderr, "SProcShmDispatch: Going to execute operation [%d] for client [%d].\n",
stuff -> data, client -> index);
#endif
switch (stuff->data)
REQUEST(xReq);
if (stuff->data <= X_ShmCreatePixmap)
{
case X_ShmQueryVersion:
return SProcShmQueryVersion(client);
case X_ShmAttach:
return SProcShmAttach(client);
case X_ShmDetach:
return SProcShmDetach(client);
case X_ShmPutImage:
{
int result;
#ifdef TEST
fprintf(stderr, "SProcShmDispatch: Going to execute SProcShmPutImage() for client [%d].\n",
client -> index);
#endif
#ifdef NXAGENT_SERVER
nxagentShmTrap = 1;
#endif
fprintf(stderr, "SProcShmDispatch: Request [%s] OPCODE [%d] for client [%d].\n",
nxagentShmRequestLiteral[stuff->data], stuff->data, client->index);
}
#endif
result = SProcShmPutImage(client);
nxagentShmTrap = 1;
#ifdef NXAGENT_SERVER
nxagentShmTrap = 0;
#endif
result = xorg_SProcShmDispatch(client);
#ifdef TEST
fprintf(stderr, "SProcShmDispatch: Returning from SProcShmPutImage() for client [%d].\n",
client -> index);
#endif
nxagentShmTrap = 0;
return result;
}
case X_ShmGetImage:
return SProcShmGetImage(client);
case X_ShmCreatePixmap:
return SProcShmCreatePixmap(client);
default:
return BadRequest;
}
return result;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment