summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/drivers')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c3
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c9
2 files changed, 5 insertions, 7 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index e9b556ec5f7..17b646e7ede 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1966,7 +1966,8 @@ dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,
}
dri_image = dri2_dpy->image->fromPlanar(buffer->driver_buffer, plane, NULL);
-
+ if (dri_image == NULL && plane == 0)
+ dri_image = dri2_dpy->image->dupImage(buffer->driver_buffer, NULL);
if (dri_image == NULL) {
_eglError(EGL_BAD_PARAMETER, "dri2_create_image_wayland_wl_buffer");
return NULL;
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index f91baded877..5b8bec901b0 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -814,13 +814,10 @@ create_wl_buffer(struct dri2_egl_display *dri2_dpy,
int stride, offset;
int fd = -1;
- if (i == 0)
- p_image = image;
- else
- p_image = dri2_dpy->image->fromPlanar(image, i, NULL);
+ p_image = dri2_dpy->image->fromPlanar(image, i, NULL);
if (!p_image) {
- zwp_linux_buffer_params_v1_destroy(params);
- return NULL;
+ assert(i == 0);
+ p_image = image;
}
query = dri2_dpy->image->queryImage(p_image,