Fallback to SW cursor on GPU hotplug
I guess the title is pretty much self-explanatory.
While connecting EVDI-backed device (https://github.com/DisplayLink/evdi) with a running Xorg session leads to usage of the software cursor. This can hinder performance.
I am aware of pieces of code like this (dix/dispatch.c):
update_desktop_dimensions(); /* * We cannot register the Screen PRIVATE_CURSOR key if cursors are already * created, because dix/privates.c does not have relocation code for * PRIVATE_CURSOR. Once this is fixed the if() can be removed and we can * register the Screen PRIVATE_CURSOR key unconditionally. */ if (!dixPrivatesCreated(PRIVATE_CURSOR)) dixRegisterScreenPrivateKey(&cursorScreenDevPriv, pScreen, PRIVATE_CURSOR, 0); return i; }
as well as several other similar places in Xorg's code.
Simply removing that if causes an assertion in
I haven't done much analysis on it yet, nor am I familiar with X's codebase, but my initial reasoning is that reallocation of global_keys address is prevented because its address is already stored and referred to someplace(s) else. Be that true, how much work would it be to actually tackle the issue? My initial idea (based on the assumption it's the address-related thing) would be to simply replace direct references to global_keys/it's address with a static getter function that would return its current address/contents. For consistency, I guess it should apply to all the similar cases in the end.
Can you point me to the right direction and point out any potential problems in my approach, please?