[PATCH 1/2] fixes: Add panoramix support

Dave Airlie airlied at gmail.com
Wed Nov 10 14:33:41 PST 2010


On Thu, Nov 11, 2010 at 6:35 AM, Adam Jackson <ajax at redhat.com> wrote:
> From: David Reveman <davidr at novell.com>
>
> Taken from:
> 583f4dde81d8d5e9101b0289946e1914ea1ee124
>
> With minor style fixes and ported to dixLookupResourceByType.
>
> Signed-off-by: Adam Jackson <ajax at redhat.com>

Reviewed-by: Dave Airlie <airlied at redhat.com>

> ---
>  Xext/panoramiX.c    |    9 ++++++
>  Xext/panoramiXsrv.h |    1 +
>  xfixes/region.c     |   78 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  xfixes/xfixes.c     |   30 +++++++++++++++++++
>  xfixes/xfixesint.h  |   13 ++++++++
>  5 files changed, 131 insertions(+), 0 deletions(-)
>
> diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
> index b73c53f..5a395fc 100644
> --- a/Xext/panoramiX.c
> +++ b/Xext/panoramiX.c
> @@ -53,6 +53,9 @@ Equipment Corporation.
>  #include "servermd.h"
>  #include "resource.h"
>  #include "picturestr.h"
> +#ifdef XFIXES
> +#include "xfixesint.h"
> +#endif
>  #include "modinit.h"
>  #include "protocol-versions.h"
>
> @@ -581,6 +584,9 @@ void PanoramiXExtensionInit(int argc, char *argv[])
>     ProcVector[X_StoreNamedColor] = PanoramiXStoreNamedColor;
>
>     PanoramiXRenderInit ();
> +#ifdef XFIXES
> +    PanoramiXFixesInit ();
> +#endif
>  }
>
>  extern Bool CreateConnectionBlock(void);
> @@ -882,6 +888,9 @@ static void PanoramiXResetProc(ExtensionEntry* extEntry)
>     int                i;
>
>     PanoramiXRenderReset ();
> +#ifdef XFIXES
> +    PanoramiXFixesReset ();
> +#endif
>     screenInfo.numScreens = PanoramiXNumScreens;
>     for (i = 256; i--; )
>        ProcVector[i] = SavedProcVector[i];
> diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h
> index 5b1a3a9..b0a5a6e 100644
> --- a/Xext/panoramiXsrv.h
> +++ b/Xext/panoramiXsrv.h
> @@ -26,6 +26,7 @@ extern _X_EXPORT unsigned long XRT_WINDOW;
>  extern _X_EXPORT unsigned long XRT_PIXMAP;
>  extern _X_EXPORT unsigned long XRT_GC;
>  extern _X_EXPORT unsigned long XRT_COLORMAP;
> +extern _X_EXPORT unsigned long XRT_PICTURE;
>
>  /*
>  * Drivers are allowed to wrap this function.  Each wrapper can decide that the
> diff --git a/xfixes/region.c b/xfixes/region.c
> index 42d5d7c..81ead4d 100644
> --- a/xfixes/region.c
> +++ b/xfixes/region.c
> @@ -842,3 +842,81 @@ SProcXFixesExpandRegion (ClientPtr client)
>     return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
>  }
>
> +#ifdef PANORAMIX
> +#include "panoramiX.h"
> +#include "panoramiXsrv.h"
> +
> +int
> +PanoramiXFixesSetGCClipRegion (ClientPtr client)
> +{
> +    REQUEST(xXFixesSetGCClipRegionReq);
> +    int                    result = Success, j;
> +    PanoramiXRes    *gc;
> +    REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
> +
> +    if ((result = dixLookupResourceByType((void **)&gc, stuff->gc, XRT_GC,
> +                                         client, DixWriteAccess))) {
> +       client->errorValue = stuff->gc;
> +       return result;
> +    }
> +
> +    FOR_NSCREENS_BACKWARD(j) {
> +        stuff->gc = gc->info[j].id;
> +        result = (*PanoramiXSaveXFixesVector[X_XFixesSetGCClipRegion]) (client);
> +        if(result != Success) break;
> +    }
> +
> +    return result;
> +}
> +
> +int
> +PanoramiXFixesSetWindowShapeRegion (ClientPtr client)
> +{
> +    int                    result = Success, j;
> +    PanoramiXRes    *win;
> +    REQUEST(xXFixesSetWindowShapeRegionReq);
> +
> +    REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq);
> +
> +    if ((result = dixLookupResourceByType((void **)&win, stuff->dest,
> +                                         XRT_WINDOW, client,
> +                                         DixWriteAccess))) {
> +       client->errorValue = stuff->dest;
> +       return result;
> +    }
> +
> +    FOR_NSCREENS_FORWARD(j) {
> +       stuff->dest = win->info[j].id;
> +       result = (*PanoramiXSaveXFixesVector[X_XFixesSetWindowShapeRegion]) (client);
> +        if(result != Success) break;
> +    }
> +
> +    return result;
> +}
> +
> +int
> +PanoramiXFixesSetPictureClipRegion (ClientPtr client)
> +{
> +    REQUEST(xXFixesSetPictureClipRegionReq);
> +    int                    result = Success, j;
> +    PanoramiXRes    *pict;
> +
> +    REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq);
> +
> +    if ((result = dixLookupResourceByType((void **)&pict, stuff->picture,
> +                                         XRT_PICTURE, client,
> +                                         DixWriteAccess))) {
> +       client->errorValue = stuff->picture;
> +       return result;
> +    }
> +
> +    FOR_NSCREENS_BACKWARD(j) {
> +        stuff->picture = pict->info[j].id;
> +       result = (*PanoramiXSaveXFixesVector[X_XFixesSetPictureClipRegion]) (client);
> +        if(result != Success) break;
> +    }
> +
> +    return result;
> +}
> +
> +#endif
> diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c
> index 215909d..5dbfbec 100644
> --- a/xfixes/xfixes.c
> +++ b/xfixes/xfixes.c
> @@ -262,3 +262,33 @@ XFixesExtensionInit(void)
>        SetResourceTypeErrorValue(RegionResType, XFixesErrorBase + BadRegion);
>     }
>  }
> +
> +#ifdef PANORAMIX
> +
> +int (*PanoramiXSaveXFixesVector[XFixesNumberRequests])(ClientPtr);
> +
> +void
> +PanoramiXFixesInit (void)
> +{
> +    int i;
> +
> +    for (i = 0; i < XFixesNumberRequests; i++)
> +       PanoramiXSaveXFixesVector[i] = ProcXFixesVector[i];
> +    /*
> +     * Stuff in Xinerama aware request processing hooks
> +     */
> +    ProcXFixesVector[X_XFixesSetGCClipRegion] = PanoramiXFixesSetGCClipRegion;
> +    ProcXFixesVector[X_XFixesSetWindowShapeRegion] = PanoramiXFixesSetWindowShapeRegion;
> +    ProcXFixesVector[X_XFixesSetPictureClipRegion] = PanoramiXFixesSetPictureClipRegion;
> +}
> +
> +void
> +PanoramiXFixesReset (void)
> +{
> +    int i;
> +
> +    for (i = 0; i < XFixesNumberRequests; i++)
> +       ProcXFixesVector[i] = PanoramiXSaveXFixesVector[i];
> +}
> +
> +#endif
> diff --git a/xfixes/xfixesint.h b/xfixes/xfixesint.h
> index f3d5361..9e50993 100644
> --- a/xfixes/xfixesint.h
> +++ b/xfixes/xfixesint.h
> @@ -255,6 +255,15 @@ ProcXFixesExpandRegion (ClientPtr client);
>  int
>  SProcXFixesExpandRegion (ClientPtr client);
>
> +int
> +PanoramiXFixesSetGCClipRegion (ClientPtr client);
> +
> +int
> +PanoramiXFixesSetWindowShapeRegion (ClientPtr client);
> +
> +int
> +PanoramiXFixesSetPictureClipRegion (ClientPtr client);
> +
>  /* Cursor Visibility (Version 4) */
>
>  int
> @@ -269,4 +278,8 @@ ProcXFixesShowCursor (ClientPtr client);
>  int
>  SProcXFixesShowCursor (ClientPtr client);
>
> +extern int (*PanoramiXSaveXFixesVector[XFixesNumberRequests])(ClientPtr);
> +void PanoramiXFixesInit (void);
> +void PanoramiXFixesReset (void);
> +
>  #endif /* _XFIXESINT_H_ */
> --
> 1.7.2.3
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>


More information about the xorg-devel mailing list