summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers
diff options
context:
space:
mode:
authorDaniel Stone <[email protected]>2017-06-16 17:33:56 +0100
committerDaniel Stone <[email protected]>2017-07-18 22:16:21 +0100
commit6595c6995114f4eb56b5a58f18aa954960462a92 (patch)
treeb4863f26f35e9fe2efe8e6f1444cf6854431d02d /src/egl/drivers
parentc4a1c7a2eb0c7429ffd10cc4aa2b83fe04e92295 (diff)
egl/wayland: Remove more surface specifics from create_wl_buffer
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/egl/drivers')
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 1736c4c9fb1..b86b5481bad 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -643,31 +643,28 @@ create_wl_buffer(struct dri2_egl_display *dri2_dpy,
__DRIimage *image)
{
struct wl_buffer *ret;
- int fd, stride, name;
+ int width, height, fourcc;
+
+ dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_WIDTH, &width);
+ dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_HEIGHT, &height);
+ dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_FOURCC, &fourcc);
if (dri2_dpy->capabilities & WL_DRM_CAPABILITY_PRIME) {
+ int fd, stride;
+
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_FD, &fd);
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, &stride);
-
ret = wl_drm_create_prime_buffer(dri2_surf->wl_drm_wrapper,
- fd,
- dri2_surf->base.Width,
- dri2_surf->base.Height,
- dri2_surf->format,
- 0, stride,
- 0, 0,
- 0, 0);
+ fd, width, height, fourcc, 0, stride,
+ 0, 0, 0, 0);
close(fd);
} else {
+ int name, stride;
+
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_NAME, &name);
dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, &stride);
-
ret = wl_drm_create_buffer(dri2_surf->wl_drm_wrapper,
- name,
- dri2_surf->base.Width,
- dri2_surf->base.Height,
- stride,
- dri2_surf->format);
+ name, width, height, stride, fourcc);
}
return ret;