XRandR transform (keystone correction) not working as I would expect

AJ Heller aj at drfloob.com
Tue Oct 1 10:28:09 PDT 2013

I implemented a transformation matrix to pinch the top of my screen 100px
on each side. My hope is for the resulting image to be an isosceles
trapezoid (trapezium) with the smaller base on top, larger base on bottom
filling the width of the screen, and with no part of the image missing or
drawn off the screen.

After transforming, the top remains fixed at the width of the screen, and
the bottom of the trapezoidal image is drawn off the screen on either side.
I could be confused about what the transform should be doing, but otherwise
I think this is a bug.

Have I setup my transformation incorrectly? Should I file a bug report?


$ xrandr -v
xrandr program version       1.3.5
Server reports RandR version 1.3
$ lsb_release -idrc
Distributor ID: Debian
Description: Debian GNU/Linux 7.1 (wheezy)
Release: 7.1
Codename: wheezy

I'm working with 1440x900 resolution. I mapped the four corners to my
desired output coordinates:

(0,0) => (0,0)
(1440,0) => (1440,0)
(0,900) => (100,900)
(1440,900) => (1340,900)

My transformation matrix is:
1, 0.30769, 0
0, 1.38462, 0
0, 0.00043, 1

My xrandr command:
xrandr --output LVDS1 --mode 1440x900  --transform

Before transform:
  Man page: http://imgur.com/a/ZfWNd#0
  Xorg Mailing List: http://imgur.com/a/ZfWNd#3
After transform:
  Man page: http://imgur.com/a/ZfWNd#1
  Xorg Mailing List: http://imgur.com/a/ZfWNd#2

When I multiply the homogeneous coordinates myself, I get back the points I
intended. Xrandr seems to be scaling the image so the top's width matches
the screen width (instead of being 200px shy, as the transform matrix
indicates), letting the rest get drawn off screen.

Also, the xrandr man page has a keystone correction incantation at the very
bottom, and while it does give the trapezoidal shape I want (via --fb
1440x900), it lops off the right side of the screen. See here:
http://imgur.com/fC50und. Note the right side of the text is missing.

(sorry for the poor image quality).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg/attachments/20131001/cd147f1e/attachment.html>

More information about the xorg mailing list