[Mesa-dev] [PATCH 7/7] egl/wayland: use the image_driver alongside the image_loader

Emil Velikov emil.l.velikov at gmail.com
Mon May 15 15:26:07 UTC 2017


From: Emil Velikov <emil.velikov at collabora.com>

Analogous to earlier commits - image_driver and image_loader are meant
to be used hand in hand.

v2: Rebase

Cc: Derek Foreman <derekf at osg.samsung.com>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
Derek, can you try the v2 of the series with alongside git revert
534ea2b5ba0? A very quick test here showed no issues.

Thanks
Emil
---
 src/egl/drivers/dri2/platform_wayland.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 2c568c3e084..34787d225bb 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -184,7 +184,9 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
    if (dri2_dpy->flush)
       dri2_surf->wl_win->resize_callback = resize_callback;
 
-   if (dri2_dpy->dri2)
+   if (dri2_dpy->image_driver)
+      createNewDrawable = dri2_dpy->image_driver->createNewDrawable;
+   else if (dri2_dpy->dri2)
       createNewDrawable = dri2_dpy->dri2->createNewDrawable;
    else
       createNewDrawable = dri2_dpy->swrast->createNewDrawable;
@@ -1191,15 +1193,21 @@ dri2_initialize_wayland_drm(_EGLDriver *drv, _EGLDisplay *disp)
       goto cleanup_fd;
    }
 
-   if (!dri2_load_driver(disp))
-      goto cleanup_driver_name;
-
    /* render nodes cannot use Gem names, and thus do not support
     * the __DRI_DRI2_LOADER extension */
-   if (!dri2_dpy->is_render_node)
+   if (!dri2_dpy->is_render_node) {
       dri2_dpy->loader_extensions = dri2_loader_extensions;
-   else
+      if (!dri2_load_driver(disp)) {
+         _eglError(EGL_BAD_ALLOC, "DRI2: failed to load driver");
+         goto cleanup_driver_name;
+      }
+   } else {
       dri2_dpy->loader_extensions = image_loader_extensions;
+      if (!dri2_load_driver_dri3(disp)) {
+         _eglError(EGL_BAD_ALLOC, "DRI3: failed to load driver");
+         goto cleanup_driver_name;
+      }
+   }
 
    if (!dri2_create_screen(disp))
       goto cleanup_driver;
-- 
2.12.2



More information about the mesa-dev mailing list