display-wayland: Add UYVY buffers support
authorRamprasad N <x0038811@ti.com>
Wed, 4 Jul 2018 10:50:17 +0000 (16:20 +0530)
committerRamprasad N <x0038811@ti.com>
Tue, 17 Jul 2018 09:40:27 +0000 (15:10 +0530)
UYVY buffers are supported as textures.

Signed-off-by: Ramprasad N <x0038811@ti.com>
util/display-wayland.c

index a044788c4133e901793051e8d0d4be5094c2a94c..8ba5f6e96ea1d2824ab515cd6198b5273fdacd74 100644 (file)
@@ -136,6 +136,18 @@ alloc_buffer(struct display *disp, uint32_t fourcc, uint32_t w, uint32_t h)
                        buf->width * 4, wl_fmt);
                break;
        case FOURCC('U','Y','V','Y'):
+               wl_fmt = WL_DRM_FORMAT_UYVY;
+               buf->nbo = 1;
+               buf->bo[0] = alloc_bo(disp, 16, buf->width, buf->height,
+                               &bo_handles[0], &buf->pitches[0]);
+
+               omap_bo_get_name(buf->bo[0], &buf_wl->name);
+               buf->fd[0] = omap_bo_dmabuf(buf->bo[0]);
+               /* YUYV; stride is double width */
+               buf_wl->wl_buf = wl_drm_create_buffer(disp_wl->drm,
+                       buf_wl->name, buf->width, buf->height,
+                       buf->width * 2, wl_fmt);
+               break;
        case FOURCC('Y','U','Y','V'):
                wl_fmt = WL_DRM_FORMAT_YUYV;
                buf->nbo = 1;