viddec3test:fd is initialized in display-wayland
[glsdk/omapdrmtest.git] / util / display-wayland.c
index c0d6175d64ac2f581f5d5c5b2d0acbea2ece23a3..35103a87326aaff1310543a856e57aee52440d3e 100644 (file)
@@ -95,7 +95,7 @@ alloc_buffer(struct display *disp, uint32_t fourcc, uint32_t w, uint32_t h)
        buf->fourcc = fourcc;
        buf->width = w;
        buf->height = h;
-       buf->multiplanar = true;
+       buf->multiplanar = false;
 
        buf->nbo = 1;
 
@@ -109,6 +109,7 @@ alloc_buffer(struct display *disp, uint32_t fourcc, uint32_t w, uint32_t h)
                buf->bo[0] = alloc_bo(disp, 32, 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]);
 
                /* ARGB: stride is four times width */
                buf_wl->wl_buf = wl_drm_create_buffer(disp_wl->drm,
@@ -123,6 +124,7 @@ alloc_buffer(struct display *disp, uint32_t fourcc, uint32_t w, uint32_t h)
                                &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,
@@ -135,6 +137,7 @@ alloc_buffer(struct display *disp, uint32_t fourcc, uint32_t w, uint32_t h)
                                &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]);
                /* NV12: Create a planar buffer */
                buf_wl->wl_buf = wl_drm_create_planar_buffer(disp_wl->drm,
                        buf_wl->name, buf->width, buf->height, wl_fmt,
@@ -307,9 +310,7 @@ disp_wayland_open(int argc, char **argv)
                if (!argv[i]) {
                        continue;
                }
-               if (!strcmp("-1", argv[i])) {
-                       disp->multiplanar = false;
-               } else if (!strcmp("-w", argv[i])) {
+               if (!strcmp("-w", argv[i])) {
                        argv[i++] = NULL;
                        if (sscanf(argv[i], "%dx%d", &width, &height) != 2) {
                                ERROR("invalid arg: -w %s", argv[i]);
@@ -364,7 +365,7 @@ disp_wayland_open(int argc, char **argv)
        disp->close = close_kms;
        disp->disp_free_buf = free_buffers;
 
-       disp->multiplanar = true;
+       disp->multiplanar = false;
        disp->width = width;
        disp->height = height;