dix: initialize all screens before proceeding to gc's, root windows etc

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 <oleh.nyk@gmail.com>
This commit is contained in:
Oleh Nykyforchyn
2025-11-23 14:42:29 +02:00
committed by Enrico Weigelt
parent 3f821b291e
commit f4115e69eb

View File

@@ -209,11 +209,18 @@ dix_main(int argc, char *argv[], char *envp[])
FatalError("failed to create screen resources");
});
/* Let all screens register the necessary privates */
DIX_FOR_EACH_SCREEN({
if (!PixmapScreenInit(walkScreen))
FatalError("failed to create screen pixmap properties");
if (!dixScreenRaiseCreateResources(walkScreen))
FatalError("failed to create screen resources");
});
/* Then use these privates to initialize root windows etc */
DIX_FOR_EACH_SCREEN({
if (!CreateGCperDepth(walkScreen))
FatalError("failed to create scratch GCs");
if (!CreateDefaultStipple(walkScreen))