API changes for RandR transform additions

Keith Packard keithp at keithp.com
Wed Mar 19 09:26:11 PDT 2008


Here's a summary of the API changes I'm proposing to support RandR
transforms.

I think the most important are the structure member additions, so here's
the changes to the xf86Crtc and RRCrtcRec structures:
        
        diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
        index b87a325..ce6bc29 100644
        --- a/hw/xfree86/modes/xf86Crtc.h
        +++ b/hw/xfree86/modes/xf86Crtc.h
        @@ -305,7 +305,13 @@ struct _xf86Crtc {
              * Current transformation matrix
              */
             PictTransform   crtc_to_framebuffer;
        -    PictTransform   framebuffer_to_crtc;
        +    struct pict_f_transform f_crtc_to_framebuffer;
        +    struct pict_f_transform f_framebuffer_to_crtc;
        +    PictFilterPtr   filter;
        +    xFixed         *params;
        +    int                    nparams;
        +    int                    filter_width;
        +    int                    filter_height;
             Bool           transform_in_use;
             /**
              * Bounding box in screen space

These members could be moved to the end of this structure, but I don't
think drivers were using the later structure members anyway.
        
        diff --git a/randr/randrstr.h b/randr/randrstr.h
        index 3b48f5c..9555e1f 100644
        --- a/randr/randrstr.h
        +++ b/randr/randrstr.h
        @@ -116,6 +128,12 @@ struct _rrCrtc {
             CARD16         *gammaBlue;
             CARD16         *gammaGreen;
             void           *devPrivate;
        +    Bool           transforms;
        +    RRTransformRec  client_pending_transform;
        +    RRTransformRec  client_current_transform;
        +    PictTransform   transform;
        +    struct pict_f_transform f_transform;
        +    struct pict_f_transform f_inverse;
         };

These are all added at the end of the structure, which should keep
existing drivers happy.

To deal with expanding the redisplay area when using a filter, I added
dimensions support to the various Render filter APIs:

        diff --git a/render/picturestr.h b/render/picturestr.h
        index acd15c7..c2647cb 100644
        --- a/render/picturestr.h
        +++ b/render/picturestr.h
        @@ -184,12 +192,14 @@ typedef struct _Picture {
             SourcePictPtr   pSourcePict;
         } PictureRec;
        
        -typedef Bool (*PictFilterValidateParamsProcPtr) (PicturePtr pPicture, int id,
        -                                                xFixed *params, int nparams);
        +typedef Bool (*PictFilterValidateParamsProcPtr) (ScreenPtr pScreen, int id,
        +                                                xFixed *params, int nparams,
        +                                                int *width, int *height);
         typedef struct {
             char                           *name;
             int                                    id;
             PictFilterValidateParamsProcPtr ValidateParams;
        +    int                                    width, height;
         } PictFilterRec, *PictFilterPtr;
        
This would break any out-of-tree filters, but I don't think there are
any.

Another significant change is that the modes/xf86Rotate.c code no longer
in-lines a copy of RRComputeTransform and various other matrix
functions. It would be possible (I think) to split these functions out
so that suitable files from randr and render could be included in a
driver source tarball. Would this be useful?

Beyond these modest structure and API changes, there are a pile of new
functions.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20080319/89e9d22b/attachment.pgp>


More information about the xorg mailing list