xvfb: Add multiple crtc support
Multiple CRTCs can be added on a per-screen basis with the new -crtcs option. Each CRTC has one associated output. Outputs beyond the first are disconnected by default and can be connected by setting a mode. Outputs can be disconnected by setting the associated CRTC's mode and output to None.
Signed-off-by: Andy Myers andy.myers@zetier.com
These changes allow Xvfb
clients to work with multiple virtual displays. For example, running the following with these changes:
export DISPLAY=:5 &&
Xvfb :5 -screen 0 1600x1200x24 -crtcs 3 &
gnome-shell &
sleep 5 && xwd -root > fb.xwd && convert fb.xwd single.png
Yields a single.png
of:
Modifying the CRTCs/outputs with xrandr like so:
xrandr &&
xrandr --newmode "800x600" 38.25 800 832 912 1024 600 603 607 624 -hsync +vsync &&
xrandr --addmode screen_1 "800x600" &&
xrandr --addmode screen_2 "800x600" &&
xrandr --output screen_1 --mode "800x600" --primary &&
xrandr --output screen_2 --mode "800x600" --pos 800x0 &&
xrandr --output screen --off &&
xrandr &&
xwd -root > fb.xwd && convert fb.xwd double.png
Yields a double.png
of: