Modesetting driver and cursor hot-spot

Michael Thayer michael.thayer at oracle.com
Sun Apr 3 16:35:36 UTC 2016


On 01.04.2016 22:22, Michael Thayer wrote:
> On 01.04.2016 22:12, Michael Thayer wrote:
>> I have just been adjusting the cursor handling code in the VirtualBox
>> kernel driver and realised that the modesetting user space driver is
>> still adjusting the reported cursor position to take the hot-spot into
>> account, even though it also reports the hot-spot using
>> drmModeSetCursor2().  In theory this would be easy to fix, but that
>> would create a new problem: kernel space would have no easy way to tell
>> whether it was dealing with the old or with the new driver.  Other
>> drivers do not have this bug though, and I seem to be the first person
>> to want to use both position and hot-spot information in modesetting.
>> Does anyone have a good idea about how to deal with this?  My best so
>> far is for my driver to intercept DRM_IOCTL_MODE_CURSOR2 and just
>> -EINVAL it to force fall-back.
>
> Ah, it gets more fun - the kernel code clearly also makes the same
> assumption: if a driver does not provide cursor_set2(), it falls back to
> calling cursor_set() with the same parameters, minus the hot-spot
> location.  Reported cursor position does not take this into account.  So
> this is clearly already a part of the kernel API, though probably as yet
> with no one actually depending on it.

Excuse the noise.  Looking at more code, this seems to be the intended 
use.  I see other code looking at deltas in the hot-spot value rather 
than the absolute value of it, and simply adjusting the position inside 
cursor_set2() ahead of the upcoming call to cursor_move().  So all a 
false alarm on my part.

Regards,

Michael


-- 
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

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


More information about the xorg-devel mailing list