[PATCH 2/2] composite: add panoramix support
Dave Airlie
airlied at gmail.com
Wed Nov 10 14:42:35 PST 2010
Some review below
> }
> +
> +#ifdef PANORAMIX
> +#include "panoramiXsrv.h"
> +
> +int (*PanoramiXSaveCompositeVector[CompositeNumberRequests]) (ClientPtr);
> +
> +static int
> +PanoramiXCompositeRedirectWindow (ClientPtr client)
> +{
> + PanoramiXRes *win;
> + int rc = 0, j;
> + REQUEST(xCompositeRedirectWindowReq);
> +
> + REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq);
> +
> + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW,
> + client, DixUnknownAccess))) {
> + client->errorValue = stuff->window;
> + return (rc == BadValue) ? BadWindow : rc;
> + }
> +
> + FOR_NSCREENS_FORWARD(j) {
> + stuff->window = win->info[j].id;
> + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client);
> + if (rc != Success) break;
> + }
> +
> + return rc;
> +}
> +
> +static int
> +PanoramiXCompositeRedirectSubwindows (ClientPtr client)
> +{
> + PanoramiXRes *win;
> + int rc = 0, j;
> + REQUEST(xCompositeRedirectSubwindowsReq);
> +
> + REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq);
> +
> + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW,
> + client, DixUnknownAccess))) {
> + client->errorValue = stuff->window;
> + return (rc == BadValue) ? BadWindow : rc;
> + }
> +
> + FOR_NSCREENS_FORWARD(j) {
> + stuff->window = win->info[j].id;
> + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client);
> + if (rc != Success) break;
> + }
> +
> + return rc;
> +}
> +
> +static int
> +PanoramiXCompositeUnredirectWindow (ClientPtr client)
> +{
> + PanoramiXRes *win;
> + int rc = 0, j;
> + REQUEST(xCompositeUnredirectWindowReq);
> +
> + REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq);
> +
> + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW,
> + client, DixUnknownAccess))) {
> + client->errorValue = stuff->window;
> + return (rc == BadValue) ? BadWindow : rc;
> + }
> +
> + FOR_NSCREENS_FORWARD(j) {
> + stuff->window = win->info[j].id;
> + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client);
> + if (rc != Success) break;
> + }
> +
> + return rc;
> +}
> +
> +static int
> +PanoramiXCompositeUnredirectSubwindows (ClientPtr client)
> +{
> + PanoramiXRes *win;
> + int rc = 0, j;
> + REQUEST(xCompositeUnredirectSubwindowsReq);
> +
> + REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq);
> +
> + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW,
> + client, DixUnknownAccess))) {
> + client->errorValue = stuff->window;
> + return (rc == BadValue) ? BadWindow : rc;
> + }
> +
> + FOR_NSCREENS_FORWARD(j) {
are you missing the stuff->window magic in here?
> + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client);
> + if (rc != Success) break;
> + }
> +
> + return rc;
> +}
> +
> +static int
> +PanoramiXCompositeNameWindowPixmap (ClientPtr client)
> +{
> + WindowPtr pWin;
> + CompWindowPtr cw;
> + PixmapPtr pPixmap;
> + int rc;
> + PanoramiXRes *win, *newPix;
> + int i;
> + REQUEST(xCompositeNameWindowPixmapReq);
> +
> + REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq);
> +
> + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW,
> + client, DixUnknownAccess))) {
> + client->errorValue = stuff->window;
> + return (rc == BadValue) ? BadWindow : rc;
> + }
> +
> + LEGAL_NEW_RESOURCE (stuff->pixmap, client);
> +
> + if(!(newPix = malloc(sizeof(PanoramiXRes))))
> + return BadAlloc;
> +
> + newPix->type = XRT_PIXMAP;
> + newPix->u.pix.shared = FALSE;
> + newPix->info[0].id = stuff->pixmap;
> +
> + for (i = 1; i < PanoramiXNumScreens; i++)
> + newPix->info[i].id = FakeClientID (client->index);
> +
> + FOR_NSCREENS(i) {
Why do we FORWARD if FORWARD == default? (though probably a separate cleanup).
With those addressed, feel free to add my reviewed by.
Dave.
More information about the xorg-devel
mailing list