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

Emil Velikov emil.l.velikov at gmail.com
Thu May 11 22:22:32 UTC 2017


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

Analogous to previous commit.

Cc: Derek Foreman <derekf at osg.samsung.com>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
Derek, afaict we should be able to revert commit 534ea2b5ba0 with this
in place.

Can you please apply this patch, revert 534ea2b5ba0 and give it a test?
If things are still broken, please send me a backtrace while breaking
in image_get_buffers().

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

diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index a3380f298d3..9d1dd4ada3c 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -180,7 +180,11 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
    config = dri2_get_dri_config(dri2_conf, EGL_WINDOW_BIT,
                                 dri2_surf->base.GLColorspace);
 
-   if (dri2_dpy->dri2) {
+   if (dri2_dpy->image_driver) {
+      dri2_surf->wl_win->resize_callback = resize_callback;
+
+      createNewDrawable = dri2_dpy->image_driver->createNewDrawable;
+   } else if (dri2_dpy->dri2) {
       dri2_surf->wl_win->resize_callback = resize_callback;
 
       createNewDrawable = dri2_dpy->dri2->createNewDrawable;
@@ -1190,15 +1194,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)) {
+         err = "DRI2: failed to load driver";
+         goto cleanup_driver_name;
+      }
+   } else {
       dri2_dpy->loader_extensions = image_loader_extensions;
+      if (!dri2_load_driver_dri3(disp)) {
+         err = "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