[{"id":21351,"web_url":"https://patchwork.libcamera.org/comment/21351/","msgid":"<YaUAXM4UHsyz/QxM@pendragon.ideasonboard.com>","date":"2021-11-29T16:31:24","subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Vedant,\n\nThank you for the patch.\n\nOn Mon, Nov 29, 2021 at 09:43:36PM +0530, Vedant Paranjape wrote:\n> To support DMABUF as one of the memory buffer, we need to implement\n> EXPBUF in the v4l2 compat layer.\n> \n> This patch implements vidioc_expbuf as one of the supported ioctls.\n> \n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=89\n> \n> Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n\nThis looks fine,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nNow we need to get this tested before merging it :-) v4l2-ctl could be\nan option, with (taken from the example in the manpage)\n\nv4l2-ctl --device /dev/video1 --stream-mmap \\\n\t--out-device /dev/video2 --stream-out-dmabuf\n\nusing the vivid output device.\n\n> ---\n>  src/v4l2/v4l2_camera_proxy.cpp | 30 ++++++++++++++++++++++++++++++\n>  src/v4l2/v4l2_camera_proxy.h   |  1 +\n>  2 files changed, 31 insertions(+)\n> \n> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> index 3610e63cade3..f194e06345b7 100644\n> --- a/src/v4l2/v4l2_camera_proxy.cpp\n> +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> @@ -624,6 +624,32 @@ int V4L2CameraProxy::vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n>  \treturn 0;\n>  }\n>  \n> +int V4L2CameraProxy::vidioc_expbuf(V4L2CameraFile *file, struct v4l2_exportbuffer *arg)\n> +{\n> +\tLOG(V4L2Compat, Debug) << \"Servicing vidioc_expbuf fd = \" << file->efd();\n> +\n> +\tif (!hasOwnership(file))\n> +\t\treturn -EBUSY;\n> +\n> +\t/* \\todo Verify that the memory type is MMAP when adding DMABUF support */\n> +\tif (!validateBufferType(arg->type))\n> +\t\treturn -EINVAL;\n> +\n> +\tif (arg->index >= bufferCount_)\n> +\t\treturn -EINVAL;\n> +\n> +\tif (arg->flags & ~(O_CLOEXEC | O_ACCMODE))\n> +\t\treturn -EINVAL;\n> +\n> +\tmemset(arg->reserved, 0, sizeof(arg->reserved));\n> +\n> +\t/* \\todo honor the O_ACCMODE flags passed to this function */\n> +\targ->fd = fcntl(vcam_->getBufferFd(arg->index).fd(),\n> +\t\t\targ->flags & O_CLOEXEC ? F_DUPFD_CLOEXEC : F_DUPFD, 0);\n> +\n> +\treturn 0;\n> +}\n> +\n>  int V4L2CameraProxy::vidioc_streamon(V4L2CameraFile *file, int *arg)\n>  {\n>  \tLOG(V4L2Compat, Debug) << \"Servicing vidioc_streamon fd = \" << file->efd();\n> @@ -685,6 +711,7 @@ const std::set<unsigned long> V4L2CameraProxy::supportedIoctls_ = {\n>  \tVIDIOC_QUERYBUF,\n>  \tVIDIOC_QBUF,\n>  \tVIDIOC_DQBUF,\n> +\tVIDIOC_EXPBUF,\n>  \tVIDIOC_STREAMON,\n>  \tVIDIOC_STREAMOFF,\n>  };\n> @@ -755,6 +782,9 @@ int V4L2CameraProxy::ioctl(V4L2CameraFile *file, unsigned long request, void *ar\n>  \tcase VIDIOC_DQBUF:\n>  \t\tret = vidioc_dqbuf(file, static_cast<struct v4l2_buffer *>(arg), &locker);\n>  \t\tbreak;\n> +\tcase VIDIOC_EXPBUF:\n> +\t\tret = vidioc_expbuf(file, static_cast<struct v4l2_exportbuffer *>(arg));\n> +\t\tbreak;\n>  \tcase VIDIOC_STREAMON:\n>  \t\tret = vidioc_streamon(file, static_cast<int *>(arg));\n>  \t\tbreak;\n> diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h\n> index fccec241879d..81ef7788e9fe 100644\n> --- a/src/v4l2/v4l2_camera_proxy.h\n> +++ b/src/v4l2/v4l2_camera_proxy.h\n> @@ -58,6 +58,7 @@ private:\n>  \tint vidioc_qbuf(V4L2CameraFile *file, struct v4l2_buffer *arg);\n>  \tint vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n>  \t\t\t libcamera::MutexLocker *locker);\n> +\tint vidioc_expbuf(V4L2CameraFile *file, struct v4l2_exportbuffer *arg);\n>  \tint vidioc_streamon(V4L2CameraFile *file, int *arg);\n>  \tint vidioc_streamoff(V4L2CameraFile *file, int *arg);\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 7806ABF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Nov 2021 16:31:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B3F6F605A4;\n\tMon, 29 Nov 2021 17:31:49 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9AF8660592\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Nov 2021 17:31:48 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1521C2A5;\n\tMon, 29 Nov 2021 17:31:48 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"CvwYdFUb\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638203508;\n\tbh=uRcbbFYY/nlwAMSu8e2ECtHSQvfVmKcj2nkdHA9v3Gs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=CvwYdFUbzD8CPfrAjHqBBQg0SbrNbX4CcgY2o2CR85Zee6sG6ghN3dIyDVbkU0D9W\n\tq0DAEBfw9Ca5xnUEMbf8EWMaIpiFsItz7bgSeiNHwAwnBDGKjUSKoBQE3m6iwMwDwp\n\t80E1s2KdPlvbL8w8q5bEAZ6G21caICL5IZ476T0c=","Date":"Mon, 29 Nov 2021 18:31:24 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Message-ID":"<YaUAXM4UHsyz/QxM@pendragon.ideasonboard.com>","References":"<20211129161336.1113408-1-vedantparanjape160201@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211129161336.1113408-1-vedantparanjape160201@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21375,"web_url":"https://patchwork.libcamera.org/comment/21375/","msgid":"<CACGrz-NrDT-=+nS_3f42xX1hTggoK0aDw5URSjO9x3ianUKr_w@mail.gmail.com>","date":"2021-11-29T18:59:45","subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","submitter":{"id":85,"url":"https://patchwork.libcamera.org/api/people/85/","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"content":"Hi Laurent,\n\nOn Mon, Nov 29, 2021 at 10:01 PM Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> Hi Vedant,\n>\n> Thank you for the patch.\n>\n> On Mon, Nov 29, 2021 at 09:43:36PM +0530, Vedant Paranjape wrote:\n> > To support DMABUF as one of the memory buffer, we need to implement\n> > EXPBUF in the v4l2 compat layer.\n> >\n> > This patch implements vidioc_expbuf as one of the supported ioctls.\n> >\n> > Bug: https://bugs.libcamera.org/show_bug.cgi?id=89\n> >\n> > Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n>\n> This looks fine,\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> Now we need to get this tested before merging it :-) v4l2-ctl could be\n> an option, with (taken from the example in the manpage)\n>\n> v4l2-ctl --device /dev/video1 --stream-mmap \\\n>         --out-device /dev/video2 --stream-out-dmabuf\n\nThis should be preceded by LD_PRELOD, right ?\n\n> using the vivid output device.\n>\n> > ---\n> >  src/v4l2/v4l2_camera_proxy.cpp | 30 ++++++++++++++++++++++++++++++\n> >  src/v4l2/v4l2_camera_proxy.h   |  1 +\n> >  2 files changed, 31 insertions(+)\n> >\n> > diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> > index 3610e63cade3..f194e06345b7 100644\n> > --- a/src/v4l2/v4l2_camera_proxy.cpp\n> > +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> > @@ -624,6 +624,32 @@ int V4L2CameraProxy::vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n> >       return 0;\n> >  }\n> >\n> > +int V4L2CameraProxy::vidioc_expbuf(V4L2CameraFile *file, struct v4l2_exportbuffer *arg)\n> > +{\n> > +     LOG(V4L2Compat, Debug) << \"Servicing vidioc_expbuf fd = \" << file->efd();\n> > +\n> > +     if (!hasOwnership(file))\n> > +             return -EBUSY;\n> > +\n> > +     /* \\todo Verify that the memory type is MMAP when adding DMABUF support */\n> > +     if (!validateBufferType(arg->type))\n> > +             return -EINVAL;\n> > +\n> > +     if (arg->index >= bufferCount_)\n> > +             return -EINVAL;\n> > +\n> > +     if (arg->flags & ~(O_CLOEXEC | O_ACCMODE))\n> > +             return -EINVAL;\n> > +\n> > +     memset(arg->reserved, 0, sizeof(arg->reserved));\n> > +\n> > +     /* \\todo honor the O_ACCMODE flags passed to this function */\n> > +     arg->fd = fcntl(vcam_->getBufferFd(arg->index).fd(),\n> > +                     arg->flags & O_CLOEXEC ? F_DUPFD_CLOEXEC : F_DUPFD, 0);\n> > +\n> > +     return 0;\n> > +}\n> > +\n> >  int V4L2CameraProxy::vidioc_streamon(V4L2CameraFile *file, int *arg)\n> >  {\n> >       LOG(V4L2Compat, Debug) << \"Servicing vidioc_streamon fd = \" << file->efd();\n> > @@ -685,6 +711,7 @@ const std::set<unsigned long> V4L2CameraProxy::supportedIoctls_ = {\n> >       VIDIOC_QUERYBUF,\n> >       VIDIOC_QBUF,\n> >       VIDIOC_DQBUF,\n> > +     VIDIOC_EXPBUF,\n> >       VIDIOC_STREAMON,\n> >       VIDIOC_STREAMOFF,\n> >  };\n> > @@ -755,6 +782,9 @@ int V4L2CameraProxy::ioctl(V4L2CameraFile *file, unsigned long request, void *ar\n> >       case VIDIOC_DQBUF:\n> >               ret = vidioc_dqbuf(file, static_cast<struct v4l2_buffer *>(arg), &locker);\n> >               break;\n> > +     case VIDIOC_EXPBUF:\n> > +             ret = vidioc_expbuf(file, static_cast<struct v4l2_exportbuffer *>(arg));\n> > +             break;\n> >       case VIDIOC_STREAMON:\n> >               ret = vidioc_streamon(file, static_cast<int *>(arg));\n> >               break;\n> > diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h\n> > index fccec241879d..81ef7788e9fe 100644\n> > --- a/src/v4l2/v4l2_camera_proxy.h\n> > +++ b/src/v4l2/v4l2_camera_proxy.h\n> > @@ -58,6 +58,7 @@ private:\n> >       int vidioc_qbuf(V4L2CameraFile *file, struct v4l2_buffer *arg);\n> >       int vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n> >                        libcamera::MutexLocker *locker);\n> > +     int vidioc_expbuf(V4L2CameraFile *file, struct v4l2_exportbuffer *arg);\n> >       int vidioc_streamon(V4L2CameraFile *file, int *arg);\n> >       int vidioc_streamoff(V4L2CameraFile *file, int *arg);\n> >\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 16526BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Nov 2021 19:00:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 63BA8605A4;\n\tMon, 29 Nov 2021 19:59:59 +0100 (CET)","from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com\n\t[IPv6:2607:f8b0:4864:20::b2e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7272C60592\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Nov 2021 19:59:58 +0100 (CET)","by mail-yb1-xb2e.google.com with SMTP id v64so45231552ybi.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Nov 2021 10:59:58 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"a1ykr41O\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=m16GQLVYB3c4srE+f11t7UdIkWT+Ot6ELKz0u8aDzOE=;\n\tb=a1ykr41OPYe5Cc328uo+Pj0SQk0oIa5ol3eJeKMENDeNSmhHpt2WsTyFw9zCcqW2e/\n\tZ/Q4mW1XSwQKlyQZFyO+QWlJr8G3fAltF1CGp513iW/1Vy1aA81Ok1YHGE9IgZE4Uj5p\n\tqb5OFwqt+i6K7VgPb4SykJgx6qBBaQfjKfA9TAuoMZ+zVIfwJ7pw8JaG9mDC7LgXh9xH\n\tBH1U9XiHSIRtMzyGa6EuFEdA8yEdPsLzbUZonBMBVz3x4wIbe7ajVvhGBeye4731T6Ny\n\t9Rzy7kcoRo7koXZxVmEcrCKQWgdrnQuj1ZerI49jtQ9T5rh0qGEUyjPh3Qu0C2b0LNl/\n\tPyIQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=m16GQLVYB3c4srE+f11t7UdIkWT+Ot6ELKz0u8aDzOE=;\n\tb=3zQJ5Y4+YWOOc5dzz7qRtcNdSmtLKkPpSEBUGfXB29OzR1vZnPWb9zaH72fySw+V5V\n\tRMd+dTObgAU0YPQXipm09J1P0eZe3mWznsO+PA0amQOXTSh7KH2T+oGwXDY6by7IyEos\n\tSLy4PJR7y5O79z+6JwHQcI/m41ZseSlGizQdxJ/A18IkkIfjJZ6ko1r1uQH8lkiULlti\n\tNjPZoWhloiEiAjRWBrBY/a4ULf/Nj4yTGlNF3R34YerRjbbHpqmQcMbnk/mBfBXPpQpl\n\tZnBeVSpkoLEC2g8QubiBVauxgY1idsMDE7PayZMB18tZ8LLVUq+AGjT6MEX8sCYHLueJ\n\tOUTA==","X-Gm-Message-State":"AOAM532kbV6MP1MOW1UvnAhiERthVoU8iIPS/Z6skJSntYlo6reurRpn\n\tOTABaFrk1W9P4QjHyLyENH3w72mLf5nvJcmHyXfnsUwFV4Y=","X-Google-Smtp-Source":"ABdhPJy7VU0i0cghkO42AlzgDnZY9F3RrtQJED0j9Cud9BLkkWlcigHTWfA7vYi/Nwwj6CYC4nml7wvDz2VSjfvgoz0=","X-Received":"by 2002:a25:26cb:: with SMTP id\n\tm194mr8250673ybm.558.1638212396890; \n\tMon, 29 Nov 2021 10:59:56 -0800 (PST)","MIME-Version":"1.0","References":"<20211129161336.1113408-1-vedantparanjape160201@gmail.com>\n\t<YaUAXM4UHsyz/QxM@pendragon.ideasonboard.com>","In-Reply-To":"<YaUAXM4UHsyz/QxM@pendragon.ideasonboard.com>","From":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Date":"Tue, 30 Nov 2021 00:29:45 +0530","Message-ID":"<CACGrz-NrDT-=+nS_3f42xX1hTggoK0aDw5URSjO9x3ianUKr_w@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","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>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21376,"web_url":"https://patchwork.libcamera.org/comment/21376/","msgid":"<YaUnjpYZaTIR6v65@pendragon.ideasonboard.com>","date":"2021-11-29T19:18:38","subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Vedant,\n\nOn Tue, Nov 30, 2021 at 12:29:45AM +0530, Vedant Paranjape wrote:\n> On Mon, Nov 29, 2021 at 10:01 PM Laurent Pinchart wrote:\n> > On Mon, Nov 29, 2021 at 09:43:36PM +0530, Vedant Paranjape wrote:\n> > > To support DMABUF as one of the memory buffer, we need to implement\n> > > EXPBUF in the v4l2 compat layer.\n> > >\n> > > This patch implements vidioc_expbuf as one of the supported ioctls.\n> > >\n> > > Bug: https://bugs.libcamera.org/show_bug.cgi?id=89\n> > >\n> > > Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n> >\n> > This looks fine,\n> >\n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> >\n> > Now we need to get this tested before merging it :-) v4l2-ctl could be\n> > an option, with (taken from the example in the manpage)\n> >\n> > v4l2-ctl --device /dev/video1 --stream-mmap \\\n> >         --out-device /dev/video2 --stream-out-dmabuf\n> \n> This should be preceded by LD_PRELOD, right ?\n\nOtherwise you wouldn't be testing much, yes :-) You should enable\nlogging and make sure the the \"Servicing vidioc_expbuf\" message is\nprinted during your tests.\n\n> > using the vivid output device.\n> >\n> > > ---\n> > >  src/v4l2/v4l2_camera_proxy.cpp | 30 ++++++++++++++++++++++++++++++\n> > >  src/v4l2/v4l2_camera_proxy.h   |  1 +\n> > >  2 files changed, 31 insertions(+)\n> > >\n> > > diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> > > index 3610e63cade3..f194e06345b7 100644\n> > > --- a/src/v4l2/v4l2_camera_proxy.cpp\n> > > +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> > > @@ -624,6 +624,32 @@ int V4L2CameraProxy::vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n> > >       return 0;\n> > >  }\n> > >\n> > > +int V4L2CameraProxy::vidioc_expbuf(V4L2CameraFile *file, struct v4l2_exportbuffer *arg)\n> > > +{\n> > > +     LOG(V4L2Compat, Debug) << \"Servicing vidioc_expbuf fd = \" << file->efd();\n> > > +\n> > > +     if (!hasOwnership(file))\n> > > +             return -EBUSY;\n> > > +\n> > > +     /* \\todo Verify that the memory type is MMAP when adding DMABUF support */\n> > > +     if (!validateBufferType(arg->type))\n> > > +             return -EINVAL;\n> > > +\n> > > +     if (arg->index >= bufferCount_)\n> > > +             return -EINVAL;\n> > > +\n> > > +     if (arg->flags & ~(O_CLOEXEC | O_ACCMODE))\n> > > +             return -EINVAL;\n> > > +\n> > > +     memset(arg->reserved, 0, sizeof(arg->reserved));\n> > > +\n> > > +     /* \\todo honor the O_ACCMODE flags passed to this function */\n> > > +     arg->fd = fcntl(vcam_->getBufferFd(arg->index).fd(),\n> > > +                     arg->flags & O_CLOEXEC ? F_DUPFD_CLOEXEC : F_DUPFD, 0);\n> > > +\n> > > +     return 0;\n> > > +}\n> > > +\n> > >  int V4L2CameraProxy::vidioc_streamon(V4L2CameraFile *file, int *arg)\n> > >  {\n> > >       LOG(V4L2Compat, Debug) << \"Servicing vidioc_streamon fd = \" << file->efd();\n> > > @@ -685,6 +711,7 @@ const std::set<unsigned long> V4L2CameraProxy::supportedIoctls_ = {\n> > >       VIDIOC_QUERYBUF,\n> > >       VIDIOC_QBUF,\n> > >       VIDIOC_DQBUF,\n> > > +     VIDIOC_EXPBUF,\n> > >       VIDIOC_STREAMON,\n> > >       VIDIOC_STREAMOFF,\n> > >  };\n> > > @@ -755,6 +782,9 @@ int V4L2CameraProxy::ioctl(V4L2CameraFile *file, unsigned long request, void *ar\n> > >       case VIDIOC_DQBUF:\n> > >               ret = vidioc_dqbuf(file, static_cast<struct v4l2_buffer *>(arg), &locker);\n> > >               break;\n> > > +     case VIDIOC_EXPBUF:\n> > > +             ret = vidioc_expbuf(file, static_cast<struct v4l2_exportbuffer *>(arg));\n> > > +             break;\n> > >       case VIDIOC_STREAMON:\n> > >               ret = vidioc_streamon(file, static_cast<int *>(arg));\n> > >               break;\n> > > diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h\n> > > index fccec241879d..81ef7788e9fe 100644\n> > > --- a/src/v4l2/v4l2_camera_proxy.h\n> > > +++ b/src/v4l2/v4l2_camera_proxy.h\n> > > @@ -58,6 +58,7 @@ private:\n> > >       int vidioc_qbuf(V4L2CameraFile *file, struct v4l2_buffer *arg);\n> > >       int vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n> > >                        libcamera::MutexLocker *locker);\n> > > +     int vidioc_expbuf(V4L2CameraFile *file, struct v4l2_exportbuffer *arg);\n> > >       int vidioc_streamon(V4L2CameraFile *file, int *arg);\n> > >       int vidioc_streamoff(V4L2CameraFile *file, int *arg);\n> > >\n> >\n> > --\n> > Regards,\n> >\n> > Laurent Pinchart","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 18125BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Nov 2021 19:19:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 33938605A4;\n\tMon, 29 Nov 2021 20:19:04 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E69D260592\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Nov 2021 20:19:02 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5F98F2A5;\n\tMon, 29 Nov 2021 20:19:02 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"d7xBTEoU\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638213542;\n\tbh=FVDb/4eA/JXwe+zr/IGj9drA4CLOi7EFuBdcnFSuyX0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=d7xBTEoUWwuHCje1/BJP1nDil0uJC1rE8UKlW4ieMyg6M5JrNGg4KhEWkpkl9/fmV\n\t8q70nD3s/ehapF/AOnGJAVWqJ8euYcYX0sgKFMFFlbA8bOkfjeqRmR/8Ku3vEnf7/D\n\tuFgcUmiuz09gJKKVjcXKpmVmrvpqNgnIHt4BX8QA=","Date":"Mon, 29 Nov 2021 21:18:38 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Message-ID":"<YaUnjpYZaTIR6v65@pendragon.ideasonboard.com>","References":"<20211129161336.1113408-1-vedantparanjape160201@gmail.com>\n\t<YaUAXM4UHsyz/QxM@pendragon.ideasonboard.com>\n\t<CACGrz-NrDT-=+nS_3f42xX1hTggoK0aDw5URSjO9x3ianUKr_w@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CACGrz-NrDT-=+nS_3f42xX1hTggoK0aDw5URSjO9x3ianUKr_w@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","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>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21442,"web_url":"https://patchwork.libcamera.org/comment/21442/","msgid":"<20211130104858.GD3297112@pyrite.rasen.tech>","date":"2021-11-30T10:48:58","subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Vedant,\n\nOn Mon, Nov 29, 2021 at 09:43:36PM +0530, Vedant Paranjape wrote:\n> To support DMABUF as one of the memory buffer, we need to implement\n> EXPBUF in the v4l2 compat layer.\n> \n> This patch implements vidioc_expbuf as one of the supported ioctls.\n> \n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=89\n> \n> Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/v4l2/v4l2_camera_proxy.cpp | 30 ++++++++++++++++++++++++++++++\n>  src/v4l2/v4l2_camera_proxy.h   |  1 +\n>  2 files changed, 31 insertions(+)\n> \n> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> index 3610e63cade3..f194e06345b7 100644\n> --- a/src/v4l2/v4l2_camera_proxy.cpp\n> +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> @@ -624,6 +624,32 @@ int V4L2CameraProxy::vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n>  \treturn 0;\n>  }\n>  \n> +int V4L2CameraProxy::vidioc_expbuf(V4L2CameraFile *file, struct v4l2_exportbuffer *arg)\n> +{\n> +\tLOG(V4L2Compat, Debug) << \"Servicing vidioc_expbuf fd = \" << file->efd();\n> +\n> +\tif (!hasOwnership(file))\n> +\t\treturn -EBUSY;\n> +\n> +\t/* \\todo Verify that the memory type is MMAP when adding DMABUF support */\n> +\tif (!validateBufferType(arg->type))\n> +\t\treturn -EINVAL;\n> +\n> +\tif (arg->index >= bufferCount_)\n> +\t\treturn -EINVAL;\n> +\n> +\tif (arg->flags & ~(O_CLOEXEC | O_ACCMODE))\n> +\t\treturn -EINVAL;\n> +\n> +\tmemset(arg->reserved, 0, sizeof(arg->reserved));\n> +\n> +\t/* \\todo honor the O_ACCMODE flags passed to this function */\n> +\targ->fd = fcntl(vcam_->getBufferFd(arg->index).fd(),\n> +\t\t\targ->flags & O_CLOEXEC ? F_DUPFD_CLOEXEC : F_DUPFD, 0);\n> +\n> +\treturn 0;\n> +}\n> +\n>  int V4L2CameraProxy::vidioc_streamon(V4L2CameraFile *file, int *arg)\n>  {\n>  \tLOG(V4L2Compat, Debug) << \"Servicing vidioc_streamon fd = \" << file->efd();\n> @@ -685,6 +711,7 @@ const std::set<unsigned long> V4L2CameraProxy::supportedIoctls_ = {\n>  \tVIDIOC_QUERYBUF,\n>  \tVIDIOC_QBUF,\n>  \tVIDIOC_DQBUF,\n> +\tVIDIOC_EXPBUF,\n>  \tVIDIOC_STREAMON,\n>  \tVIDIOC_STREAMOFF,\n>  };\n> @@ -755,6 +782,9 @@ int V4L2CameraProxy::ioctl(V4L2CameraFile *file, unsigned long request, void *ar\n>  \tcase VIDIOC_DQBUF:\n>  \t\tret = vidioc_dqbuf(file, static_cast<struct v4l2_buffer *>(arg), &locker);\n>  \t\tbreak;\n> +\tcase VIDIOC_EXPBUF:\n> +\t\tret = vidioc_expbuf(file, static_cast<struct v4l2_exportbuffer *>(arg));\n> +\t\tbreak;\n>  \tcase VIDIOC_STREAMON:\n>  \t\tret = vidioc_streamon(file, static_cast<int *>(arg));\n>  \t\tbreak;\n> diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h\n> index fccec241879d..81ef7788e9fe 100644\n> --- a/src/v4l2/v4l2_camera_proxy.h\n> +++ b/src/v4l2/v4l2_camera_proxy.h\n> @@ -58,6 +58,7 @@ private:\n>  \tint vidioc_qbuf(V4L2CameraFile *file, struct v4l2_buffer *arg);\n>  \tint vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n>  \t\t\t libcamera::MutexLocker *locker);\n> +\tint vidioc_expbuf(V4L2CameraFile *file, struct v4l2_exportbuffer *arg);\n>  \tint vidioc_streamon(V4L2CameraFile *file, int *arg);\n>  \tint vidioc_streamoff(V4L2CameraFile *file, int *arg);\n>  \n> -- \n> 2.25.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 117D1BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Nov 2021 10:49:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4AC30605B4;\n\tTue, 30 Nov 2021 11:49:08 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0C01060230\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 11:49:07 +0100 (CET)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7A9FD2FD;\n\tTue, 30 Nov 2021 11:49:05 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"VhIADTSa\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638269346;\n\tbh=86NQImroa0vtwXV08Uc3CxTX68RM/KhZzoIKZhz8at4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=VhIADTSaKmNzwF1srZ4aKIrU8UOixg1E8H5xsenNrAJAnMM/h87ExkCKPHoPlF3e/\n\tXiH4a4KtLsYA17tXT+bV3LFm3NePdqyq8+zBjlTl4jc+RQcRdWebCltAKoHU6VpKvG\n\tRq3nvM0y/ODLicIKAOI9aKIc1/lD6PlrLSvyksvk=","Date":"Tue, 30 Nov 2021 19:48:58 +0900","From":"paul.elder@ideasonboard.com","To":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Message-ID":"<20211130104858.GD3297112@pyrite.rasen.tech>","References":"<20211129161336.1113408-1-vedantparanjape160201@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20211129161336.1113408-1-vedantparanjape160201@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21608,"web_url":"https://patchwork.libcamera.org/comment/21608/","msgid":"<Ya4DdQJVarm3Zvdw@pendragon.ideasonboard.com>","date":"2021-12-06T12:35:01","subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Vedant,\n\nOn Mon, Nov 29, 2021 at 09:18:38PM +0200, Laurent Pinchart wrote:\n> On Tue, Nov 30, 2021 at 12:29:45AM +0530, Vedant Paranjape wrote:\n> > On Mon, Nov 29, 2021 at 10:01 PM Laurent Pinchart wrote:\n> > > On Mon, Nov 29, 2021 at 09:43:36PM +0530, Vedant Paranjape wrote:\n> > > > To support DMABUF as one of the memory buffer, we need to implement\n> > > > EXPBUF in the v4l2 compat layer.\n> > > >\n> > > > This patch implements vidioc_expbuf as one of the supported ioctls.\n> > > >\n> > > > Bug: https://bugs.libcamera.org/show_bug.cgi?id=89\n> > > >\n> > > > Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n> > >\n> > > This looks fine,\n> > >\n> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > >\n> > > Now we need to get this tested before merging it :-) v4l2-ctl could be\n> > > an option, with (taken from the example in the manpage)\n> > >\n> > > v4l2-ctl --device /dev/video1 --stream-mmap \\\n> > >         --out-device /dev/video2 --stream-out-dmabuf\n> > \n> > This should be preceded by LD_PRELOD, right ?\n> \n> Otherwise you wouldn't be testing much, yes :-) You should enable\n> logging and make sure the the \"Servicing vidioc_expbuf\" message is\n> printed during your tests.\n\nHave you been able to test this patch successfully (with enough\nconfidence that the test case actually exercises the EXPBUF code path) ?\n\n> > > using the vivid output device.\n> > >\n> > > > ---\n> > > >  src/v4l2/v4l2_camera_proxy.cpp | 30 ++++++++++++++++++++++++++++++\n> > > >  src/v4l2/v4l2_camera_proxy.h   |  1 +\n> > > >  2 files changed, 31 insertions(+)\n> > > >\n> > > > diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> > > > index 3610e63cade3..f194e06345b7 100644\n> > > > --- a/src/v4l2/v4l2_camera_proxy.cpp\n> > > > +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> > > > @@ -624,6 +624,32 @@ int V4L2CameraProxy::vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n> > > >       return 0;\n> > > >  }\n> > > >\n> > > > +int V4L2CameraProxy::vidioc_expbuf(V4L2CameraFile *file, struct v4l2_exportbuffer *arg)\n> > > > +{\n> > > > +     LOG(V4L2Compat, Debug) << \"Servicing vidioc_expbuf fd = \" << file->efd();\n> > > > +\n> > > > +     if (!hasOwnership(file))\n> > > > +             return -EBUSY;\n> > > > +\n> > > > +     /* \\todo Verify that the memory type is MMAP when adding DMABUF support */\n> > > > +     if (!validateBufferType(arg->type))\n> > > > +             return -EINVAL;\n> > > > +\n> > > > +     if (arg->index >= bufferCount_)\n> > > > +             return -EINVAL;\n> > > > +\n> > > > +     if (arg->flags & ~(O_CLOEXEC | O_ACCMODE))\n> > > > +             return -EINVAL;\n> > > > +\n> > > > +     memset(arg->reserved, 0, sizeof(arg->reserved));\n> > > > +\n> > > > +     /* \\todo honor the O_ACCMODE flags passed to this function */\n> > > > +     arg->fd = fcntl(vcam_->getBufferFd(arg->index).fd(),\n> > > > +                     arg->flags & O_CLOEXEC ? F_DUPFD_CLOEXEC : F_DUPFD, 0);\n> > > > +\n> > > > +     return 0;\n> > > > +}\n> > > > +\n> > > >  int V4L2CameraProxy::vidioc_streamon(V4L2CameraFile *file, int *arg)\n> > > >  {\n> > > >       LOG(V4L2Compat, Debug) << \"Servicing vidioc_streamon fd = \" << file->efd();\n> > > > @@ -685,6 +711,7 @@ const std::set<unsigned long> V4L2CameraProxy::supportedIoctls_ = {\n> > > >       VIDIOC_QUERYBUF,\n> > > >       VIDIOC_QBUF,\n> > > >       VIDIOC_DQBUF,\n> > > > +     VIDIOC_EXPBUF,\n> > > >       VIDIOC_STREAMON,\n> > > >       VIDIOC_STREAMOFF,\n> > > >  };\n> > > > @@ -755,6 +782,9 @@ int V4L2CameraProxy::ioctl(V4L2CameraFile *file, unsigned long request, void *ar\n> > > >       case VIDIOC_DQBUF:\n> > > >               ret = vidioc_dqbuf(file, static_cast<struct v4l2_buffer *>(arg), &locker);\n> > > >               break;\n> > > > +     case VIDIOC_EXPBUF:\n> > > > +             ret = vidioc_expbuf(file, static_cast<struct v4l2_exportbuffer *>(arg));\n> > > > +             break;\n> > > >       case VIDIOC_STREAMON:\n> > > >               ret = vidioc_streamon(file, static_cast<int *>(arg));\n> > > >               break;\n> > > > diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h\n> > > > index fccec241879d..81ef7788e9fe 100644\n> > > > --- a/src/v4l2/v4l2_camera_proxy.h\n> > > > +++ b/src/v4l2/v4l2_camera_proxy.h\n> > > > @@ -58,6 +58,7 @@ private:\n> > > >       int vidioc_qbuf(V4L2CameraFile *file, struct v4l2_buffer *arg);\n> > > >       int vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n> > > >                        libcamera::MutexLocker *locker);\n> > > > +     int vidioc_expbuf(V4L2CameraFile *file, struct v4l2_exportbuffer *arg);\n> > > >       int vidioc_streamon(V4L2CameraFile *file, int *arg);\n> > > >       int vidioc_streamoff(V4L2CameraFile *file, int *arg);\n> > > >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6183ABDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Dec 2021 12:35:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B6579607DE;\n\tMon,  6 Dec 2021 13:35:30 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6EB2C60725\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Dec 2021 13:35:29 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E1643EE;\n\tMon,  6 Dec 2021 13:35:28 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"esztOICH\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638794129;\n\tbh=tej6XJaqWZi97pLP66MpIrtQkFSm5qCOcZDP4lYsjes=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=esztOICHuvSwALb+qo68oioN+JGPd+zyW0+9B8JuepxCaMo9h5uz9luF8ESiRJrDO\n\tHWL6J3j5ra3roEtewSmNbWhCikvWqZVYCOllgx8w7WeJjkOQCyZmVXig4/IjlfXaMC\n\tmv+Yu0DRH1uoSDscNvZPwGe/CojYB9dwFxfETgAY=","Date":"Mon, 6 Dec 2021 14:35:01 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Message-ID":"<Ya4DdQJVarm3Zvdw@pendragon.ideasonboard.com>","References":"<20211129161336.1113408-1-vedantparanjape160201@gmail.com>\n\t<YaUAXM4UHsyz/QxM@pendragon.ideasonboard.com>\n\t<CACGrz-NrDT-=+nS_3f42xX1hTggoK0aDw5URSjO9x3ianUKr_w@mail.gmail.com>\n\t<YaUnjpYZaTIR6v65@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<YaUnjpYZaTIR6v65@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","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>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21622,"web_url":"https://patchwork.libcamera.org/comment/21622/","msgid":"<CACGrz-OxB5ct=PSBWfVMbuxnCq4Wjr3MsAyOLuDKQ9d8SpaR2Q@mail.gmail.com>","date":"2021-12-07T02:58:43","subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","submitter":{"id":85,"url":"https://patchwork.libcamera.org/api/people/85/","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"content":"Hello Laurent,\nSorry for the delay, I've had a busy week, and will check it's working this\nweek and report back.\n\nRegards,\nVedant Paranjape\n\nOn Mon, 6 Dec, 2021, 18:05 Laurent Pinchart, <\nlaurent.pinchart@ideasonboard.com> wrote:\n\n> Hi Vedant,\n>\n> On Mon, Nov 29, 2021 at 09:18:38PM +0200, Laurent Pinchart wrote:\n> > On Tue, Nov 30, 2021 at 12:29:45AM +0530, Vedant Paranjape wrote:\n> > > On Mon, Nov 29, 2021 at 10:01 PM Laurent Pinchart wrote:\n> > > > On Mon, Nov 29, 2021 at 09:43:36PM +0530, Vedant Paranjape wrote:\n> > > > > To support DMABUF as one of the memory buffer, we need to implement\n> > > > > EXPBUF in the v4l2 compat layer.\n> > > > >\n> > > > > This patch implements vidioc_expbuf as one of the supported ioctls.\n> > > > >\n> > > > > Bug: https://bugs.libcamera.org/show_bug.cgi?id=89\n> > > > >\n> > > > > Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n> > > >\n> > > > This looks fine,\n> > > >\n> > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > >\n> > > > Now we need to get this tested before merging it :-) v4l2-ctl could\n> be\n> > > > an option, with (taken from the example in the manpage)\n> > > >\n> > > > v4l2-ctl --device /dev/video1 --stream-mmap \\\n> > > >         --out-device /dev/video2 --stream-out-dmabuf\n> > >\n> > > This should be preceded by LD_PRELOD, right ?\n> >\n> > Otherwise you wouldn't be testing much, yes :-) You should enable\n> > logging and make sure the the \"Servicing vidioc_expbuf\" message is\n> > printed during your tests.\n>\n> Have you been able to test this patch successfully (with enough\n> confidence that the test case actually exercises the EXPBUF code path) ?\n>\n> > > > using the vivid output device.\n> > > >\n> > > > > ---\n> > > > >  src/v4l2/v4l2_camera_proxy.cpp | 30 ++++++++++++++++++++++++++++++\n> > > > >  src/v4l2/v4l2_camera_proxy.h   |  1 +\n> > > > >  2 files changed, 31 insertions(+)\n> > > > >\n> > > > > diff --git a/src/v4l2/v4l2_camera_proxy.cpp\n> b/src/v4l2/v4l2_camera_proxy.cpp\n> > > > > index 3610e63cade3..f194e06345b7 100644\n> > > > > --- a/src/v4l2/v4l2_camera_proxy.cpp\n> > > > > +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> > > > > @@ -624,6 +624,32 @@ int\n> V4L2CameraProxy::vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n> > > > >       return 0;\n> > > > >  }\n> > > > >\n> > > > > +int V4L2CameraProxy::vidioc_expbuf(V4L2CameraFile *file, struct\n> v4l2_exportbuffer *arg)\n> > > > > +{\n> > > > > +     LOG(V4L2Compat, Debug) << \"Servicing vidioc_expbuf fd = \" <<\n> file->efd();\n> > > > > +\n> > > > > +     if (!hasOwnership(file))\n> > > > > +             return -EBUSY;\n> > > > > +\n> > > > > +     /* \\todo Verify that the memory type is MMAP when adding\n> DMABUF support */\n> > > > > +     if (!validateBufferType(arg->type))\n> > > > > +             return -EINVAL;\n> > > > > +\n> > > > > +     if (arg->index >= bufferCount_)\n> > > > > +             return -EINVAL;\n> > > > > +\n> > > > > +     if (arg->flags & ~(O_CLOEXEC | O_ACCMODE))\n> > > > > +             return -EINVAL;\n> > > > > +\n> > > > > +     memset(arg->reserved, 0, sizeof(arg->reserved));\n> > > > > +\n> > > > > +     /* \\todo honor the O_ACCMODE flags passed to this function */\n> > > > > +     arg->fd = fcntl(vcam_->getBufferFd(arg->index).fd(),\n> > > > > +                     arg->flags & O_CLOEXEC ? F_DUPFD_CLOEXEC :\n> F_DUPFD, 0);\n> > > > > +\n> > > > > +     return 0;\n> > > > > +}\n> > > > > +\n> > > > >  int V4L2CameraProxy::vidioc_streamon(V4L2CameraFile *file, int\n> *arg)\n> > > > >  {\n> > > > >       LOG(V4L2Compat, Debug) << \"Servicing vidioc_streamon fd = \"\n> << file->efd();\n> > > > > @@ -685,6 +711,7 @@ const std::set<unsigned long>\n> V4L2CameraProxy::supportedIoctls_ = {\n> > > > >       VIDIOC_QUERYBUF,\n> > > > >       VIDIOC_QBUF,\n> > > > >       VIDIOC_DQBUF,\n> > > > > +     VIDIOC_EXPBUF,\n> > > > >       VIDIOC_STREAMON,\n> > > > >       VIDIOC_STREAMOFF,\n> > > > >  };\n> > > > > @@ -755,6 +782,9 @@ int V4L2CameraProxy::ioctl(V4L2CameraFile\n> *file, unsigned long request, void *ar\n> > > > >       case VIDIOC_DQBUF:\n> > > > >               ret = vidioc_dqbuf(file, static_cast<struct\n> v4l2_buffer *>(arg), &locker);\n> > > > >               break;\n> > > > > +     case VIDIOC_EXPBUF:\n> > > > > +             ret = vidioc_expbuf(file, static_cast<struct\n> v4l2_exportbuffer *>(arg));\n> > > > > +             break;\n> > > > >       case VIDIOC_STREAMON:\n> > > > >               ret = vidioc_streamon(file, static_cast<int *>(arg));\n> > > > >               break;\n> > > > > diff --git a/src/v4l2/v4l2_camera_proxy.h\n> b/src/v4l2/v4l2_camera_proxy.h\n> > > > > index fccec241879d..81ef7788e9fe 100644\n> > > > > --- a/src/v4l2/v4l2_camera_proxy.h\n> > > > > +++ b/src/v4l2/v4l2_camera_proxy.h\n> > > > > @@ -58,6 +58,7 @@ private:\n> > > > >       int vidioc_qbuf(V4L2CameraFile *file, struct v4l2_buffer\n> *arg);\n> > > > >       int vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer\n> *arg,\n> > > > >                        libcamera::MutexLocker *locker);\n> > > > > +     int vidioc_expbuf(V4L2CameraFile *file, struct\n> v4l2_exportbuffer *arg);\n> > > > >       int vidioc_streamon(V4L2CameraFile *file, int *arg);\n> > > > >       int vidioc_streamoff(V4L2CameraFile *file, int *arg);\n> > > > >\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A169FBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Dec 2021 02:58:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B426860822;\n\tTue,  7 Dec 2021 03:58:57 +0100 (CET)","from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com\n\t[IPv6:2607:f8b0:4864:20::b2f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1C04D60116\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Dec 2021 03:58:56 +0100 (CET)","by mail-yb1-xb2f.google.com with SMTP id 131so36899843ybc.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 06 Dec 2021 18:58:56 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"L9qxXI9i\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=GUhj1XQtE7D3xDg9FFxTPswnaYOVjMxogBZKYI81AaU=;\n\tb=L9qxXI9iIw6QMDajzR8Ln9u53/gz2s/JLdrk0baCM/ed6Al/PJjdDfwIQto3Hl9Doq\n\tpkEAuaEn4y1u1ALk+anV8NQ40wjWUqWWYyj2XQNSR4VLDfZzDl4LD0VrFMb+igE4cE5d\n\tQdQEqJxNC5EkGtYeeFBKTnZIJcIwqkcPxluG9XMjVUfroWPstBaD7kTon+3bX7JD4DiR\n\tVmvDhw0cWj1TK3hukVmsaFk3UwTkP0Bel8uohJneHOWO8ySnRdbhE5R2rymMclKK5T/I\n\tKy5GF6T0TwzHIFKGxiVfQg/7ka40x7gVLppJIwXaawJcrriP4AlDBQ7MSAL/Otv8WG5u\n\t1JYg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=GUhj1XQtE7D3xDg9FFxTPswnaYOVjMxogBZKYI81AaU=;\n\tb=JzPn071vmr4V7xj25gzCr1hKIwE5SrudxEqcYf95cVr8l+RNqFZKyppWTnpyajs8rC\n\tWSOFUsT21YecEmBtojk+t1b2Uxl52+LqhbH+cxk+hBWaWfh9XKcy0PtUfxTdM1ScPhWz\n\tuCf8iEg3+uQuUvafcd5ZlG+kmXCir2U7nC/ujiGMRtmBmzLjU76ViffOTLa8A2yx7GeM\n\torGu4XGDO2DwoN9vmE4Q7kE35InwwFsqk2VYoKDeyqU+ZzvhvBP8SyHOOcwDv70IRcU9\n\t/O9rQF/c8X+ubjqFF1Wg3QMan3cn/NevECievYcDf+3bTp9/ERPEojNrc6eDQ+DRqhuI\n\tWJlA==","X-Gm-Message-State":"AOAM533rM6rPsfJFr5gW7e5q7H9Oqr8rsYAVLkFLAenSYznBJVm8PU6y\n\tRrw3uIfMj1Pufd8Taq8aPqJOnI7lj7PspxpVV3w=","X-Google-Smtp-Source":"ABdhPJzOf5IiyKYmnZqGFMQDifMdeld0j0KX1h0NGawC3UbTwH1pOLTZLUyrvweGssexef06/kiBEkMAtT7kfTFGwaI=","X-Received":"by 2002:a25:42d7:: with SMTP id\n\tp206mr48305824yba.765.1638845934719; \n\tMon, 06 Dec 2021 18:58:54 -0800 (PST)","MIME-Version":"1.0","References":"<20211129161336.1113408-1-vedantparanjape160201@gmail.com>\n\t<YaUAXM4UHsyz/QxM@pendragon.ideasonboard.com>\n\t<CACGrz-NrDT-=+nS_3f42xX1hTggoK0aDw5URSjO9x3ianUKr_w@mail.gmail.com>\n\t<YaUnjpYZaTIR6v65@pendragon.ideasonboard.com>\n\t<Ya4DdQJVarm3Zvdw@pendragon.ideasonboard.com>","In-Reply-To":"<Ya4DdQJVarm3Zvdw@pendragon.ideasonboard.com>","From":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Date":"Tue, 7 Dec 2021 08:28:43 +0530","Message-ID":"<CACGrz-OxB5ct=PSBWfVMbuxnCq4Wjr3MsAyOLuDKQ9d8SpaR2Q@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"000000000000c7d84405d2858d42\"","Subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","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>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21894,"web_url":"https://patchwork.libcamera.org/comment/21894/","msgid":"<CACGrz-PQTWQ+wQdpjP3r6mf6KYT=-O3csKTro2g3_NH1KQe43w@mail.gmail.com>","date":"2021-12-28T17:57:01","subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","submitter":{"id":85,"url":"https://patchwork.libcamera.org/api/people/85/","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"content":"Hello Laurent,\nI have been able to test the patch. The steps I have followed:\n\n1) clone this repo: https://git.libcamera.org/libcamera/vivid.git\n2) Apply the patch in the trailing email, there's a small conflict\nwhile doing so in v4l2_camera_proxy.h (as the patch was sent some time\nback, probably needs to be rebased)\n3) meson build\n4) ninja -C build\n5) sudo modprobe vivid\n6) export LIBCAMERA_LOG_LEVELS='V4L2Compat:0'\n7) run the following command:\n        LD_PRELOAD=build/src/v4l2/v4l2-compat.so v4l2-ctl --device\n/dev/video0 --stream-mmap --out-device /dev/video3 --stream-out-dmabuf\n\nI have attached the output of lsv4l2 here as well:\n\nvideo0: HD WebCam: HD WebCam\nvideo1: HD WebCam: HD WebCam\nvideo2: vivid-000-vid-cap\nvideo3: vivid-000-vid-out\n\nHere's the terminal log that I got: https://paste.debian.net/1225055/\n\nRegards,\nVedant Paranjape","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 07B84BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Dec 2021 17:57:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 35386608EB;\n\tTue, 28 Dec 2021 18:57:16 +0100 (CET)","from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com\n\t[IPv6:2607:f8b0:4864:20::b36])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B6D4660868\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Dec 2021 18:57:14 +0100 (CET)","by mail-yb1-xb36.google.com with SMTP id d201so32127853ybc.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Dec 2021 09:57:14 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"grQ3I26b\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=bzk/CLkhepsEnE9Ady7Z2ky2piPiGWbwj2Xo3t/n92s=;\n\tb=grQ3I26bDa5keASW+NPPLKG65L/X4bQkyGA8AX12pRNCCVtN1VYJMFY1QsJ1T0Rj+V\n\tdS78DoiSLzesXKIapC3KrxbIuOV3hG+C83JAIS3+kL8gPrzDuTN9MCOwOE2fJlHw4Kto\n\tN0WnYRJDZKGyJ959NGrj9T6yA60Q0CI7VGbPr44vjV+BtBTLiYZq/3iW6ctBk/TKF53H\n\tcPIrpUaUScKgpL1Z3tglXtpkuxcoPOqb7a8HMFkjjcEKNg4WV+qwnBG+Sj5NVUWWqpon\n\txfnzR6yqNQOcaseuVOr2qkVgxJzK8eOwA81m5D5zHdXAWlnW6HcGnt749M4GG76+qlTd\n\t+NvQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=bzk/CLkhepsEnE9Ady7Z2ky2piPiGWbwj2Xo3t/n92s=;\n\tb=pcTiuQcNCvU5ecg81t+OQ23IAILv9A6A0c5EF57jnsvpJem9PYczY/eaCblAq1COel\n\tTAqYzv+SjOVklkIx+X+pQl8d7L4Bp9y5jlMgrJkYvwyKevBD90qol1y2DXz6t08osvSa\n\twoO1I3S7nkx/8FoiDHmgCMjrC1PQ6dMNTySq6uSoIOydIhKhDv7hMCkVECUdZrtXhON0\n\tyUp3vkeWmJY+8P4nNTRZWkOxDUn9ss4J54AAEiECdAviRCxSfC7BbzURvnKU7NBy7FAA\n\t/lW/B6mT8XxpPHIS6u7Cow+QyUPnB5sf6et8LVEvtGKRPhTW7AYpC5HbEj3qOrPkgM3z\n\tnHkw==","X-Gm-Message-State":"AOAM5307eTSbka9bALRHkI15Ykzm7kKNNPWpezywFzpgcb7yAl/atA/Z\n\tvEstiTRi9MSOJp37/hfqti8u5cKXjEtv0+gcqmY0iaD1Dfo=","X-Google-Smtp-Source":"ABdhPJwkI37c+X8sUJ9H4pcMgp/xhwWOlPDjJh5Hd4rcRoWWePQre2U17nrGN0s+A/9uXhAUgkxBl62d0qXheDNdDfg=","X-Received":"by 2002:a25:4e56:: with SMTP id\n\tc83mr8884762ybb.196.1640714233335; \n\tTue, 28 Dec 2021 09:57:13 -0800 (PST)","MIME-Version":"1.0","References":"<20211129161336.1113408-1-vedantparanjape160201@gmail.com>\n\t<YaUAXM4UHsyz/QxM@pendragon.ideasonboard.com>\n\t<CACGrz-NrDT-=+nS_3f42xX1hTggoK0aDw5URSjO9x3ianUKr_w@mail.gmail.com>\n\t<YaUnjpYZaTIR6v65@pendragon.ideasonboard.com>\n\t<Ya4DdQJVarm3Zvdw@pendragon.ideasonboard.com>\n\t<CACGrz-OxB5ct=PSBWfVMbuxnCq4Wjr3MsAyOLuDKQ9d8SpaR2Q@mail.gmail.com>","In-Reply-To":"<CACGrz-OxB5ct=PSBWfVMbuxnCq4Wjr3MsAyOLuDKQ9d8SpaR2Q@mail.gmail.com>","From":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Date":"Tue, 28 Dec 2021 23:27:01 +0530","Message-ID":"<CACGrz-PQTWQ+wQdpjP3r6mf6KYT=-O3csKTro2g3_NH1KQe43w@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","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>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21896,"web_url":"https://patchwork.libcamera.org/comment/21896/","msgid":"<YcuJxO2yPOUEgHzl@pendragon.ideasonboard.com>","date":"2021-12-28T22:03:48","subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Vedant,\n\nOn Tue, Dec 28, 2021 at 11:27:01PM +0530, Vedant Paranjape wrote:\n> Hello Laurent,\n> I have been able to test the patch. The steps I have followed:\n> \n> 1) clone this repo: https://git.libcamera.org/libcamera/vivid.git\n> 2) Apply the patch in the trailing email, there's a small conflict\n> while doing so in v4l2_camera_proxy.h (as the patch was sent some time\n> back, probably needs to be rebased)\n> 3) meson build\n> 4) ninja -C build\n> 5) sudo modprobe vivid\n> 6) export LIBCAMERA_LOG_LEVELS='V4L2Compat:0'\n> 7) run the following command:\n>         LD_PRELOAD=build/src/v4l2/v4l2-compat.so v4l2-ctl --device\n> /dev/video0 --stream-mmap --out-device /dev/video3 --stream-out-dmabuf\n> \n> I have attached the output of lsv4l2 here as well:\n> \n> video0: HD WebCam: HD WebCam\n> video1: HD WebCam: HD WebCam\n> video2: vivid-000-vid-cap\n> video3: vivid-000-vid-out\n> \n> Here's the terminal log that I got: https://paste.debian.net/1225055/\n\nThe command doesn't seem to capture any frame :-(","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3EF3EBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Dec 2021 22:03:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A159C6090D;\n\tTue, 28 Dec 2021 23:03:53 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 390AB60868\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Dec 2021 23:03:52 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A4EF43E7;\n\tTue, 28 Dec 2021 23:03:51 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ed3XnzGo\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1640729031;\n\tbh=txlngJrcphRJAOhmihjECyz7/Nw1BNappTYiU4fwWgo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ed3XnzGo3koVoZ4Y5BlUgXjQP9wk/XSmZfBVTUA+Pid5vnarfFKPGVof3GDgK7yrp\n\tjTXVtGSwLdc8J7VquROHDaa/SA0KJcOrEDIfZAVVxrVg8kYztIA+Ae9oJcWYyI4I+0\n\tBX+2cSetIGBfxtLspR1Cac78+t9W9ovn1CV9wvgk=","Date":"Wed, 29 Dec 2021 00:03:48 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Message-ID":"<YcuJxO2yPOUEgHzl@pendragon.ideasonboard.com>","References":"<20211129161336.1113408-1-vedantparanjape160201@gmail.com>\n\t<YaUAXM4UHsyz/QxM@pendragon.ideasonboard.com>\n\t<CACGrz-NrDT-=+nS_3f42xX1hTggoK0aDw5URSjO9x3ianUKr_w@mail.gmail.com>\n\t<YaUnjpYZaTIR6v65@pendragon.ideasonboard.com>\n\t<Ya4DdQJVarm3Zvdw@pendragon.ideasonboard.com>\n\t<CACGrz-OxB5ct=PSBWfVMbuxnCq4Wjr3MsAyOLuDKQ9d8SpaR2Q@mail.gmail.com>\n\t<CACGrz-PQTWQ+wQdpjP3r6mf6KYT=-O3csKTro2g3_NH1KQe43w@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CACGrz-PQTWQ+wQdpjP3r6mf6KYT=-O3csKTro2g3_NH1KQe43w@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v3] v4l2: V4L2CameraProxy: Add EXPBUF\n\tas one of the supported ioctl","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>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]