[{"id":5254,"web_url":"https://patchwork.libcamera.org/comment/5254/","msgid":"<20200617154355.tvz6qyygn4iz5se4@uno.localdomain>","date":"2020-06-17T15:43:55","subject":"Re: [libcamera-devel] [PATCH 15/15] v4l2: v4l2_camera_proxy: Fix\n\tv4l2-compliance streaming tests","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Paul,\n\nOn Tue, Jun 16, 2020 at 10:12:44PM +0900, Paul Elder wrote:\n> Fix v4l2-compliance streaming tests, for reqbufs, qbuf, dqbuf, and\n> streamon.\n\nThis seems a bit of a collection of random fixes. I'm not opposed to\nthat in principle, but I think the single issues should at least be\nlisted in the commit message.\n\n>\n> Signed-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(-)\n>\n> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> index 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\nIt's a bit hard to review them without much context :/\n\n>  \tif (streaming_)\n>  \t\treturn 0;\n>\n> --\n> 2.27.0\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7D414603BF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Jun 2020 17:40:33 +0200 (CEST)","from uno.localdomain (93-34-118-233.ip49.fastwebnet.it\n\t[93.34.118.233]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 03C2120002;\n\tWed, 17 Jun 2020 15:40:32 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","Date":"Wed, 17 Jun 2020 17:43:55 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200617154355.tvz6qyygn4iz5se4@uno.localdomain>","References":"<20200616131244.70308-1-paul.elder@ideasonboard.com>\n\t<20200616131244.70308-16-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200616131244.70308-16-paul.elder@ideasonboard.com>","Subject":"Re: [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":"Wed, 17 Jun 2020 15:40:33 -0000"}}]