xserver: Branch 'master' - 12 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 11 12:09:00 UTC 2019


 glamor/glamor.c                                  |    6 
 glamor/glamor.h                                  |   12 -
 glamor/glamor_egl.c                              |  194 ++++++++++-------------
 hw/vfb/InitOutput.c                              |  122 ++++++++++++++
 hw/vfb/Makefile.am                               |   13 +
 hw/vfb/meson.build                               |   17 +-
 hw/xfree86/drivers/modesetting/driver.c          |    2 
 hw/xfree86/drivers/modesetting/drmmode_display.c |    8 
 meson.build                                      |    4 
 9 files changed, 257 insertions(+), 121 deletions(-)

New commits:
commit b2a0d6065d86b8bf409ffae41180662560c42ce7
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Fri Jul 12 14:45:16 2019 +0100

    vfb: add DRI3/glamor support
    
    This commit adds DRI3/glamor support, effectively translating into
    hardware GPU support.
    
    Theoretically it should be possible to use DRM/GPU drivers such as
    virtio or vgem, although only the intel i915 driver is currently tested.
    
    Since Xvfb does no modeset, it opens the render node. Currently that is
    fixed to "/dev/dri/renderD128" and will be tweaked with future commits.
    
    Specific use-cases are left for the reader - testing glamor, GL driver
    or others.
    
    v2: Drop GLAMOR_NO_XV, use GLAMOR_FOR_XORG instead (Michel Dänzer)
    v3: Fix build w/o glamor
    v4:
     - Split out glamor dependency patch for meson (Pekka)
     - Enhance commit message (Pekka)
     - Use O_CLOEXEC with open() (Pekka)
     - Enhance error path, memory leak comments (Pekka)
    
    Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index f6079fefe..56795db19 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -68,6 +68,14 @@ from The Open Group.
 #include "glx_extinit.h"
 #include "randrstr.h"
 
+#ifdef GLAMOR_HAS_GBM
+#include <glamor.h>
+#include <gbm.h>
+
+#include <unistd.h>
+#include <fcntl.h>
+#endif
+
 #define VFB_DEFAULT_WIDTH      1280
 #define VFB_DEFAULT_HEIGHT     1024
 #define VFB_DEFAULT_DEPTH        24
@@ -101,6 +109,12 @@ typedef struct {
 #ifdef HAS_SHM
     int shmid;
 #endif
+#ifdef GLAMOR_HAS_GBM
+    int fd;
+    CreateScreenResourcesProcPtr createScreenResources;
+    struct gbm_device *gbm;
+    struct gbm_bo *front_bo;
+#endif
 } vfbScreenInfo, *vfbScreenInfoPtr;
 
 static int vfbNumScreens;
@@ -726,10 +740,110 @@ vfbCloseScreen(ScreenPtr pScreen)
     if (pScreen->devPrivate)
         (*pScreen->DestroyPixmap) (pScreen->devPrivate);
     pScreen->devPrivate = NULL;
+#ifdef GLAMOR_HAS_GBM
+    if (pvfb->fd >= 0) {
+        if (pvfb->front_bo) {
+            gbm_bo_destroy(pvfb->front_bo);
+            pvfb->front_bo = NULL;
+        }
+        close(pvfb->fd);
+        pvfb->fd = -1;
+    }
+#endif
+    /*
+     * XXX: There is an existing vfbScreens leak. Should we free() it directly
+     * or otherwise - input welcome.
+     */
 
     return pScreen->CloseScreen(pScreen);
 }
 
+#ifdef GLAMOR_HAS_GBM
+static Bool
+vfbCreateScreenResources(ScreenPtr pScreen)
+{
+    vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
+    PixmapPtr pixmap;
+    Bool ret;
+
+    pScreen->CreateScreenResources = pvfb->createScreenResources;
+    ret = pScreen->CreateScreenResources(pScreen);
+    pScreen->CreateScreenResources = vfbCreateScreenResources;
+
+    if (!ret)
+        return FALSE;
+
+    pixmap = pScreen->GetScreenPixmap(pScreen);
+    /* TODO: add support for modifiers at some point */
+    if (!glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, pvfb->front_bo,
+        FALSE)) {
+        LogMessage(X_ERROR, "glamor_egl_create_textured_pixmap() failed\n");
+        /* TODO: plug the leak, aka undo the CreateScreenResources() call above. */
+        return FALSE;
+    }
+
+    return TRUE;
+}
+
+static void
+vfbDRIInit(ScreenPtr pScreen)
+{
+    vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
+    /* TODO: don't hardcode the node name */
+    const char *node_name = "/dev/dri/renderD128";
+    const char *error_msg;
+
+    pvfb->fd = open(node_name, O_RDWR | O_CLOEXEC);
+    if (pvfb->fd < 0) {
+        error_msg = "Failed to open device node";
+        goto out;
+    }
+
+    if (!glamor_egl_init(pScreen, pvfb->fd)) {
+        error_msg = "Failed to initialize glamor";
+        goto close_fd;
+    }
+
+    pvfb->gbm = glamor_egl_get_gbm_device(pScreen);
+    if (!pvfb->gbm) {
+        error_msg = "Failed to get gbm device";
+        goto egl_fini;
+    }
+    pvfb->front_bo = gbm_bo_create(pvfb->gbm,
+                                   pScreen->width, pScreen->height,
+                                   GBM_FORMAT_ARGB8888,
+                                   GBM_BO_USE_RENDERING);
+    if (!pvfb->front_bo) {
+        error_msg = "Failed to create front buffer";
+        goto egl_fini;
+    }
+
+    if (!glamor_init(pScreen, GLAMOR_USE_EGL_SCREEN)) {
+        error_msg = "Failed to initialize glamor at ScreenInit() time";
+        goto destroy_bo;
+    }
+
+    pvfb->createScreenResources = pScreen->CreateScreenResources;
+    pScreen->CreateScreenResources = vfbCreateScreenResources;
+    return;
+
+destroy_bo:
+    gbm_bo_destroy(pvfb->front_bo);
+egl_fini:
+    /* TODO: There's no glamor_egl_fini just yet */
+close_fd:
+    close(pvfb->fd);
+out:
+    LogMessage(X_ERROR, "%s. Disabling GLAMOR/DRI3.\n", error_msg);
+    return;
+}
+#else
+static void
+vfbDRIInit(ScreenPtr pScreen)
+{
+}
+#endif
+
 static Bool
 vfbRROutputValidateMode(ScreenPtr           pScreen,
                         RROutputPtr         output,
@@ -925,8 +1039,10 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv)
     if (!ret)
         return FALSE;
 
-    if (Render)
+    if (Render) {
         fbPictureInit(pScreen, 0, 0);
+        vfbDRIInit(pScreen);
+    }
 
     if (!vfbRandRInit(pScreen))
        return FALSE;
diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am
index 70333976c..d3d076d00 100644
--- a/hw/vfb/Makefile.am
+++ b/hw/vfb/Makefile.am
@@ -4,6 +4,10 @@ bin_PROGRAMS = Xvfb
 
 AM_CFLAGS = -DHAVE_DIX_CONFIG_H \
             $(XVFBMODULES_CFLAGS) \
+            -I$(top_srcdir)/glamor/ \
+            -I$(top_srcdir)/dri3/ \
+            $(LIBDRM_CFLAGS) \
+            $(GBM_CFLAGS) \
 	    $(DIX_CFLAGS)
 
 SRCS =	InitInput.c \
@@ -13,6 +17,7 @@ SRCS =	InitInput.c \
 Xvfb_SOURCES = $(SRCS)
 
 XVFB_LIBS = \
+	$(glamor_lib) \
         @XVFB_LIBS@ \
 	$(MAIN_LIB) \
 	$(XSERVER_LIBS) \
@@ -22,5 +27,13 @@ Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS)
 Xvfb_DEPENDENCIES = $(XVFB_LIBS)
 Xvfb_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 
+if GLAMOR_EGL
+Xvfb_SOURCES += $(top_srcdir)/glamor/glamor_egl.c
+glamor_lib = $(top_builddir)/glamor/libglamor.la
+
+Xvfb_LDADD += $(GLAMOR_LIBS) $(GBM_LIBS) $(LIBDRM_LIBS) -lEGL -lGL
+Xvfb_DEPENDENCIES = $(glamor_lib) $(XVFB_LIBS)
+endif
+
 relink:
 	$(AM_V_at)rm -f Xvfb$(EXEEXT) && $(MAKE) Xvfb$(EXEEXT)
diff --git a/hw/vfb/meson.build b/hw/vfb/meson.build
index 537e96a72..3cfd4fe59 100644
--- a/hw/vfb/meson.build
+++ b/hw/vfb/meson.build
@@ -4,12 +4,27 @@ srcs = [
     '../../mi/miinitext.c',
 ]
 
+vfb_dep = []
+vfb_glamor = []
+if build_glamor
+    srcs += '../../glamor/glamor_egl.c'
+    vfb_dep += [
+        libdrm_dep,
+        gbm_dep,
+    ]
+    vfb_glamor += glamor
+endif
+
 xvfb_server = executable(
     'Xvfb',
     srcs,
     include_directories: inc,
-    dependencies: common_dep,
+    dependencies: [
+        common_dep,
+        vfb_dep,
+    ],
     link_with: [
+        vfb_glamor,
         libxserver_main,
         libxserver_fb,
         libxserver,
commit 9e574a5bd828e813ff31bdd5cbec52539534a958
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Mon Sep 23 16:23:02 2019 +0100

    meson: glamor depends on gbm and epoxy mark as such
    
    Currently glamor depends on epoxy and gbm, even the autotools build
    enforces that.
    
    Follow suite and do the same for the meson build.
    
    v1: Split out from larger patch (Pekka)
    
    Signed-off-by: Emil Velikov <emil.velikov at collbora.com>

diff --git a/meson.build b/meson.build
index 2eca5c295..2ae97c488 100644
--- a/meson.build
+++ b/meson.build
@@ -324,8 +324,8 @@ endif
 gbm_dep = dependency('', required: false)
 epoxy_dep = dependency('', required: false)
 if build_glamor
-    gbm_dep = dependency('gbm', version: gbm_req, required: false)
-    epoxy_dep = dependency('epoxy', required: false)
+    gbm_dep = dependency('gbm', version: gbm_req, required: true)
+    epoxy_dep = dependency('epoxy', required: true)
 endif
 
 eglstream_option = get_option('xwayland_eglstream')
commit 86c8458f3d09d2c4fb68de7e6ab515739e8f8b3c
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Fri Jul 12 11:34:44 2019 +0100

    vfb: clarify code flow in vfbScreenInit
    
    v2: Enhance commit message (Pekka)
    
    Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index 48efb61b2..f6079fefe 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -922,12 +922,12 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv)
 
     ret = fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
                        dpix, dpiy, pvfb->paddedWidth, pvfb->bitsPerPixel);
-    if (ret && Render)
-        fbPictureInit(pScreen, 0, 0);
-
     if (!ret)
         return FALSE;
 
+    if (Render)
+        fbPictureInit(pScreen, 0, 0);
+
     if (!vfbRandRInit(pScreen))
        return FALSE;
 
commit 744c419cb4eaed4006b5f0f319b72d7ffa9fbc6d
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Fri Jul 19 10:53:19 2019 +0100

    glamor: check for non NULL pixmap at close_screen
    
    DDX such as Xorg, Xwayland & Xephyr do not destroy the pixmap before
    they call into CloseScreen. At the same time Xvfb (support for glamor
    coming with later commit) do.
    
    As such the pixmap will be NULL and we'll crash out.
    
    Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

diff --git a/glamor/glamor.c b/glamor/glamor.c
index 4b935de59..6b8cfe9b7 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -927,7 +927,11 @@ glamor_close_screen(ScreenPtr screen)
     ps->Glyphs = glamor_priv->saved_procs.glyphs;
 
     screen_pixmap = screen->GetScreenPixmap(screen);
-    glamor_pixmap_destroy_fbo(screen_pixmap);
+    /* For DDX like Xwayland and Xorg, the pixmap is not destroyed so
+     * we should do so here.
+     */
+    if (screen_pixmap)
+        glamor_pixmap_destroy_fbo(screen_pixmap);
 
     glamor_release_screen_priv(screen);
 
commit 7667180fb9dbd606e40c000aefc807371d2fb478
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Fri Jul 19 10:53:19 2019 +0100

    glamor_egl: check for non NULL pixmap at egl_close_screen
    
    DDX such as Xorg, Xwayland & Xephyr do not destroy the pixmap before
    they call into CloseScreen. At the same time Xvfb (support for glamor
    coming with later commit) do.
    
    As such the pixmap will be NULL and we'll crash out.
    
    Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 1ad16f733..8a9112f76 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -770,8 +770,13 @@ glamor_egl_close_screen(ScreenPtr screen)
     screen_pixmap = screen->GetScreenPixmap(screen);
     pixmap_priv = glamor_get_pixmap_private(screen_pixmap);
 
-    eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image);
-    pixmap_priv->image = NULL;
+    /* For DDX like Xwayland and Xorg, the pixmap is not destroyed so
+     * we should do so here.
+     */
+    if (pixmap_priv) {
+        eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image);
+        pixmap_priv->image = NULL;
+    }
 
     screen->CloseScreen = glamor_egl->saved_close_screen;
     glamor_egl_cleanup(screen);
commit 15354fb68f09eecceec5747a58cd16e6ce9236ca
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Fri Jul 19 15:57:52 2019 +0100

    glamor_egl: override the CloseScreen/DestroyPixmap earlier
    
    Currently we wrap the EGL CloseScreen/DestroyPixmap callbacks after the
    glamor ones. Thus upon teardown, we'll end calling things in the wrong
    order.
    
    Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 1661c3549..1ad16f733 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -850,12 +850,6 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
     glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
 #endif
 
-    glamor_egl->saved_close_screen = screen->CloseScreen;
-    screen->CloseScreen = glamor_egl_close_screen;
-
-    glamor_egl->saved_destroy_pixmap = screen->DestroyPixmap;
-    screen->DestroyPixmap = glamor_egl_destroy_pixmap;
-
     glamor_ctx->ctx = glamor_egl->context;
     glamor_ctx->display = glamor_egl->display;
 
@@ -910,6 +904,12 @@ glamor_egl_init(ScreenPtr screen, int fd)
 
     dixSetPrivate(&screen->devPrivates, &glamor_egl_screen_private_key, glamor_egl);
 
+    glamor_egl->saved_close_screen = screen->CloseScreen;
+    screen->CloseScreen = glamor_egl_close_screen;
+
+    glamor_egl->saved_destroy_pixmap = screen->DestroyPixmap;
+    screen->DestroyPixmap = glamor_egl_destroy_pixmap;
+
     glamor_egl->fd = fd;
     glamor_egl->gbm = gbm_create_device(glamor_egl->fd);
     if (glamor_egl->gbm == NULL) {
commit 89597eeba6e7a3418caa375f19f8dd303219881c
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Thu Jul 18 14:04:33 2019 +0100

    glamor_egl: remove unneeded xf86 includes/GLAMOR_FOR_XORG
    
    As of last commit, all of glamor_egl ix xf86 agnostic, so adjust the
    includes and drop the GLAMOR_FOR_XORG instances.
    
    Note the macro is still used for glamor_xv_init() which pulls xf86.
    
    v2: Drop GLAMOR_FOR_XORG guards (Michel Dänzer)
    
    Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

diff --git a/glamor/glamor.h b/glamor/glamor.h
index d35364950..b83f1a0e8 100644
--- a/glamor/glamor.h
+++ b/glamor/glamor.h
@@ -334,8 +334,6 @@ extern _X_EXPORT Bool glamor_get_drawable_modifiers(DrawablePtr draw,
 extern _X_EXPORT void glamor_set_drawable_modifiers_func(ScreenPtr screen,
                                                          GetDrawableModifiersFuncPtr func);
 
-#ifdef GLAMOR_FOR_XORG
-
 #define GLAMOR_EGL_MODULE_NAME  "glamoregl"
 
 /* @glamor_egl_init: Initialize EGL environment.
@@ -398,8 +396,6 @@ extern _X_EXPORT Bool
                                                struct gbm_bo *bo,
                                                Bool used_modifiers);
 
-#endif
-
 extern _X_EXPORT void glamor_egl_screen_init(ScreenPtr screen,
                                              struct glamor_context *glamor_ctx);
 
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 8821813f1..1661c3549 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -29,13 +29,10 @@
 
 #include "dix-config.h"
 
-#define GLAMOR_FOR_XORG
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <errno.h>
-#include <xf86.h>
-#include <xf86Priv.h>
 #include <xf86drm.h>
 #define EGL_DISPLAY_NO_X_MESA
 
commit f3ab3d0c6123c8e7ddd3be6142f721590d153848
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Thu Jul 18 13:57:02 2019 +0100

    glamor_egl: disable modifiers via glamor_init()
    
    Currently we parse through xf86Info.debug to check if we the modifiers
    should be disabled. Handle that within DDX and pass GLAMOR_NO_MODIFIERS
    into the glamor_init() flags.
    
    This allows individual DDX control over the setting - say when modifiers
    are woking OK with one implementation and not the other.
    
    Most importantly, this removes the final xf86 piece from the codebase.
    
    Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

diff --git a/glamor/glamor.h b/glamor/glamor.h
index 77df1ff96..d35364950 100644
--- a/glamor/glamor.h
+++ b/glamor/glamor.h
@@ -68,8 +68,10 @@ typedef Bool (*GetDrawableModifiersFuncPtr) (DrawablePtr draw,
 #define GLAMOR_EGL_EXTERNAL_BUFFER 3
 #define GLAMOR_USE_EGL_SCREEN		(1 << 0)
 #define GLAMOR_NO_DRI3			(1 << 1)
+#define GLAMOR_NO_MODIFIERS		(1 << 2)
 #define GLAMOR_VALID_FLAGS      (GLAMOR_USE_EGL_SCREEN                \
-                                 | GLAMOR_NO_DRI3)
+                                 | GLAMOR_NO_DRI3                     \
+				 | GLAMOR_NO_MODIFIERS)
 
 /* until we need geometry shaders GL3.1 should suffice. */
 #define GLAMOR_GL_CORE_VER_MAJOR 3
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 8ddfb62bb..8821813f1 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -870,6 +870,9 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
      */
     glamor_enable_dri3(screen);
 
+    if (glamor_priv->flags & GLAMOR_NO_MODIFIERS)
+        glamor_egl->dmabuf_capable = FALSE;
+
     /* If the driver wants to do its own auth dance (e.g. Xwayland
      * on pre-3.15 kernels that don't have render nodes and thus
      * has the wayland compositor as a master), then it needs us
@@ -1034,10 +1037,6 @@ glamor_egl_init(ScreenPtr screen, int fd)
                                 "EGL_EXT_image_dma_buf_import") &&
         epoxy_has_egl_extension(glamor_egl->display,
                                 "EGL_EXT_image_dma_buf_import_modifiers")) {
-       if (xf86Info.debug != NULL)
-           glamor_egl->dmabuf_capable = !!strstr(xf86Info.debug,
-                                                "dmabuf_capable");
-       else
            glamor_egl->dmabuf_capable = TRUE;
     }
 #endif
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index f621df52f..27a520743 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -36,6 +36,7 @@
 #include "dumb_bo.h"
 #include "inputstr.h"
 #include "xf86str.h"
+#include "xf86Priv.h"
 #include "X11/Xatom.h"
 #include "micmap.h"
 #include "xf86cmap.h"
@@ -3412,7 +3413,12 @@ drmmode_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
     ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
 
     if (drmmode->glamor) {
-        if (!glamor_init(pScreen, GLAMOR_USE_EGL_SCREEN)) {
+        unsigned int flags = GLAMOR_USE_EGL_SCREEN;
+
+        if (xf86Info.debug != NULL && !strstr(xf86Info.debug, "dmabuf_capable"))
+            flags |= GLAMOR_NO_MODIFIERS;
+
+        if (!glamor_init(pScreen, flags)) {
             return FALSE;
         }
 #ifdef GBM_BO_WITH_MODIFIERS
commit 4018811838c344ee92d10e60789853e4ba512612
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Wed Jul 17 16:07:43 2019 +0100

    glamor_egl: don't use ScrnInfoRec::privates
    
    Move from the xf86 specific ScrnInfoRec::privates, to the dix private
    handling. Since there's no FreeScreen function in ScreenPtr, fold the
    former within the existing CloseScreen.
    
    Users, such as modesetting are updated, and out of tree drivers will
    need equivalent, yet trivial, patch.
    
    Note: we need to ensure that the screen private is unset and the screen
    callbacks are restored in our CloseScreen function.
    
    Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

diff --git a/glamor/glamor.h b/glamor/glamor.h
index c972694e3..77df1ff96 100644
--- a/glamor/glamor.h
+++ b/glamor/glamor.h
@@ -338,14 +338,14 @@ extern _X_EXPORT void glamor_set_drawable_modifiers_func(ScreenPtr screen,
 
 /* @glamor_egl_init: Initialize EGL environment.
  *
- * @scrn: Current screen info pointer.
+ * @screen: Current screen pointer.
  * @fd:   Current drm fd.
  *
  * This function creates and intialize EGL contexts.
  * Should be called from DDX's preInit function.
  * Return TRUE if success, otherwise return FALSE.
  * */
-extern _X_EXPORT Bool glamor_egl_init(ScrnInfoPtr scrn, int fd);
+extern _X_EXPORT Bool glamor_egl_init(ScreenPtr screen, int fd);
 
 extern _X_EXPORT Bool glamor_egl_init_textured_pixmap(ScreenPtr screen);
 
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index a565c4a3b..8ddfb62bb 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -59,17 +59,14 @@ struct glamor_egl_screen_private {
 
     CloseScreenProcPtr saved_close_screen;
     DestroyPixmapProcPtr saved_destroy_pixmap;
-    xf86FreeScreenProc *saved_free_screen;
 };
 
-int xf86GlamorEGLPrivateIndex = -1;
-
+static DevPrivateKeyRec glamor_egl_screen_private_key;
 
 static struct glamor_egl_screen_private *
-glamor_egl_get_screen_private(ScrnInfoPtr scrn)
+glamor_egl_get_screen_private(ScreenPtr screen)
 {
-    return (struct glamor_egl_screen_private *)
-        scrn->privates[xf86GlamorEGLPrivateIndex].ptr;
+    return dixLookupPrivate(&screen->devPrivates, &glamor_egl_screen_private_key);
 }
 
 static void
@@ -137,7 +134,7 @@ struct gbm_device *
 glamor_egl_get_gbm_device(ScreenPtr screen)
 {
     struct glamor_egl_screen_private *glamor_egl =
-        glamor_egl_get_screen_private(xf86ScreenToScrn(screen));
+        glamor_egl_get_screen_private(screen);
     return glamor_egl->gbm;
 }
 
@@ -167,8 +164,7 @@ glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image,
     old = pixmap_priv->image;
     if (old) {
         ScreenPtr                               screen = pixmap->drawable.pScreen;
-        ScrnInfoPtr                             scrn = xf86ScreenToScrn(screen);
-        struct glamor_egl_screen_private        *glamor_egl = glamor_egl_get_screen_private(scrn);
+        struct glamor_egl_screen_private        *glamor_egl = glamor_egl_get_screen_private(screen);
 
         eglDestroyImageKHR(glamor_egl->display, old);
     }
@@ -180,9 +176,8 @@ Bool
 glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride)
 {
     ScreenPtr screen = pixmap->drawable.pScreen;
-    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     struct glamor_egl_screen_private *glamor_egl =
-        glamor_egl_get_screen_private(scrn);
+        glamor_egl_get_screen_private(screen);
     int ret, fd;
 
     /* GBM doesn't have an import path from handles, so we make a
@@ -217,7 +212,6 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap,
                                               Bool used_modifiers)
 {
     ScreenPtr screen = pixmap->drawable.pScreen;
-    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     struct glamor_screen_private *glamor_priv =
         glamor_get_screen_private(screen);
     struct glamor_egl_screen_private *glamor_egl;
@@ -225,7 +219,7 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap,
     GLuint texture;
     Bool ret = FALSE;
 
-    glamor_egl = glamor_egl_get_screen_private(scrn);
+    glamor_egl = glamor_egl_get_screen_private(screen);
 
     glamor_make_current(glamor_priv);
 
@@ -260,9 +254,8 @@ static Bool
 glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok)
 {
     ScreenPtr screen = pixmap->drawable.pScreen;
-    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     struct glamor_egl_screen_private *glamor_egl =
-        glamor_egl_get_screen_private(scrn);
+        glamor_egl_get_screen_private(screen);
     struct glamor_pixmap_private *pixmap_priv =
         glamor_get_pixmap_private(pixmap);
     unsigned width = pixmap->drawable.width;
@@ -368,7 +361,7 @@ static struct gbm_bo *
 glamor_gbm_bo_from_pixmap_internal(ScreenPtr screen, PixmapPtr pixmap)
 {
     struct glamor_egl_screen_private *glamor_egl =
-        glamor_egl_get_screen_private(xf86ScreenToScrn(screen));
+        glamor_egl_get_screen_private(screen);
     struct glamor_pixmap_private *pixmap_priv =
         glamor_get_pixmap_private(pixmap);
 
@@ -465,7 +458,7 @@ glamor_egl_fd_name_from_pixmap(ScreenPtr screen,
     struct gbm_bo *bo;
     int fd = -1;
 
-    glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen));
+    glamor_egl = glamor_egl_get_screen_private(screen);
 
     if (!glamor_make_pixmap_exportable(pixmap, FALSE))
         goto failure;
@@ -493,13 +486,12 @@ glamor_back_pixmap_from_fd(PixmapPtr pixmap,
                            CARD16 stride, CARD8 depth, CARD8 bpp)
 {
     ScreenPtr screen = pixmap->drawable.pScreen;
-    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     struct glamor_egl_screen_private *glamor_egl;
     struct gbm_bo *bo;
     struct gbm_import_fd_data import_data = { 0 };
     Bool ret;
 
-    glamor_egl = glamor_egl_get_screen_private(scrn);
+    glamor_egl = glamor_egl_get_screen_private(screen);
 
     if (bpp != 32 || !(depth == 24 || depth == 32 || depth == 30) || width == 0 || height == 0)
         return FALSE;
@@ -553,7 +545,7 @@ glamor_pixmap_from_fds(ScreenPtr screen,
     Bool ret = FALSE;
     int i;
 
-    glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen));
+    glamor_egl = glamor_egl_get_screen_private(screen);
 
     pixmap = screen->CreatePixmap(screen, 0, 0, depth, 0);
 
@@ -627,7 +619,7 @@ glamor_get_formats(ScreenPtr screen,
     /* Explicitly zero the count as the caller may ignore the return value */
     *num_formats = 0;
 
-    glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen));
+    glamor_egl = glamor_egl_get_screen_private(screen);
 
     if (!glamor_egl->dmabuf_capable)
         return TRUE;
@@ -667,7 +659,7 @@ glamor_get_modifiers(ScreenPtr screen, uint32_t format,
     /* Explicitly zero the count as the caller may ignore the return value */
     *num_modifiers = 0;
 
-    glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen));
+    glamor_egl = glamor_egl_get_screen_private(screen);
 
     if (!glamor_egl->dmabuf_capable)
         return FALSE;
@@ -701,9 +693,8 @@ static Bool
 glamor_egl_destroy_pixmap(PixmapPtr pixmap)
 {
     ScreenPtr screen = pixmap->drawable.pScreen;
-    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     struct glamor_egl_screen_private *glamor_egl =
-        glamor_egl_get_screen_private(scrn);
+        glamor_egl_get_screen_private(screen);
     Bool ret;
 
     if (pixmap->refcnt == 1) {
@@ -745,8 +736,11 @@ glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back)
     glamor_set_pixmap_type(back, GLAMOR_TEXTURE_DRM);
 }
 
-static void glamor_egl_cleanup(struct glamor_egl_screen_private *glamor_egl)
+static void glamor_egl_cleanup(ScreenPtr screen)
 {
+    struct glamor_egl_screen_private *glamor_egl;
+
+    glamor_egl = glamor_egl_get_screen_private(screen);
     if (glamor_egl->display != EGL_NO_DISPLAY) {
         eglMakeCurrent(glamor_egl->display,
                        EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
@@ -761,18 +755,21 @@ static void glamor_egl_cleanup(struct glamor_egl_screen_private *glamor_egl)
         gbm_device_destroy(glamor_egl->gbm);
     free(glamor_egl->device_path);
     free(glamor_egl);
+
+    screen->DestroyPixmap = glamor_egl->saved_destroy_pixmap;
+    screen->CloseScreen = glamor_egl->saved_close_screen;
+
+    dixSetPrivate(&screen->devPrivates, &glamor_egl_screen_private_key, NULL);
 }
 
 static Bool
 glamor_egl_close_screen(ScreenPtr screen)
 {
-    ScrnInfoPtr scrn;
     struct glamor_egl_screen_private *glamor_egl;
     struct glamor_pixmap_private *pixmap_priv;
     PixmapPtr screen_pixmap;
 
-    scrn = xf86ScreenToScrn(screen);
-    glamor_egl = glamor_egl_get_screen_private(scrn);
+    glamor_egl = glamor_egl_get_screen_private(screen);
     screen_pixmap = screen->GetScreenPixmap(screen);
     pixmap_priv = glamor_get_pixmap_private(screen_pixmap);
 
@@ -780,6 +777,7 @@ glamor_egl_close_screen(ScreenPtr screen)
     pixmap_priv->image = NULL;
 
     screen->CloseScreen = glamor_egl->saved_close_screen;
+    glamor_egl_cleanup(screen);
 
     return screen->CloseScreen(screen);
 }
@@ -791,9 +789,8 @@ glamor_dri3_open_client(ClientPtr client,
                         RRProviderPtr provider,
                         int *fdp)
 {
-    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     struct glamor_egl_screen_private *glamor_egl =
-        glamor_egl_get_screen_private(scrn);
+        glamor_egl_get_screen_private(screen);
     int fd;
     drm_magic_t magic;
 
@@ -850,9 +847,8 @@ static const dri3_screen_info_rec glamor_dri3_info = {
 void
 glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
 {
-    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     struct glamor_egl_screen_private *glamor_egl =
-        glamor_egl_get_screen_private(scrn);
+        glamor_egl_get_screen_private(screen);
 #ifdef DRI3
     glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
 #endif
@@ -893,21 +889,8 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
 #endif
 }
 
-static void
-glamor_egl_free_screen(ScrnInfoPtr scrn)
-{
-    struct glamor_egl_screen_private *glamor_egl;
-
-    glamor_egl = glamor_egl_get_screen_private(scrn);
-    if (glamor_egl != NULL) {
-        scrn->FreeScreen = glamor_egl->saved_free_screen;
-        glamor_egl_cleanup(glamor_egl);
-        scrn->FreeScreen(scrn);
-    }
-}
-
 Bool
-glamor_egl_init(ScrnInfoPtr scrn, int fd)
+glamor_egl_init(ScreenPtr screen, int fd)
 {
     struct glamor_egl_screen_private *glamor_egl;
     const GLubyte *renderer;
@@ -917,10 +900,16 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
     glamor_egl = calloc(sizeof(*glamor_egl), 1);
     if (glamor_egl == NULL)
         return FALSE;
-    if (xf86GlamorEGLPrivateIndex == -1)
-        xf86GlamorEGLPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
 
-    scrn->privates[xf86GlamorEGLPrivateIndex].ptr = glamor_egl;
+    if (!dixRegisterPrivateKey(&glamor_egl_screen_private_key, PRIVATE_SCREEN, 0)) {
+        LogMessage(X_WARNING,
+                   "glamor%d: Failed to allocate egl screen private\n",
+                   screen->myNum);
+        goto error;
+    }
+
+    dixSetPrivate(&screen->devPrivates, &glamor_egl_screen_private_key, glamor_egl);
+
     glamor_egl->fd = fd;
     glamor_egl->gbm = gbm_create_device(glamor_egl->fd);
     if (glamor_egl->gbm == NULL) {
@@ -1053,12 +1042,10 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
     }
 #endif
 
-    glamor_egl->saved_free_screen = scrn->FreeScreen;
-    scrn->FreeScreen = glamor_egl_free_screen;
     return TRUE;
 
 error:
-    glamor_egl_cleanup(glamor_egl);
+    glamor_egl_cleanup(screen);
     return FALSE;
 }
 
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index da7279c13..82e7f81d6 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -768,7 +768,7 @@ try_enable_glamor(ScrnInfoPtr pScrn)
     }
 
     if (xf86LoadSubModule(pScrn, GLAMOR_EGL_MODULE_NAME)) {
-        if (glamor_egl_init(pScrn, ms->fd)) {
+        if (glamor_egl_init(xf86ScrnToScreen(pScrn), ms->fd)) {
             xf86DrvMsg(pScrn->scrnIndex, X_INFO, "glamor initialized\n");
             ms->drmmode.glamor = TRUE;
         } else {
commit 1b5183b26d9977d46f6624126a2b2b6d77a74659
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Thu Jul 18 15:58:13 2019 +0100

    glamor_egl: move glamor_egl_cleanup() further up
    
    We'll use the function within glamor_egl_close_screen() with next patch.
    
    Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 8a88de10d..a565c4a3b 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -745,6 +745,24 @@ glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back)
     glamor_set_pixmap_type(back, GLAMOR_TEXTURE_DRM);
 }
 
+static void glamor_egl_cleanup(struct glamor_egl_screen_private *glamor_egl)
+{
+    if (glamor_egl->display != EGL_NO_DISPLAY) {
+        eglMakeCurrent(glamor_egl->display,
+                       EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+        /*
+         * Force the next glamor_make_current call to update the context
+         * (on hot unplug another GPU may still be using glamor)
+         */
+        lastGLContext = NULL;
+        eglTerminate(glamor_egl->display);
+    }
+    if (glamor_egl->gbm)
+        gbm_device_destroy(glamor_egl->gbm);
+    free(glamor_egl->device_path);
+    free(glamor_egl);
+}
+
 static Bool
 glamor_egl_close_screen(ScreenPtr screen)
 {
@@ -875,24 +893,6 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
 #endif
 }
 
-static void glamor_egl_cleanup(struct glamor_egl_screen_private *glamor_egl)
-{
-    if (glamor_egl->display != EGL_NO_DISPLAY) {
-        eglMakeCurrent(glamor_egl->display,
-                       EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
-        /*
-         * Force the next glamor_make_current call to update the context
-         * (on hot unplug another GPU may still be using glamor)
-         */
-        lastGLContext = NULL;
-        eglTerminate(glamor_egl->display);
-    }
-    if (glamor_egl->gbm)
-        gbm_device_destroy(glamor_egl->gbm);
-    free(glamor_egl->device_path);
-    free(glamor_egl);
-}
-
 static void
 glamor_egl_free_screen(ScrnInfoPtr scrn)
 {
commit 6a557167366b8b1352709397df50649d5665b755
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Tue Jul 16 17:50:13 2019 +0100

    glamor/egl: remove unused function pointers
    
    The following two members of glamor_egl_screen_private has been unused
    for a little while now.
     CreateScreenResources
     CloseScreen
    
    Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 81a82bcb7..8a88de10d 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -53,8 +53,6 @@ struct glamor_egl_screen_private {
     EGLContext context;
     char *device_path;
 
-    CreateScreenResourcesProcPtr CreateScreenResources;
-    CloseScreenProcPtr CloseScreen;
     int fd;
     struct gbm_device *gbm;
     int dmabuf_capable;
commit 52a2a052aa3ab92b07c185c1fc2bf4ee2d727f4d
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Fri Jul 12 17:47:27 2019 +0100

    glamor_egl: use LogMessage over xf86DrvMsg
    
    Much of glamor already use LogMessage() so we might as well be
    consistent. This effectively paves the way of making glamor-egl xf86
    agnostic.
    
    Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 693bee6cf..81a82bcb7 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -146,13 +146,12 @@ glamor_egl_get_gbm_device(ScreenPtr screen)
 Bool
 glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride)
 {
-    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     PixmapPtr screen_pixmap;
 
     screen_pixmap = screen->GetScreenPixmap(screen);
 
     if (!glamor_egl_create_textured_pixmap(screen_pixmap, handle, stride)) {
-        xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+        LogMessage(X_ERROR,
                    "Failed to create textured screen.");
         return FALSE;
     }
@@ -193,7 +192,7 @@ glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride)
      */
     ret = drmPrimeHandleToFD(glamor_egl->fd, handle, O_CLOEXEC, &fd);
     if (ret) {
-        xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+        LogMessage(X_ERROR,
                    "Failed to make prime FD for handle: %d\n", errno);
         return FALSE;
     }
@@ -204,7 +203,7 @@ glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride)
                                     stride,
                                     pixmap->drawable.depth,
                                     pixmap->drawable.bitsPerPixel)) {
-        xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+        LogMessage(X_ERROR,
                    "Failed to make import prime FD as pixmap: %d\n", errno);
         close(fd);
         return FALSE;
@@ -298,7 +297,7 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok)
         format = GBM_FORMAT_R8;
         break;
     default:
-        xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+        LogMessage(X_ERROR,
                    "Failed to make %d depth, %dbpp pixmap exportable\n",
                    pixmap->drawable.depth, pixmap->drawable.bitsPerPixel);
         return FALSE;
@@ -330,7 +329,7 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok)
     }
 
     if (!bo) {
-        xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+        LogMessage(X_ERROR,
                    "Failed to make %dx%dx%dbpp GBM bo\n",
                    width, height, pixmap->drawable.bitsPerPixel);
         return FALSE;
@@ -341,7 +340,7 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok)
                                gbm_bo_get_stride(bo), NULL);
     if (!glamor_egl_create_textured_pixmap_from_gbm_bo(exported, bo,
                                                        used_modifiers)) {
-        xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+        LogMessage(X_ERROR,
                    "Failed to make %dx%dx%dbpp pixmap from GBM bo\n",
                    width, height, pixmap->drawable.bitsPerPixel);
         screen->DestroyPixmap(exported);
@@ -871,7 +870,7 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
         glamor_egl->device_path = drmGetDeviceNameFromFd2(glamor_egl->fd);
 
         if (!dri3_screen_init(screen, &glamor_dri3_info)) {
-            xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+            LogMessage(X_ERROR,
                        "Failed to initialize DRI3.\n");
         }
     }
@@ -934,12 +933,12 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
     glamor_egl->display = glamor_egl_get_display(EGL_PLATFORM_GBM_MESA,
                                                  glamor_egl->gbm);
     if (!glamor_egl->display) {
-        xf86DrvMsg(scrn->scrnIndex, X_ERROR, "eglGetDisplay() failed\n");
+        LogMessage(X_ERROR, "eglGetDisplay() failed\n");
         goto error;
     }
 
     if (!eglInitialize(glamor_egl->display, NULL, NULL)) {
-        xf86DrvMsg(scrn->scrnIndex, X_ERROR, "eglInitialize() failed\n");
+        LogMessage(X_ERROR, "eglInitialize() failed\n");
         glamor_egl->display = EGL_NO_DISPLAY;
         goto error;
     }
@@ -989,13 +988,13 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
             EGL_NONE
         };
         if (!eglBindAPI(EGL_OPENGL_ES_API)) {
-            xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+            LogMessage(X_ERROR,
                        "glamor: Failed to bind either GL or GLES APIs.\n");
             goto error;
         }
 
         if (!eglChooseConfig(glamor_egl->display, NULL, &egl_config, 1, &n)) {
-            xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+            LogMessage(X_ERROR,
                        "glamor: No acceptable EGL configs found\n");
             goto error;
         }
@@ -1005,26 +1004,26 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
                                                config_attribs);
     }
     if (glamor_egl->context == EGL_NO_CONTEXT) {
-        xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+        LogMessage(X_ERROR,
                    "glamor: Failed to create GL or GLES2 contexts\n");
         goto error;
     }
 
     if (!eglMakeCurrent(glamor_egl->display,
                         EGL_NO_SURFACE, EGL_NO_SURFACE, glamor_egl->context)) {
-        xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+        LogMessage(X_ERROR,
                    "Failed to make EGL context current\n");
         goto error;
     }
 
     renderer = glGetString(GL_RENDERER);
     if (!renderer) {
-        xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+        LogMessage(X_ERROR,
                    "glGetString() returned NULL, your GL is broken\n");
         goto error;
     }
     if (strstr((const char *)renderer, "llvmpipe")) {
-        xf86DrvMsg(scrn->scrnIndex, X_INFO,
+        LogMessage(X_INFO,
                    "Refusing to try glamor on llvmpipe\n");
         goto error;
     }
@@ -1036,13 +1035,12 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
     lastGLContext = NULL;
 
     if (!epoxy_has_gl_extension("GL_OES_EGL_image")) {
-        xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+        LogMessage(X_ERROR,
                    "glamor acceleration requires GL_OES_EGL_image\n");
         goto error;
     }
 
-    xf86DrvMsg(scrn->scrnIndex, X_INFO, "glamor X acceleration enabled on %s\n",
-               renderer);
+    LogMessage(X_INFO, "glamor X acceleration enabled on %s\n", renderer);
 
 #ifdef GBM_BO_WITH_MODIFIERS
     if (epoxy_has_egl_extension(glamor_egl->display,


More information about the xorg-commit mailing list