[{"id":5358,"web_url":"https://patchwork.libcamera.org/comment/5358/","msgid":"<20200623222540.GH5870@pendragon.ideasonboard.com>","date":"2020-06-23T22:25:40","subject":"Re: [libcamera-devel] [PATCH v3 04/22] v4l2: v4l2_camera_proxy:\n\tFree old buffers on reqbufs > 0","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Paul,\n\nThank you for the patch.\n\nOn Wed, Jun 24, 2020 at 04:08:18AM +0900, Paul Elder wrote:\n> Free buffers if any were previously allocated, at VIDIOC_REQBUFS with\n\ns/buffers/buffers,/ ?\n\n> count > 0.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> \n> ---\n> New in v3\n> - split from... a conglomerate of v4l2-compliance fixes patch\n> ---\n>  src/v4l2/v4l2_camera_proxy.cpp | 9 +++++++++\n>  1 file changed, 9 insertions(+)\n> \n> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> index eb59d49..7262453 100644\n> --- a/src/v4l2/v4l2_camera_proxy.cpp\n> +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> @@ -361,6 +361,15 @@ int V4L2CameraProxy::vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuf\n>  \t\treturn freeBuffers();\n>  \t}\n>  \n> +\tif (bufferCount_ > 0) {\n> +\t\tint ret = freeBuffers();\n> +\t\tif (ret < 0) {\n> +\t\t\tLOG(V4L2Compat, Error)\n> +\t\t\t\t<< \"Failed to free libcamera buffers for re-reqbufs\";\n\n\t\t\trelease(file);\n\n?\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\t\t\treturn ret;\n> +\t\t}\n> +\t}\n> +\n>  \tSize size(curV4L2Format_.fmt.pix.width, curV4L2Format_.fmt.pix.height);\n>  \tret = vcam_->configure(&streamConfig_, size,\n>  \t\t\t       v4l2ToDrm(curV4L2Format_.fmt.pix.pixelformat),","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 DBDB4603B9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Jun 2020 00:26:06 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6191F2A9;\n\tWed, 24 Jun 2020 00:26:06 +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=\"IFErARfu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1592951166;\n\tbh=9oB/zPspvr5De0e4HyCptWs2HwHx9T+0GUi6lNLz8uQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=IFErARfuazBnRKQyT3w7mtfMSjndhrYgMUFi0ESjK1Oz8YBgnI5OJt0URv4Ebi5I9\n\t86HtvfYQNkUkjwGXaUmrZVseVFFH5jq1vBWmvWXGMwo07VdaKoKTV1xfCGOg5YC1DF\n\tFMNOZ7r8inRJ6JlOCQpp8H7K7zcs/KAOA64laQwo=","Date":"Wed, 24 Jun 2020 01:25:40 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200623222540.GH5870@pendragon.ideasonboard.com>","References":"<20200623190836.53446-1-paul.elder@ideasonboard.com>\n\t<20200623190836.53446-5-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200623190836.53446-5-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3 04/22] v4l2: v4l2_camera_proxy:\n\tFree old buffers on reqbufs > 0","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, 23 Jun 2020 22:26:07 -0000"}},{"id":5359,"web_url":"https://patchwork.libcamera.org/comment/5359/","msgid":"<20200623222638.GI5870@pendragon.ideasonboard.com>","date":"2020-06-23T22:26:38","subject":"Re: [libcamera-devel] [PATCH v3 04/22] v4l2: v4l2_camera_proxy:\n\tFree old buffers on reqbufs > 0","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Jun 24, 2020 at 01:25:41AM +0300, Laurent Pinchart wrote:\n> Hi Paul,\n> \n> Thank you for the patch.\n> \n> On Wed, Jun 24, 2020 at 04:08:18AM +0900, Paul Elder wrote:\n> > Free buffers if any were previously allocated, at VIDIOC_REQBUFS with\n> \n> s/buffers/buffers,/ ?\n> \n> > count > 0.\n> > \n> > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> > \n> > ---\n> > New in v3\n> > - split from... a conglomerate of v4l2-compliance fixes patch\n> > ---\n> >  src/v4l2/v4l2_camera_proxy.cpp | 9 +++++++++\n> >  1 file changed, 9 insertions(+)\n> > \n> > diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> > index eb59d49..7262453 100644\n> > --- a/src/v4l2/v4l2_camera_proxy.cpp\n> > +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> > @@ -361,6 +361,15 @@ int V4L2CameraProxy::vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuf\n> >  \t\treturn freeBuffers();\n> >  \t}\n> >  \n> > +\tif (bufferCount_ > 0) {\n> > +\t\tint ret = freeBuffers();\n> > +\t\tif (ret < 0) {\n> > +\t\t\tLOG(V4L2Compat, Error)\n> > +\t\t\t\t<< \"Failed to free libcamera buffers for re-reqbufs\";\n> \n> \t\t\trelease(file);\n> \n> ?\n\nActually likely not, as the result is that buffers are not freed, so\nownership should not be released. I'll let you decide which of my two\ncomments is the right one :-)\n\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> > +\t\t\treturn ret;\n> > +\t\t}\n> > +\t}\n> > +\n> >  \tSize size(curV4L2Format_.fmt.pix.width, curV4L2Format_.fmt.pix.height);\n> >  \tret = vcam_->configure(&streamConfig_, size,","headers":{"Return-Path":"<laurent.pinchart@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 02E95609A5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Jun 2020 00:27:06 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 262D32A9;\n\tWed, 24 Jun 2020 00:27:04 +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=\"S38C7FEw\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1592951225;\n\tbh=8854QHreXcMb26Bjy5eHmPO4mC3rPBQMhDHupZU5+KM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=S38C7FEwNl765xFi/Kums2tef4MFmnn5bjbPtC99pWTaTZtIPBAXwtKH5Ia+fxd2/\n\tb5eLU24DsZwNVTZn6D/QVnr+yj5eVEPAL43tNbviDHcrG8AYi/l4rWK/aEigd7ShoF\n\tgZU82m8TUE6hQqkjqJA4lCyE3S8V/RbD2lbdLkNE=","Date":"Wed, 24 Jun 2020 01:26:38 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200623222638.GI5870@pendragon.ideasonboard.com>","References":"<20200623190836.53446-1-paul.elder@ideasonboard.com>\n\t<20200623190836.53446-5-paul.elder@ideasonboard.com>\n\t<20200623222540.GH5870@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200623222540.GH5870@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3 04/22] v4l2: v4l2_camera_proxy:\n\tFree old buffers on reqbufs > 0","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, 23 Jun 2020 22:27:06 -0000"}}]