Bug 510021

Summary: clones different sized-monitors
Product: [Fedora] Fedora Reporter: Matthias Clasen <mclasen>
Component: plymouthAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: craftjml, fedora, kingsamses+rhbz, krh, rstrode
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-10-02 02:09:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 509829    

Description Matthias Clasen 2009-07-07 13:12:00 UTC
When I boot with an external monitor plugged in, plymouth clones the displays even though the external monitor (1024x768) has a smaller resolution than the internal panel, causing a big black strip on the right edge of the panel.

Further observations: 
- the bios and grub only use the external monitor

- when X starts up for the login screen, it keeps the cloning, but makes both displays use the lower resolution (at least that is what it looks like) which makes the internal panel look bad

Comment 1 Jud Craft 2009-07-14 00:54:44 UTC
Obviously, I don't think Plymouth can A) create two custom-sized framebuffers that perfectly fit each monitor.  (Unless Plymouth and kernel modesetting can do that, in which case, problem solved)

Instead, what if there was another solution that made the bootsplash fit nicely on each monitor?  [note:  not an Xorg programmer, so a layperson summary follows].



The Xrandr 1.3 specification, if I recall, has the capability to do linear transformations.  (Translate and scale, I think).  So, here's my idea:

1.  Out of all displays at startup, pick the largest possible one (ex., the big honking 1680x1050 monitor).
2.  Have Plymouth/Xorg/whatever set the display size to match at least that monitor, and display the Plymouth bootsplash at this size.
3.  Linearly scale the main Xrandr buffer to the other displays using the clone mode + scaling transformation.

Example...

You have a laptop (1280x800 panel) attached to a 1440x900 monitor.  At startup, Xorg initializes with the monitor as the primary display A, at 1440x900+0+0 and the laptop at 1280x800+0+0.

The transform matrix of the remaining display B, where B=LCD panel is then set to (whatever scaling matrix [display B/display A] for axes X and Y).



So, we get a full-size bootsplash that fully scales to both screens, although it is a bit pixelated on one of them.  (But hey, that's way better than weird black borders, and even Windows XP/Vista bootup just does an LCD panel scale of its splash sequence across all monitors -- and it doesn't even adjust for aspect).

Bonuses to this approach:

1.  It works for 2+ displays.  For displays B, C, and D, just set them up as Display B above, with a transformation matrix generated relative to the primary screen A.  We get a bootsplash that fits each monitor from just the one buffer.

2.  We can even adapt this to get the aspect right when widescreen and non-widescreen monitors are mixed:  just add a translate to any non-widescreen monitor's transformation and scale a subsection of the screen, so that the overall aspect is preserved.


In short, by using a clone mode+Xrandr transformations, we can support multiple monitors with an aspect-corrected, full screen (if scaled) Plymouth bootsplash on each one.  It requires using relatively new features of the Xrandr spec, but since Plymouth and Kernel-modesetting are relatively new too, I think that's okay.

Later, at GDM/KDM startup time, the Xrandr setup can remain as is (which means there will be an ugly scaled, but proportionally correct screen on the smaller displays), or you can set all other displays to Spanning mode.

Comment 2 Jud Craft 2009-07-14 02:05:37 UTC
There is one additional downside:  it requires the driver to support the 1.3 spec.  (I tried testing on my Intel 965GM, and for the life of me, I can't get the sucker to transform or scale).



Here is another idea that does not require the 1.3 spec:

Currently Plymouth seems to initialize all displays at their native size, set them all at position 0,0, and then show a plymouth bootsplash that matches the smallest size.

Instead, why not initialize all displays, display a plymouth bootsplash that matches the *biggest* display, and then pan all other displays so that they are centered around it?

For our earlier example of a 1680x1050 monitor and 1280x800 laptop panel:

1.  Initialize X framebuffer at 1680x1050
2.  Set monitor as 1680x1050+0+0
3.  Set LCD panel as 1280x800+  (center of framebuffer - (1280/2)) + (center of framebuffer - (800/2)) -- in this case, 1280x800+200+125.

This method a) doesn't require the 1.3 spec, and b) gives a centered, aspect-correct bootsplash on all displays (though it is zoomed in on smaller monitors).

Comment 3 Matthias Clasen 2009-10-02 02:09:09 UTC
this is fixed with the latest plymouth in rawhide.