[PATCHv2] dix: add 3x3 transformation matrix xinput property for multi-head handling

Peter Hutterer peter.hutterer at who-t.net
Sun May 23 16:24:41 PDT 2010


On Sun, May 23, 2010 at 09:22:06PM +0200, Peter Korsgaard wrote:
> >>>>> "Peter" == Peter Hutterer <peter.hutterer at who-t.net> writes:
> 
> Hi,
> 
>  >> /**
>  >> * DIX property handler.
>  >> */
>  >> @@ -115,6 +158,14 @@ DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
>  >> else if (!(*((CARD8*)prop->data)) && dev->enabled)
>  >> DisableDevice(dev, TRUE);
>  >> }
>  >> +    } else if (property == XIGetKnownProperty(XI_PROP_TRANSFORM))
>  >> +    {
>  >> +        if (prop->format != 32 || prop->size != 9 ||
>  >> +            prop->type != XIGetKnownProperty(XATOM_FLOAT))
>  >> +            return BadValue;
>  >> +
>  >> +        if (!checkonly)
>  >> +            DeviceSetTransform(dev, prop->data);
>  >> }
> 
>  Peter> are we going to allow values > 1? If not, there should be BadValue checks
>  Peter> here.
> 
> 
> Sorry, values? I don't follow - As far as I can see I verify every
> member of XIPropertyValuePtr?

except prop->data, right? so if that contains values > 1, wouldn't that mess
things up? If so, we need something like

float *data = prop->data;
for (i = 0; i < prop->size; i++)
 $if (data[i] < 0 || data[i] > 1)
    return BadValue;

Cheers,
  Peter


More information about the xorg-devel mailing list