-
Notifications
You must be signed in to change notification settings - Fork 197
dix: initialize all screens before proceeding to gc's, root windows etc #1479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Current code walks along all screens and initializes screen resources, then gc's, stipples, root windows for each of them, hence after the first screen registering new private keys is no more possible. This crashes modesetting driver if it is not initialized before others. This patch makes screen resources for all screen initialize first, hence all necessary private keys (including of the type PRIVATE_WINDOW) are initialized before root windows are created. Signed-off-by: Oleh Nykyforchyn <[email protected]>
|
Other drivers like xf86-video-intel also register private keys, so this should affect more than modesetting. Can you post the xorg.conf you used when you hit this? |
Yes because it's OK with xlibre-xserver-25.0.0.15, which has no GDB debugging shows this. |
|
Another thing that looks strange to me that xlibre-xserver-master initializes |
|
Looks like there is an actual problem here. This was a problem in the modesetting driver before, with the vrr private key. @metux Looking at the vrr privates, they are stored in the modesetting driver struct instead of being globals. |
|
Trying to debug this, when using current master, I get the error above when I don't enable vrr, but when I do enable vrr, the problem disappears. |
|
ACK from me, patch looks good and fixes the issues I could reproduce on my side. @metux What is the difference between gpu screens and regular screens here? How come this code works fine on Xorg? |
No, that's asking for trouble. We already had this discussion on some PR (don't recall exactly which one). If one needs separate instances per screen, that's what dixRegisterScreenPrivateKey() et al are for. EDIT: the scenario is: a driver needs to attach some private data to eg. a pixmap, but here one per screen (IOW: on n screens, this pixmap will have n different privates, one for each screen). |
For multi-screen and offloading (eg. via prime). |
|
@metux ping |
Adding
asyncFlipPrivateKeyRectomodesettinghas revealed one more problem. Current code walks along all screens and initializes screen resources, then gc's, stipples, root windows for each of them, hence after the first screen registering new private keys is no more possible. This crashes modesetting driver if it is not initialized before others.Namely, after screen 0 is initialized, and root window for it is created,
global_keys[PRIVATE_WINDOW].createdbecomes non-zero, hence no new private keys of this type can be registered, andmodeset(1)fails atdixRegisterPrivatekey().This patch makes screen resources for all screen initialize first, hence all necessary private keys (including of the type
PRIVATE_WINDOW) are initialized before root windows are created. Tests show that it prevents occasional crashes on NVidia390 and constant crashes on NVidia 470, and makes no difference for NVidia 340 because it is not modesetting capable.