[PATCH 09/13] xserver: randr: Panning support

Matthias Hopf mhopf at suse.de
Thu Dec 4 03:37:14 PST 2008


On Nov 28, 08 11:11:22 -0800, Keith Packard wrote:
> On Fri, 2008-11-28 at 17:49 +0100, Matthias Hopf wrote:
> 
> > +    if (crtc->funcs->pan &&
> > +	memcmp (mode, &saved_mode, sizeof(saved_mode)) == 0 &&
> > +	saved_rotation == rotation) {
> > +	crtc->funcs->pan (crtc, crtc->x, crtc->y);
> > +	ret = TRUE;
> > +	goto done;
> > +    }
> 
> I think this also need to check for transformation changes? And output
> property changes?

I haven't looked into transformation yet, but you're probably right.
I don't see ATM how output properties could influence panning.

> Should we call the low-level operation 'set_origin' instead of 'pan'?

No objections from my side.

> > +    int				    pointerX;
> > +    int				    pointerY;
> 
> I'd prefer to not shadow the pointer position inside RandR; is there
> some way we can use the DIX pointer position here?

Actually, that was the one thing that was getting on my nerves as well.
But if *you* don't know a possibility, I certainly don't.

> We should also start to consider how MPX plays with panning.

Right. The shadowing should automatically take care of that it
*principally* works, but you might want to either disable panning by
some of the pointers, or specify that one has precedence over another,
or...
I don't think this should be done ad-hoc. We have to think about it.

> > +static Bool
> > +xf86RandR13SetPanning (ScreenPtr           pScreen,
> > +		       RRCrtcPtr           randr_crtc,
> > +		       BoxPtr              totalArea,
> > +		       BoxPtr              trackingArea,
> > +		       INT16               *border)
> > +{
> > +    XF86RandRInfoPtr	randrp  = XF86RANDRINFO(pScreen);
> > +    xf86CrtcPtr		crtc = randr_crtc->devPrivate;
> > +    int			ret;
> > +
> > +    if (crtc->version < 2)
> > +	return FALSE;
> > +    if (totalArea)
> > +	memcpy (&crtc->panningTotalArea, totalArea, sizeof(BoxRec));
> > +    if (trackingArea)
> > +	memcpy (&crtc->panningTrackingArea, trackingArea, sizeof(BoxRec));
> > +    if (border)
> > +	memcpy (crtc->panningBorder, border, 4*sizeof(INT16));
> > +    ret = xf86RandR13VerifyPanningArea (crtc, pScreen->width, pScreen->height);
> > +    xf86RandR13Pan (crtc, randrp->pointerX, randrp->pointerY);
> 
> Probably need to verify before setting -- protocol requests should
> either succeed or fail without side effects. It looks to me like we

Right. Forgot about that so far.

> smash the old settings before checking the requested data. That would
> mean that VerifyPanningArea would take the three rectangles as separate
> arguments instead of pulling them from the crtc.

Actually, no. The way it's used in other places it should change the
crtc, I'm thinking more about saving and restoring the data.

Matthias

-- 
Matthias Hopf <mhopf at suse.de>      __        __   __
Maxfeldstr. 5 / 90409 Nuernberg   (_   | |  (_   |__          mat at mshopf.de
Phone +49-911-74053-715           __)  |_|  __)  |__  R & D   www.mshopf.de



More information about the xorg mailing list