[PATCH xserver] cursor: add hw cursor support for prime

Hans de Goede hdegoede at redhat.com
Tue Sep 6 10:44:22 UTC 2016


Hi,

On 06-09-16 05:12, Keith Packard wrote:
> Hans de Goede <hdegoede at redhat.com> writes:
>
>> +    if (!dixPrivatesCreated(PRIVATE_CURSOR))
>> +        dixRegisterScreenPrivateKey(&cursorScreenDevPriv, pScreen,
>> +                                    PRIVATE_CURSOR, 0);
>> +
>
> I don't understand what you're trying to do here; you're only
> registering the screen private key if no cursors have been created yet?

Yes, because PRIVATE_CURSOR is not part of dix/privates.c
allocated_early[] / because there is no relocation code for it.

Calling dixRegisterScreenPrivateKey(PRIVATE_CURSOR) after
cursors have been created triggers an assert in dix/privates.c
checking for this.

As mentioned in the changelog, this means that we will not get
the PRIVATE_CURSOR ScreenPrivateKey for hot-plugged GPUs,
causing fallback to software cursors. This is not really
a problem since the primary use-case of hotplugged GPUs
is USB devices which don't do hw cursor anyways.

Note that this is not an issue for the typical laptop
with 2 GPUs setup since both GPUs are initialized there
before any cursors are created.

As Michel Dänzer pointed out hotplugging a real GPU
is possible, but that is rare and fixing the privates.c
code to allow PRIVATE_CURSOR re-allocation really falls
outside of the scope of this patch (and can be fixed
later independently).

I've made sure that the lack of a PRIVATE_CURSOR
ScreenPrivateKey on hot-plugged GPUs does not crash the
server. I'm pretty sure I got this right as my initial
tests did crash the server :)

Regards,

Hans


More information about the xorg-devel mailing list