diff --git a/util/vpe-common.c b/util/vpe-common.c
index 7b17a7d416445fb3ece81657c6787d02515afcf9..d298da4a785f855aab2187528abfb57c70f4034c 100755 (executable)
--- a/util/vpe-common.c
+++ b/util/vpe-common.c
int ret, i;
struct v4l2_format fmt;
struct v4l2_requestbuffers rqbufs;
+ bool saved_multiplanar;
memset(&fmt, 0, sizeof fmt);
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
vpe->dst.numbuf = rqbufs.count;
dprintf("vpe o/p: allocated buffers = %d\n", rqbufs.count);
-
- vpe->disp_bufs = disp_get_vid_buffers(vpe->disp, NUMBUF, vpe->dst.fourcc,
+
+ /*
+ * disp->multiplanar is used when allocating buffers to enable
+ * allocating multiplane buffer in separate buffers.
+ * VPE does handle mulitplane NV12 buffer correctly
+ * but VIP can only handle single plane buffers
+ * So by default we are setup to use single plane and only overwrite
+ * it when allocating strictly VPE buffers.
+ * Here we saved to current value and restore it after we are done
+ * allocating the buffers VPE will use for output.
+ */
+ saved_multiplanar = vpe->disp->multiplanar;
+ vpe->disp->multiplanar = true;
+ vpe->disp_bufs = disp_get_vid_buffers(vpe->disp, NUMBUF, vpe->dst.fourcc,
vpe->dst.width, vpe->dst.height);
+ vpe->disp->multiplanar = saved_multiplanar;
if (!vpe->disp_bufs)
pexit("allocating display buffer failed\n");