Switching between a software and a hardware mouse cursor

Michael Thayer michael.thayer at oracle.com
Thu Feb 27 06:46:10 PST 2014


Hello,

For background I am the member of the VirtualBox team responsible for 
(among other things) the guest graphics drivers for X.Org.  On Linux we 
are in the process of moving from a DDX driver to a KMS driver which 
will work with the "modesetting" DDX, and one of the problems I have run 
into is how to support a feature that we offer, namely switching the 
guest to a software mouse cursor and back.  The main usage case for this 
is switching to reporting relative events, e.g. for mouse controlled 
games, when using the host cursor - who's position the guest does not 
control - as a hardware cursor is not appropriate.

In our DDX we do a check every time a new cursor is loaded as to whether 
we are currently in software or hardware cursor mode, and succeed or 
fail as appropriate.  We have an X11 client tool which briefly grabs the 
pointer and flashes it to an hourglass when it detects that a switch has 
been requested.  This works because we are still using the pre-RandR 1.2 
DDX cursor APIs.  I suspect though that a patch to make "modesetting" 
use those APIs would not be entirely welcome, so I was hoping for other 
suggestions about how I could handle this.

One idea would be to add an output property to "modesetting" so that our 
client could tell it that we want to make the switch.  Another would be 
to add a return value to the DDX CRTC functions "load_cursor_argb", so 
that if the KMS driver failed to set the cursor, "modesetting" could 
pass this on to the X server.  Neither of these feel quite satisfactory 
of course; any better suggestions are welcome.

Thanks in advance.

Regards,

Michael
-- 
ORACLE Deutschland B.V. & Co. KG   Michael Thayer
Werkstrasse 24                     VirtualBox engineering
71384 Weinstadt, Germany           mailto:michael.thayer at oracle.com

Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603
Geschäftsführer: Jürgen Kunz

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher


More information about the xorg-devel mailing list