Revert "Revert "[media] s4p-mfc: set allow_zero_bytesused flag for vb2_queue_init"" accepted/tizen_3.0_common accepted/tizen_3.0_ivi accepted/tizen_3.0_mobile accepted/tizen_3.0_tv accepted/tizen_3.0_wearable tizen_3.0_tv accepted/tizen/3.0/common/20170123.131924 accepted/tizen/3.0/ivi/20170123.022308 accepted/tizen/3.0/mobile/20170123.022200 accepted/tizen/3.0/tv/20170123.022227 accepted/tizen/3.0/wearable/20170123.022249 submit/tizen_3.0/20170120.062715
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 16 Jan 2017 10:18:07 +0000 (19:18 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 17 Jan 2017 06:11:44 +0000 (15:11 +0900)
This reverts commit 41250210f58c60c412344089cdebdf895eaf274a.

Without allow_zero_byteused flag, during decoding the last EOS buffer
with zero bytesused from userspace is not properly processed, so
stream is stuck without finishing all queued buffer.

Change-Id: I5725d3514885c104febb12adb44b13ae9b527817
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/media/platform/s5p-mfc/s5p_mfc.c

index 7af9facc85d4d171807c1ee819fffd8041eb4242..36d1b52f6e6f4a966e7a620f41159b11f30e9729 100644 (file)
@@ -880,6 +880,13 @@ static int s5p_mfc_open(struct file *file)
                ret = -ENOENT;
                goto err_queue_init;
        }
+       /* One way to indicate end-of-stream for MFC is to set the
+        * bytesused == 0. However by default videobuf2 handles bytesused
+        * equal to 0 as a special case and changes its value to the size
+        * of the buffer. Set the allow_zero_bytesused flag so that videobuf2
+        * will keep the value of bytesused intact.
+        */
+       q->allow_zero_bytesused = 1;
        q->mem_ops = &vb2_dma_contig_memops;
        q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
        ret = vb2_queue_init(q);