summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2017-05-11 22:49:04 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2017-05-29 16:59:47 +0100
commit5cb16e07ab9fc9a2e3d900ed4e978c787314c8ba (patch)
tree1c103d72d0af7d7553eaa1d91477a5be87458d2f
parent429d56693d9eadf64fca20c9bf9f9415e68efd80 (diff)
egl/wayland: use the image_driver alongside the image_loader
Analogous to earlier commits - image_driver and image_loader are meant to be used hand in hand. v2: Rebase Cc: Derek Foreman <derekf@osg.samsung.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 39c36075d09..e447aa67290 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -191,7 +191,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;
@@ -1214,15 +1216,21 @@ dri2_initialize_wayland_drm(_EGLDriver *drv, _EGLDisplay *disp)
goto cleanup;
}
- if (!dri2_load_driver(disp))
- goto cleanup;
-
/* 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;
+ }
+ } 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;
+ }
+ }
if (!dri2_create_screen(disp))
goto cleanup;