[{"id":14427,"web_url":"https://patchwork.libcamera.org/comment/14427/","msgid":"<X+zgbQcEerjcmWkp@pendragon.ideasonboard.com>","date":"2020-12-30T20:17:49","subject":"Re: [libcamera-devel] [PATCH v3 6/6] android: camera_device: Do not\n\tdefault pixel array properties","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 Wed, Dec 30, 2020 at 07:01:20PM +0100, Jacopo Mondi wrote:\n> Now that the pixel array properties have been defaulted in the\n> CameraSensor class, they will always be reported by the\n> libcamera::Camera and there's no need to default them in the\n> Camera HAL.\n> \n> Remove defaults and assume properties are always there.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/android/camera_device.cpp | 20 ++------------------\n>  1 file changed, 2 insertions(+), 18 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 7678d4485ce9..9912875ea046 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -851,7 +851,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n>  \tstaticMetadata_->addEntry(ANDROID_JPEG_MAX_SIZE, &maxJpegBufferSize_, 1);\n>  \n>  \t/* Sensor static metadata. */\n> -\tif (properties.contains(properties::PixelArraySize)) {\n> +\t{\n>  \t\tconst Size &size =\n>  \t\t\tproperties.get(properties::PixelArraySize);\n>  \t\tstd::vector<int32_t> data{\n> @@ -860,17 +860,9 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n>  \t\t};\n>  \t\tstaticMetadata_->addEntry(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE,\n>  \t\t\t\t\t  data.data(), data.size());\n> -\t} else {\n> -\t\t/*\n> -\t\t * \\todo Drop the default once the ov5670 and ov13858 drivers\n> -\t\t * are updated to report the pixel array size.\n> -\t\t */\n\nGood, one less \\todo :-) However, that reminds me that you should add\none in the patch that makes validation of sensor properties a soft\nfailure.\n\n> -\t\tint32_t data[] = { 2592, 1944 };\n> -\t\tstaticMetadata_->addEntry(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE,\n> -\t\t\t\t\t  data, 2);\n>  \t}\n>  \n> -\tif (properties.contains(properties::PixelArrayActiveAreas)) {\n> +\t{\n>  \t\tconst Span<const Rectangle> &rects =\n>  \t\t\tproperties.get(properties::PixelArrayActiveAreas);\n>  \t\tstd::vector<int32_t> data{\n> @@ -881,14 +873,6 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n>  \t\t};\n>  \t\tstaticMetadata_->addEntry(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE,\n>  \t\t\t\t\t  data.data(), data.size());\n> -\t} else {\n> -\t\t/*\n> -\t\t * \\todo Drop the default once the ov5670 and ov13858 drivers\n> -\t\t * are updated to report the pixel array size.\n> -\t\t */\n> -\t\tint32_t data[] = { 0, 0, 2560, 1920 };\n> -\t\tstaticMetadata_->addEntry(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE,\n> -\t\t\t\t\t  data, 4);\n>  \t}\n\nWe need to update the UVC pipeline handler first. With a patch to do so\nbefore this patch,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \n>  \tint32_t sensitivityRange[] = {","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 F026FC0F1A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 30 Dec 2020 20:18:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 67BDE615D5;\n\tWed, 30 Dec 2020 21:18:02 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 33E0960526\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 30 Dec 2020 21:18:01 +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 A3D542A3;\n\tWed, 30 Dec 2020 21:18:00 +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=\"Vd3+isMl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1609359480;\n\tbh=ZWyhlaAYiGunxAPF9TifPVXHQ7xmTKHj3JXRWIJ3Q6s=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Vd3+isMlmOQDXD+tSkAfAchdYuNx8OUuLvVWKQb72oKi/VxFMnfFVbJxeLAA769A2\n\touwP3IV7oEzGa+bLhufi6kH9BQzmjKQhkXyE1K1HIhipXixVgqN0rpYjY7b4AX3y1H\n\t4FgyEDtyq+xP+mWzlCeU1rp66omQMcM8fLA8/iec=","Date":"Wed, 30 Dec 2020 22:17:49 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<X+zgbQcEerjcmWkp@pendragon.ideasonboard.com>","References":"<20201230180120.78407-1-jacopo@jmondi.org>\n\t<20201230180120.78407-7-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201230180120.78407-7-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 6/6] android: camera_device: Do not\n\tdefault pixel array properties","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=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]