How to retrieve graphic card driver display mode in dual/multi-monitor setup?
peter.hutterer at who-t.net
Mon Feb 15 16:57:28 PST 2010
On Mon, Feb 15, 2010 at 12:25:03AM +0100, Rémi Cardona wrote:
> Le 14/02/2010 22:36, Ping Cheng a écrit :
> > So, my questions are:
> > 1. What is the proper way to retrieve TwinView's display mode and
> > metamodes inside an (input) device driver?
> Short of parsing Xorg.0.log and/or xorg.conf to get to the nvidia stuff,
> I don't think that's doable with TwinView (since X is totally unaware of
> what the nvidia driver does, that's the whole idea behind TwinView...)
> > 2. What is the proper way to retrieve RandR display mode (extended,
> > clone, rotate...) and screen resolutions inside a device driver? Is
> > there any difference in retrieving those info between RandR 1.2 and
> > 1.3?
> IMHO, that shouldn't be done in the driver, but in an external tool.
> That tool would query the server with XRandR to see which physical
> displays are available and then set the tablet's properties through XI2
> properties or what not.
> Peter will probably tell you something much clever, but I can't think of
> a compelling reason to do that at the driver level, when it can be done
> higher up in the stack, with better potential integration with input and
> display management tools in current desktop environments.
I'd really really prefer to not have RandR code in _any_ input driver. Yes,
it solves the problem at hand, at the cost of much nastyness down the road
when it comes to exposing that interface to the clients.
The combinations you'll invariably end up with:
- starting screen rotation (which may not be the default)
- the tablet rotation (which may not be the default)
- linking both of them up or not
and every combination thereof.
so if you have a 90 degree-rotated screen and a half-rotated tablet, and
_then_ you rotate the screen, which direction do you map the tablet to?
If you rotate the tablet, do you rotate the screen as well?
All this can be trivially managed in a client, but it's hard to expose the
possible combinations through a sane driver interface.
Oh, and remember that you don't have access to user-specific settings...
Writing the client side is easy too, rotation in wacom now works by
triggering a property, so it's really as trivial as waiting for RandR notify
events and then triggering the property accordingly.
More information about the xorg-devel