adding a custom modeline with xrandr (dummy driver)

Antoine Martin antoine at nagafix.co.uk
Mon Oct 24 03:20:29 PDT 2011


Hi,

Whenever an xpra client connects to a server I want to resize the dummy
xserver to match the client's resolution exactly.
The server is started with:
Xorg +extension RANDR +extension RENDER -config xorg-dummy.conf
I calculate a modeline using:
http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
(say 1128x738 at 50) and add it:
xrandr --newmode "1128x738 at 50" 54.17 1128 1160 1360 1392 738 753 759 775
Then I add it to the "default" output:
xrandr --addmode "default" "1128x738 at 50"
Then I try to actually set it:
xrandr -s "1128x738 at 50"
And get this error message:
"Failed to change the screen configuration!"

Running the same commands against a real X11 server sort-of worked in
that it did set the resolution (I think - I got a black screen because
my LCD did not support it). Interestingly, it would not let me switch
back to the original resolution from a virtual terminal (same "Failed to
change..." error), I had to add a "sleep 5" to delay it and switch back
to the X11 vt to make it work. Could it be something similar with my
dummy instance? vt related? How do I fix it?
Or, what am I doing wrong?

I have tried doing this via the API rather than the xrandr commandline
and did not fare any better:
* XRRAllocModeInfo to allocate a new mode
* XRRCreateMode to create it with calculations similar to xtimings
* XRRAddOutputMode on the only output found using
XRRGetScreenResourcesCurrent
Strangely, the new mode is not listed by XRRSizes()
And calling XRRSetScreenSize actually crashed the whole X11 server!..

Thanks
Antoine


More information about the xorg-devel mailing list