Merge branch 'master' into screencontent

This commit is contained in:
emersion 2018-06-17 14:49:18 +01:00
commit 57548b557a
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
43 changed files with 886 additions and 375 deletions

View file

@ -227,6 +227,10 @@ struct wlr_texture *wlr_gles2_texture_from_wl_drm(struct wlr_egl *egl,
return &texture->wlr_texture;
}
#ifndef DRM_FORMAT_BIG_ENDIAN
#define DRM_FORMAT_BIG_ENDIAN 0x80000000
#endif
struct wlr_texture *wlr_gles2_texture_from_dmabuf(struct wlr_egl *egl,
struct wlr_dmabuf_attributes *attribs) {
assert(wlr_egl_is_current(egl));
@ -235,12 +239,24 @@ struct wlr_texture *wlr_gles2_texture_from_dmabuf(struct wlr_egl *egl,
return NULL;
}
if (!egl->egl_exts.dmabuf_import) {
if (!egl->exts.image_dmabuf_import_ext) {
wlr_log(L_ERROR, "Cannot create DMA-BUF texture: EGL extension "
"unavailable");
return NULL;
}
switch (attribs->format & ~DRM_FORMAT_BIG_ENDIAN) {
case WL_SHM_FORMAT_YUYV:
case WL_SHM_FORMAT_YVYU:
case WL_SHM_FORMAT_UYVY:
case WL_SHM_FORMAT_VYUY:
case WL_SHM_FORMAT_AYUV:
// TODO: YUV based formats not yet supported, require multiple images
return false;
default:
break;
}
struct wlr_gles2_texture *texture =
calloc(1, sizeof(struct wlr_gles2_texture));
if (texture == NULL) {