From: Hans Verkuil Date: Sun, 23 Feb 2014 09:49:52 +0000 (+0100) Subject: v4l2-compliance: reopen node after each streaming test. X-Git-Tag: v4l-utils-1.2.0~184 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4563a79b4f897e484c2953a486aa6d3ced1a2cf3;p=platform%2Fupstream%2Fv4l-utils.git v4l2-compliance: reopen node after each streaming test. This should clear any bad state left by the previous test. Signed-off-by: Hans Verkuil --- diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index 399d2ea..f913ccb 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -606,7 +606,7 @@ int main(int argc, char **argv) exit(1); } - if (expbuf_device && (expbuf_node.fd = test_open(expbuf_device, O_RDWR)) < 0) { + if (expbuf_device && (expbuf_node.fd = open(expbuf_device, O_RDWR)) < 0) { fprintf(stderr, "Failed to open %s: %s\n", expbuf_device, strerror(errno)); exit(1); @@ -807,16 +807,19 @@ int main(int argc, char **argv) streamingSetup(&node); printf("\ttest read/write: %s\n", ok(testReadWrite(&node))); - // Reopen to clear the 'file I/O' mode of the filehandle, - // preventing VIDIOC_REQBUFS from working (will return -EBUSY). + // Reopen after each streaming test to reset the streaming state + // in case of any errors in the preceeding test. reopen(&node); printf("\ttest MMAP: %s\n", ok(testMmap(&node, frame_count))); + reopen(&node); printf("\ttest USERPTR: %s\n", ok(testUserPtr(&node, frame_count))); + reopen(&node); if (options[OptSetExpBufDevice] || !(node.valid_memorytype & (1 << V4L2_MEMORY_DMABUF))) printf("\ttest DMABUF: %s\n", ok(testDmaBuf(&expbuf_node, &node, frame_count))); else if (!options[OptSetExpBufDevice]) printf("\ttest DMABUF: Cannot test, specify --expbuf-device\n"); + reopen(&node); } printf("\n");