diff options
author | emersion <contact@emersion.fr> | 2018-05-31 21:49:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-31 21:49:57 +0100 |
commit | 6b7a55aa3d548e29917027e68181412897a01b1a (patch) | |
tree | cca9dcee08cbd86a2768f901f49c599267e0e6ed /render/gles2/texture.c | |
parent | 32013abae63f1c31598ac716acd7e73c24fadae1 (diff) | |
parent | f90b024ad0ee2d746404e3240393fd4f13a884d1 (diff) |
Merge pull request #1020 from emersion/remove-check-dmabuf
render: remove wlr_renderer_check_import_dmabuf
Diffstat (limited to 'render/gles2/texture.c')
-rw-r--r-- | render/gles2/texture.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/render/gles2/texture.c b/render/gles2/texture.c index 2627e292..89a175c4 100644 --- a/render/gles2/texture.c +++ b/render/gles2/texture.c @@ -198,6 +198,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)); @@ -212,6 +216,18 @@ struct wlr_texture *wlr_gles2_texture_from_dmabuf(struct wlr_egl *egl, 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) { |