RandR (etc) DriverFunc

Thomas Winischhofer thomas at winischhofer.net
Wed Mar 16 03:23:33 PST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Egbert Eich wrote:
| Thomas Winischhofer writes:
|  > xf86str.h states that the driver should return FALSE if a driver
|  > function is not supported.
|  >
|  > This does not comply with the current use of DriverFunc, namely in
|  > xf86RandR.c. If the driver returns FALSE there, the function
calling the
|  > driver function will fail.
|  >
|  > So, either we should change the default behavior to return TRUE in the
|  > driver func if the function opcode is not understood by the driver, or
|  > change the existing code not to bail out on FALSE.
|  >
|
| You definitely have a point there.
| In the case of xf86RandRGetInfo() we definitely should return TRUE.
| In the case of xf86RandRSetConfig() I'm not clear about the semantics
| of the driver func.
| Should this function do rotation and mode switching (we are passing
| size information)?


As far as I understand the code, it's only for rotation. Modeswitching
is done separately.

| I would think currently:
|
|  if (randrp->rotation != rotation) {
|
|     /* Have the driver do its thing. */
|         if (scrp->DriverFunc) {
|             xorgRRRotation RRRotation;
|             RRRotation.RRConfig.rotation = rotation;
|             RRRotation.RRConfig.rate = rate;
|             RRRotation.RRConfig.width = pSize->width;
|             RRRotation.RRConfig.height = pSize->height;
|
|             /*
|              * Currently we need to rely on HW support for rotation.
|              */
|             if (!(*scrp->DriverFunc)(scrp, RR_SET_CONFIG, &RRRotation))
|                 return FALSE;
|         }
|         randrp->rotation = rotation;
|     }
|
| would do as we don't support SW rotation any change in rotation would
| have to be handled by the driver.


I think so, too.


| In any other case we'd need to have a SW fallback - however then we
| may consider calling the DriverFunc() from inside xf86RandRSetMode ().

Well, currently the driver in RR_GET_CONFIG defines what rotations it
supports. If the driver doesn't support rotation, the SetConfig function
bails out with BadMatch anyway on any attempt to alter the rotation.
Until there is a way to do software rotation, I think this is reasonable.

Thomas

- --
Thomas Winischhofer
Vienna/Austria
thomas AT winischhofer DOT net	       *** http://www.winischhofer.net
twini AT xfree86 DOT org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCOBc1zydIRAktyUcRAmZYAKCF3ZXZ+sr5DA3DXr/Wo9kH3uyEywCg1KCN
QUJenCdxJ0R5Wre0pK9JHS4=
=ECNs
-----END PGP SIGNATURE-----



More information about the xorg mailing list