{"id":4059,"url":"https://patchwork.libcamera.org/api/patches/4059/?format=json","web_url":"https://patchwork.libcamera.org/patch/4059/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200616131244.70308-16-paul.elder@ideasonboard.com>","date":"2020-06-16T13:12:44","name":"[libcamera-devel,15/15] v4l2: v4l2_camera_proxy: Fix v4l2-compliance streaming tests","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"bbf569fbc9bb156ae91d5a6f571fdf3175b9ac1c","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/4059/mbox/","series":[{"id":1006,"url":"https://patchwork.libcamera.org/api/series/1006/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1006","date":"2020-06-16T13:12:29","name":"Support v4l2-compliance","version":1,"mbox":"https://patchwork.libcamera.org/series/1006/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/4059/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/4059/checks/","tags":{},"headers":{"Return-Path":"<paul.elder@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D291A61F5D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Jun 2020 15:13:28 +0200 (CEST)","from jade.flets-east.jp (unknown\n\t[IPv6:2400:4051:61:600:2807:bdfa:f6a:8e53])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 65AF6F9;\n\tTue, 16 Jun 2020 15:13:27 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"tpfahY/N\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1592313208;\n\tbh=8t2tCJhQDZS3vUQddiGqmGmlZ4XrNCv3BJMlmZi6MAQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=tpfahY/NGwey34fkInwNJgiSBQu779KXx4UgkKRH+PpaC9hQ+e5OXZSaroAEkevaU\n\t3MAw055LHigISu22Z8Xm72DPWWbO0JxnYa2F0Q8VX4Gh1gpI+C9bWDywQO16NmBKfx\n\t/ed8Szz6VEM2JNSzjkuloEdZB3mzdR6wYvrAsiuE=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 16 Jun 2020 22:12:44 +0900","Message-Id":"<20200616131244.70308-16-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20200616131244.70308-1-paul.elder@ideasonboard.com>","References":"<20200616131244.70308-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 15/15] v4l2: v4l2_camera_proxy: Fix\n\tv4l2-compliance streaming tests","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 16 Jun 2020 13:13:29 -0000"},"content":"Fix v4l2-compliance streaming tests, for reqbufs, qbuf, dqbuf, and\nstreamon.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/v4l2/v4l2_camera_proxy.cpp | 15 +++++++++++++--\n 1 file changed, 13 insertions(+), 2 deletions(-)","diff":"diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\nindex e4d534a..fca728a 100644\n--- a/src/v4l2/v4l2_camera_proxy.cpp\n+++ b/src/v4l2/v4l2_camera_proxy.cpp\n@@ -232,7 +232,6 @@ void V4L2CameraProxy::updateBuffers()\n \t\t\tbuf.timestamp.tv_usec = fmd.timestamp % 1000000;\n \t\t\tbuf.sequence = fmd.sequence;\n \n-\t\t\tbuf.flags |= V4L2_BUF_FLAG_DONE;\n \t\t\tbreak;\n \t\tcase FrameMetadata::FrameError:\n \t\t\tbuf.flags |= V4L2_BUF_FLAG_ERROR;\n@@ -517,6 +516,9 @@ int V4L2CameraProxy::vidioc_reqbufs(int fd, struct v4l2_requestbuffers *arg)\n \t\t\t\treturn ret;\n \t\t}\n \n+\t\tif (!mmaps_.empty())\n+\t\t\treturn -EBUSY;\n+\n \t\tunlock(fd);\n \t\treturn freeBuffers();\n \t}\n@@ -616,6 +618,9 @@ int V4L2CameraProxy::vidioc_qbuf(int fd, struct v4l2_buffer *arg)\n \tif (arg->index >= bufferCount_)\n \t\treturn -EINVAL;\n \n+\tif (buffers_[arg->index].flags & V4L2_BUF_FLAG_QUEUED)\n+\t\treturn -EINVAL;\n+\n \tint ret = lock(fd);\n \tif (ret < 0)\n \t\treturn ret;\n@@ -629,9 +634,12 @@ int V4L2CameraProxy::vidioc_qbuf(int fd, struct v4l2_buffer *arg)\n \tif (ret < 0)\n \t\treturn ret;\n \n-\targ->flags |= V4L2_BUF_FLAG_QUEUED;\n+\targ->flags |= V4L2_BUF_FLAG_QUEUED | V4L2_BUF_FLAG_MAPPED;\n \targ->flags &= ~V4L2_BUF_FLAG_DONE;\n \n+\tbuffers_[arg->index].flags |= V4L2_BUF_FLAG_QUEUED | V4L2_BUF_FLAG_MAPPED;\n+\tbuffers_[arg->index].flags &= ~V4L2_BUF_FLAG_DONE;\n+\n \treturn ret;\n }\n \n@@ -694,6 +702,9 @@ int V4L2CameraProxy::vidioc_streamon(int fd, int *arg)\n \tif (arg == nullptr)\n \t\treturn -EFAULT;\n \n+\tif (bufferCount_ == 0)\n+\t\treturn -EINVAL;\n+\n \tif (streaming_)\n \t\treturn 0;\n \n","prefixes":["libcamera-devel","15/15"]}