[{"id":2969,"web_url":"https://patchwork.libcamera.org/comment/2969/","msgid":"<20191028001347.GG28970@pendragon.ideasonboard.com>","date":"2019-10-28T00:13:47","subject":"Re: [libcamera-devel] [PATCH 10/10] test: camera: buffer_import:\n\tUse DRM/KMS format","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Mon, Oct 28, 2019 at 12:43:12AM +0100, Jacopo Mondi wrote:\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  test/camera/buffer_import.cpp | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n> \n> diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\n> index 9cac19d8ce81..8411e69bbd09 100644\n> --- a/test/camera/buffer_import.cpp\n> +++ b/test/camera/buffer_import.cpp\n> @@ -13,6 +13,8 @@\n>  #include <random>\n>  #include <vector>\n>  \n> +#include <linux/drm_fourcc.h>\n> +\n>  #include \"device_enumerator.h\"\n>  #include \"media_device.h\"\n>  #include \"v4l2_videodevice.h\"\n> @@ -79,7 +81,7 @@ public:\n>  \n>  \t\tformat_.size.width = 1920;\n>  \t\tformat_.size.height = 1080;\n> -\t\tformat_.fourcc = V4L2_PIX_FMT_RGB24;\n> +\t\tformat_.fourcc = DRM_FORMAT_BGR888;\n>  \t\tformat_.planesCount = 1;\n>  \t\tformat_.planes[0].size = 1920 * 1080 * 3;\n>  \t\tformat_.planes[0].bpl = 1920 * 3;\n\nThis is actually not Reviewed-by as it breaks the test :-) format_ here\nis a V4L2DeviceFormat so it should use V4L2 4CCs. You can just drop this\npatch.","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 B56816017C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Oct 2019 01:13:57 +0100 (CET)","from pendragon.ideasonboard.com (143.121.2.93.rev.sfr.net\n\t[93.2.121.143])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D1776A31;\n\tMon, 28 Oct 2019 01:13:56 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1572221637;\n\tbh=ytm/MxkOCiRii1nJGrOkf7Fg0Z03fwUjrudL15thMAs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=HYnCGcvEu126o9VZvWY2KZl/w9Zr24vu52EfOjX9KLUpPvpF0ucxTvgPTaUDXS8y6\n\tbnDSbTY0vnpiMb6Fh3GiBADZgRxdWQqUG0ejcM+gt18gciDVcMk1QnGWeO9DgZDtBz\n\tqYhqc6LGEnCvBDd4hCzInvbjNLuc2bMKmIG5zPSQ=","Date":"Mon, 28 Oct 2019 02:13:47 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191028001347.GG28970@pendragon.ideasonboard.com>","References":"<20191027234312.35284-1-jacopo@jmondi.org>\n\t<20191027234312.35284-11-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20191027234312.35284-11-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 10/10] test: camera: buffer_import:\n\tUse DRM/KMS format","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":"Mon, 28 Oct 2019 00:13:57 -0000"}},{"id":2970,"web_url":"https://patchwork.libcamera.org/comment/2970/","msgid":"<20191028002707.GH28970@pendragon.ideasonboard.com>","date":"2019-10-28T00:27:07","subject":"Re: [libcamera-devel] [PATCH 10/10] test: camera: buffer_import:\n\tUse DRM/KMS format","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Mon, Oct 28, 2019 at 02:13:47AM +0200, Laurent Pinchart wrote:\n> On Mon, Oct 28, 2019 at 12:43:12AM +0100, Jacopo Mondi wrote:\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  test/camera/buffer_import.cpp | 4 +++-\n> >  1 file changed, 3 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\n> > index 9cac19d8ce81..8411e69bbd09 100644\n> > --- a/test/camera/buffer_import.cpp\n> > +++ b/test/camera/buffer_import.cpp\n> > @@ -13,6 +13,8 @@\n> >  #include <random>\n> >  #include <vector>\n> >  \n> > +#include <linux/drm_fourcc.h>\n> > +\n> >  #include \"device_enumerator.h\"\n> >  #include \"media_device.h\"\n> >  #include \"v4l2_videodevice.h\"\n> > @@ -79,7 +81,7 @@ public:\n> >  \n> >  \t\tformat_.size.width = 1920;\n> >  \t\tformat_.size.height = 1080;\n> > -\t\tformat_.fourcc = V4L2_PIX_FMT_RGB24;\n> > +\t\tformat_.fourcc = DRM_FORMAT_BGR888;\n> >  \t\tformat_.planesCount = 1;\n> >  \t\tformat_.planes[0].size = 1920 * 1080 * 3;\n> >  \t\tformat_.planes[0].bpl = 1920 * 3;\n> \n> This is actually not Reviewed-by as it breaks the test :-) format_ here\n> is a V4L2DeviceFormat so it should use V4L2 4CCs. You can just drop this\n> patch.\n\nI spoke a bit too soon, dropping the patch isn't enough. It should be\nreplaced with the following patch.\n\n>From 9611d40c66dfbfdd7688886ecc0c21584ad86dcb Mon Sep 17 00:00:00 2001\nFrom: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nDate: Fri, 25 Oct 2019 18:47:38 +0200\nSubject: [PATCH] test: camera: buffer_import: Convert to PixelFormat\n\nConvert the V4L2 4CC retrieved from the exporter video device to a\nPixelFormat for the camera configuration.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n test/camera/buffer_import.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\nindex 9cac19d8ce81..f62ccade066b 100644\n--- a/test/camera/buffer_import.cpp\n+++ b/test/camera/buffer_import.cpp\n@@ -318,7 +318,7 @@ protected:\n \n \t\tStreamConfiguration &cfg = config->at(0);\n \t\tcfg.size = format.size;\n-\t\tcfg.pixelFormat = format.fourcc;\n+\t\tcfg.pixelFormat = video_->toPixelFormat(format_.fourcc);\n \t\tcfg.bufferCount = CAMERA_BUFFER_COUNT;\n \t\tcfg.memoryType = ExternalMemory;\n \n\nShould this be squashed with \"[PATCH 08/10] libcamera: pipeline: Use\nPixelFormat for application formats\" to avoid breaking bisection ? Same\nfor 09/10 actually.","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 B16EA6017C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Oct 2019 01:27:15 +0100 (CET)","from pendragon.ideasonboard.com (143.121.2.93.rev.sfr.net\n\t[93.2.121.143])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 17954A31;\n\tMon, 28 Oct 2019 01:27:15 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1572222435;\n\tbh=pdF0vAdFgkbn7zXrElG0sAhQ4MhwCQ45vYLcnYPe/Ww=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=HVIiZyHhxi751TNfnCtAuR6/zCiHT6AkbFOa/kr7sryCJ9fzLjazBcaN0SUx7Xfnb\n\tv4Q50tWaDc4e6tTQHjQScnqDelb+Vnq8tl6bajzwi0CEPfKR7Actt2SVpuqwAmR/1l\n\tL6AvK4i28DviJczYgQfpG8uEpIiQkMactCRXbL2c=","Date":"Mon, 28 Oct 2019 02:27:07 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191028002707.GH28970@pendragon.ideasonboard.com>","References":"<20191027234312.35284-1-jacopo@jmondi.org>\n\t<20191027234312.35284-11-jacopo@jmondi.org>\n\t<20191028001347.GG28970@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20191028001347.GG28970@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 10/10] test: camera: buffer_import:\n\tUse DRM/KMS format","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":"Mon, 28 Oct 2019 00:27:15 -0000"}},{"id":2971,"web_url":"https://patchwork.libcamera.org/comment/2971/","msgid":"<20191028003704.GI28970@pendragon.ideasonboard.com>","date":"2019-10-28T00:37:04","subject":"Re: [libcamera-devel] [PATCH 10/10] test: camera: buffer_import:\n\tUse DRM/KMS format","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Oct 28, 2019 at 02:27:07AM +0200, Laurent Pinchart wrote:\n> On Mon, Oct 28, 2019 at 02:13:47AM +0200, Laurent Pinchart wrote:\n> > On Mon, Oct 28, 2019 at 12:43:12AM +0100, Jacopo Mondi wrote:\n> > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > > ---\n> > >  test/camera/buffer_import.cpp | 4 +++-\n> > >  1 file changed, 3 insertions(+), 1 deletion(-)\n> > > \n> > > diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\n> > > index 9cac19d8ce81..8411e69bbd09 100644\n> > > --- a/test/camera/buffer_import.cpp\n> > > +++ b/test/camera/buffer_import.cpp\n> > > @@ -13,6 +13,8 @@\n> > >  #include <random>\n> > >  #include <vector>\n> > >  \n> > > +#include <linux/drm_fourcc.h>\n> > > +\n> > >  #include \"device_enumerator.h\"\n> > >  #include \"media_device.h\"\n> > >  #include \"v4l2_videodevice.h\"\n> > > @@ -79,7 +81,7 @@ public:\n> > >  \n> > >  \t\tformat_.size.width = 1920;\n> > >  \t\tformat_.size.height = 1080;\n> > > -\t\tformat_.fourcc = V4L2_PIX_FMT_RGB24;\n> > > +\t\tformat_.fourcc = DRM_FORMAT_BGR888;\n> > >  \t\tformat_.planesCount = 1;\n> > >  \t\tformat_.planes[0].size = 1920 * 1080 * 3;\n> > >  \t\tformat_.planes[0].bpl = 1920 * 3;\n> > \n> > This is actually not Reviewed-by as it breaks the test :-) format_ here\n> > is a V4L2DeviceFormat so it should use V4L2 4CCs. You can just drop this\n> > patch.\n> \n> I spoke a bit too soon, dropping the patch isn't enough. It should be\n> replaced with the following patch.\n> \n> From 9611d40c66dfbfdd7688886ecc0c21584ad86dcb Mon Sep 17 00:00:00 2001\n> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Date: Fri, 25 Oct 2019 18:47:38 +0200\n> Subject: [PATCH] test: camera: buffer_import: Convert to PixelFormat\n> \n> Convert the V4L2 4CC retrieved from the exporter video device to a\n> PixelFormat for the camera configuration.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  test/camera/buffer_import.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\n> index 9cac19d8ce81..f62ccade066b 100644\n> --- a/test/camera/buffer_import.cpp\n> +++ b/test/camera/buffer_import.cpp\n> @@ -318,7 +318,7 @@ protected:\n>  \n>  \t\tStreamConfiguration &cfg = config->at(0);\n>  \t\tcfg.size = format.size;\n> -\t\tcfg.pixelFormat = format.fourcc;\n> +\t\tcfg.pixelFormat = video_->toPixelFormat(format_.fourcc);\n\nIt would help if I tested code before sending it...\n\n>  \t\tcfg.bufferCount = CAMERA_BUFFER_COUNT;\n>  \t\tcfg.memoryType = ExternalMemory;\n>  \n> \n> Should this be squashed with \"[PATCH 08/10] libcamera: pipeline: Use\n> PixelFormat for application formats\" to avoid breaking bisection ? Same\n> for 09/10 actually.\n\n>From 4b1270ea094dfa24a0953d60adb19aa29182b4f8 Mon Sep 17 00:00:00 2001\nFrom: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nDate: Fri, 25 Oct 2019 18:47:38 +0200\nSubject: [PATCH] test: camera: buffer_import: Convert to PixelFormat\n\nConvert the V4L2 4CC retrieved from the exporter video device to a\nPixelFormat for the camera configuration.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n test/camera/buffer_import.cpp | 17 ++++++++++++-----\n 1 file changed, 12 insertions(+), 5 deletions(-)\n\ndiff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\nindex 9cac19d8ce81..bbc5a25c4019 100644\n--- a/test/camera/buffer_import.cpp\n+++ b/test/camera/buffer_import.cpp\n@@ -155,7 +155,16 @@ public:\n \t}\n \n \tbool done() const { return done_; }\n-\tconst V4L2DeviceFormat &format() const { return format_; }\n+\n+\tPixelFormat format() const\n+\t{\n+\t\treturn video_->toPixelFormat(format_.fourcc);\n+\t}\n+\n+\tconst Size &size() const\n+\t{\n+\t\treturn format_.size;\n+\t}\n \n \tSignal<uint64_t, int> requestReady;\n \n@@ -314,11 +323,9 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tconst V4L2DeviceFormat &format = sink_.format();\n-\n \t\tStreamConfiguration &cfg = config->at(0);\n-\t\tcfg.size = format.size;\n-\t\tcfg.pixelFormat = format.fourcc;\n+\t\tcfg.size = sink_.size();\n+\t\tcfg.pixelFormat = sink_.format();\n \t\tcfg.bufferCount = CAMERA_BUFFER_COUNT;\n \t\tcfg.memoryType = ExternalMemory;","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 710DC6017C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Oct 2019 01:37:14 +0100 (CET)","from pendragon.ideasonboard.com (143.121.2.93.rev.sfr.net\n\t[93.2.121.143])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A784CA31;\n\tMon, 28 Oct 2019 01:37:13 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1572223034;\n\tbh=Kfs2doOHNfGfA0ewl4ePgMsMFp+r6YzxOdz6bK+TNdY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=M7hjBSVXE+abVx6eZ8nXV5WHFuRcPs8vQPVXNWZ5EvBIUUfBiADv9NmvLq0kjPBZd\n\tz7BkmusdXPIldTdMo0unp3BR0JBuRkGL3TMvP1V84zrTdetVYf2sQ87I/Xt/vgZsjf\n\tVLqPpxGFg33F2Di6sSGRl8luj6H5AHz3NlNSJeu0=","Date":"Mon, 28 Oct 2019 02:37:04 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191028003704.GI28970@pendragon.ideasonboard.com>","References":"<20191027234312.35284-1-jacopo@jmondi.org>\n\t<20191027234312.35284-11-jacopo@jmondi.org>\n\t<20191028001347.GG28970@pendragon.ideasonboard.com>\n\t<20191028002707.GH28970@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20191028002707.GH28970@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 10/10] test: camera: buffer_import:\n\tUse DRM/KMS format","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":"Mon, 28 Oct 2019 00:37:14 -0000"}}]