[{"id":11725,"web_url":"https://patchwork.libcamera.org/comment/11725/","msgid":"<20200729162147.775dnkrg4cfz4suy@uno.localdomain>","date":"2020-07-29T16:21:47","subject":"Re: [libcamera-devel] [PATCH v2 2/3] android: camera_device: Map\n\tHAL RAW to libcamera RAW formats","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Niklas,\n\nOn Wed, Jul 29, 2020 at 01:12:01PM +0200, Niklas Söderlund wrote:\n> Add a mapping from HAL RAW formats to the direct equivalent of libcamera\n> formats. With this change it is possible to capture RAW images as long\n> as the hardware can deliver frames in a format that is native to the\n> HAL.\n>\n> More work is needed to deal with unpacked 8, 10 and 12 RAW formats as\n> they don't directly map to a native HAL format. Nor do they belong in\n> the RAW_OPAQUE category as the content format is generic and not\n> uncommonly supported by hardware.\n>\n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  src/android/camera_device.cpp | 24 ++++++++++++++++++++++++\n>  1 file changed, 24 insertions(+)\n>\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index ce37fcb8cf5cd4b3..c31950db78a588ed 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -77,6 +77,30 @@ const std::map<int, const Camera3Format> camera3FormatsMap = {\n>  \t\t\ttrue,\n>  \t\t\t\"IMPLEMENTATION_DEFINED\"\n>  \t\t}\n> +\t}, {\n> +\t\tHAL_PIXEL_FORMAT_RAW10, {\n> +\t\t\t{ formats::SBGGR10_CSI2P, formats::SGBRG10_CSI2P, formats::SGRBG10_CSI2P, formats::SRGGB10_CSI2P },\n\nFor my own education, how does android distinguish between the diffent\ncomponents ordering, if they just report formats as RAWxx ? They don't\ncare ?\n\nThe patch looks good otherwise\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n   j\n\n> +\t\t\tfalse,\n> +\t\t\t\"RAW10\"\n> +\t\t}\n> +\t}, {\n> +\t\tHAL_PIXEL_FORMAT_RAW12, {\n> +\t\t\t{ formats::SBGGR12_CSI2P, formats::SGBRG12_CSI2P, formats::SGRBG12_CSI2P, formats::SRGGB12_CSI2P },\n> +\t\t\tfalse,\n> +\t\t\t\"RAW12\"\n> +\t\t}\n> +\t}, {\n> +\t\tHAL_PIXEL_FORMAT_RAW16, {\n> +\t\t\t{ formats::SBGGR16, formats::SGBRG16, formats::SGRBG16, formats::SRGGB16 },\n> +\t\t\tfalse,\n> +\t\t\t\"RAW16\"\n> +\t\t}\n> +\t}, {\n> +\t\tHAL_PIXEL_FORMAT_RAW_OPAQUE, {\n> +\t\t\t{ formats::SBGGR10_IPU3, formats::SGBRG10_IPU3, formats::SGRBG10_IPU3, formats::SRGGB10_IPU3 },\n> +\t\t\tfalse,\n> +\t\t\t\"RAW_OPAQUE\"\n> +\t\t}\n>  \t},\n>  };\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":"<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 98477BD86F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 Jul 2020 16:18:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3AD6C613C6;\n\tWed, 29 Jul 2020 18:18:10 +0200 (CEST)","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 E7F676039D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jul 2020 18:18:08 +0200 (CEST)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 468B620003;\n\tWed, 29 Jul 2020 16:18:07 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","Date":"Wed, 29 Jul 2020 18:21:47 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20200729162147.775dnkrg4cfz4suy@uno.localdomain>","References":"<20200729111202.3812677-1-niklas.soderlund@ragnatech.se>\n\t<20200729111202.3812677-3-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200729111202.3812677-3-niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH v2 2/3] android: camera_device: Map\n\tHAL RAW to libcamera RAW formats","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","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":11728,"web_url":"https://patchwork.libcamera.org/comment/11728/","msgid":"<20200729163808.GL6183@pendragon.ideasonboard.com>","date":"2020-07-29T16:38:08","subject":"Re: [libcamera-devel] [PATCH v2 2/3] android: camera_device: Map\n\tHAL RAW to libcamera RAW formats","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Jul 29, 2020 at 06:21:47PM +0200, Jacopo Mondi wrote:\n> On Wed, Jul 29, 2020 at 01:12:01PM +0200, Niklas Söderlund wrote:\n> > Add a mapping from HAL RAW formats to the direct equivalent of libcamera\n> > formats. With this change it is possible to capture RAW images as long\n> > as the hardware can deliver frames in a format that is native to the\n> > HAL.\n> >\n> > More work is needed to deal with unpacked 8, 10 and 12 RAW formats as\n> > they don't directly map to a native HAL format. Nor do they belong in\n> > the RAW_OPAQUE category as the content format is generic and not\n> > uncommonly supported by hardware.\n> >\n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > ---\n> >  src/android/camera_device.cpp | 24 ++++++++++++++++++++++++\n> >  1 file changed, 24 insertions(+)\n> >\n> > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> > index ce37fcb8cf5cd4b3..c31950db78a588ed 100644\n> > --- a/src/android/camera_device.cpp\n> > +++ b/src/android/camera_device.cpp\n> > @@ -77,6 +77,30 @@ const std::map<int, const Camera3Format> camera3FormatsMap = {\n> >  \t\t\ttrue,\n> >  \t\t\t\"IMPLEMENTATION_DEFINED\"\n> >  \t\t}\n> > +\t}, {\n> > +\t\tHAL_PIXEL_FORMAT_RAW10, {\n> > +\t\t\t{ formats::SBGGR10_CSI2P, formats::SGBRG10_CSI2P, formats::SGRBG10_CSI2P, formats::SRGGB10_CSI2P },\n\nI'd wrap this:\n\n\t\t\t{\n\t\t\t\tformats::SBGGR10_CSI2P,\n\t\t\t\tformats::SGBRG10_CSI2P,\n\t\t\t\tformats::SGRBG10_CSI2P,\n\t\t\t\tformats::SRGGB10_CSI2P\n\t\t\t},\n\nSame below.\n\n> For my own education, how does android distinguish between the diffent\n> components ordering, if they just report formats as RAWxx ? They don't\n> care ?\n\nandroid.sensor.info.colorFilterArrangement\n\n> The patch looks good otherwise\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> > +\t\t\tfalse,\n> > +\t\t\t\"RAW10\"\n> > +\t\t}\n> > +\t}, {\n> > +\t\tHAL_PIXEL_FORMAT_RAW12, {\n> > +\t\t\t{ formats::SBGGR12_CSI2P, formats::SGBRG12_CSI2P, formats::SGRBG12_CSI2P, formats::SRGGB12_CSI2P },\n> > +\t\t\tfalse,\n> > +\t\t\t\"RAW12\"\n> > +\t\t}\n> > +\t}, {\n> > +\t\tHAL_PIXEL_FORMAT_RAW16, {\n> > +\t\t\t{ formats::SBGGR16, formats::SGBRG16, formats::SGRBG16, formats::SRGGB16 },\n> > +\t\t\tfalse,\n> > +\t\t\t\"RAW16\"\n> > +\t\t}\n> > +\t}, {\n> > +\t\tHAL_PIXEL_FORMAT_RAW_OPAQUE, {\n> > +\t\t\t{ formats::SBGGR10_IPU3, formats::SGBRG10_IPU3, formats::SGRBG10_IPU3, formats::SRGGB10_IPU3 },\n> > +\t\t\tfalse,\n> > +\t\t\t\"RAW_OPAQUE\"\n> > +\t\t}\n> >  \t},\n> >  };\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 9ADECBD86F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 Jul 2020 16:38:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2F53E617AF;\n\tWed, 29 Jul 2020 18:38:20 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 671BE60540\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jul 2020 18:38:18 +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 D009E27A;\n\tWed, 29 Jul 2020 18:38:17 +0200 (CEST)"],"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=\"ZD6Bjw9s\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1596040698;\n\tbh=FnY/883bVGR5F6+AdeBTLxi08THEiwF63Q9XDHzu5YM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ZD6Bjw9spcLWJZQ2WOJ0oPYoYYONVZWgXPwGzo+gKVbGJgpN14fZ1ijE5uXt6/csi\n\t9wHNuPZF/m3C28WnMVp6uKwyum8LwXb/1aFbhVNBdt1IOrlQYf//ZNvaMxCEP/9nW2\n\tDdPG1wBDov71zML+aUzF0wvUJCbJKHyfr+DyVkKA=","Date":"Wed, 29 Jul 2020 19:38:08 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200729163808.GL6183@pendragon.ideasonboard.com>","References":"<20200729111202.3812677-1-niklas.soderlund@ragnatech.se>\n\t<20200729111202.3812677-3-niklas.soderlund@ragnatech.se>\n\t<20200729162147.775dnkrg4cfz4suy@uno.localdomain>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200729162147.775dnkrg4cfz4suy@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH v2 2/3] android: camera_device: Map\n\tHAL RAW to libcamera RAW formats","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","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]