[{"id":39619,"web_url":"https://patchwork.libcamera.org/comment/39619/","msgid":"<178341375901.292172.15649263706190620419@neptunite.rasen.tech>","date":"2026-07-07T08:42:39","subject":"Re: [PATCH v1 1/2] libcamera: Clarify meaning of PixelArraySize and\n\tother rectangles","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting Stefan Klug (2026-06-16 21:08:14)\n> Current documented behavior for PixelArraySize is to report the readable\n> array size of the sensor data. If the readable array is offset relative\n> to the physical sensor array, all related rectangles (ScalerCrop,\n> PixelArrayActiveAreas) shall be reported relative to PixelArraySize.\n> \n> However no known pipeline and IPA implements it that way. All\n> pipelines/IPAs treat PixelArraySize as the physical sensor size and\n> handle the rectangles relative to that size.\n> \n> Adjust the documentation to fit the actual implementations. Add another\n> property named PixelArrayReadableArea to convey the information that\n> PixelArraySize was intended for.\n> \n> This has the added benefit that all rectangles are relative to the\n> physical sensor array, which is necessary to align tuning data like lens\n> shading correction.\n\nMakes sense to me.\n\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> \n> ---\n> \n> ToDo:\n> - Implement the expected behavior in CameraSensorRaw\n> ---\n>  include/libcamera/ipa/core.mojom              |   2 +-\n>  src/libcamera/property_ids_core.yaml          | 116 ++++++++++--------\n>  src/libcamera/sensor/camera_sensor_legacy.cpp |  26 ++--\n>  src/libcamera/sensor/camera_sensor_raw.cpp    |  16 +--\n>  4 files changed, 89 insertions(+), 71 deletions(-)\n> \n> diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom\n> index bce797245829..5da780f5d256 100644\n> --- a/include/libcamera/ipa/core.mojom\n> +++ b/include/libcamera/ipa/core.mojom\n> @@ -154,7 +154,7 @@ module libcamera;\n>  \n>  /**\n>   * \\var IPACameraSensorInfo::activeAreaSize\n> - * \\brief The size of the pixel array active area of the sensor\n> + * \\brief The size of the physical pixel array of the sensor in pixels\n>   */\n>  \n>  /**\n> diff --git a/src/libcamera/property_ids_core.yaml b/src/libcamera/property_ids_core.yaml\n> index d5b3d309c055..96c85f9233fd 100644\n> --- a/src/libcamera/property_ids_core.yaml\n> +++ b/src/libcamera/property_ids_core.yaml\n> @@ -427,11 +427,29 @@ controls:\n>    - PixelArraySize:\n>        type: Size\n>        description: |\n> -        The camera sensor pixel array readable area vertical and horizontal\n> -        sizes, in pixels.\n> +        The camera sensor pixel array vertical and horizontal sizes, in pixels.\n>  \n> -        The PixelArraySize property defines the size in pixel units of the\n> -        readable part of full pixel array matrix, including optical black\n> +        The PixelArraySize property defines the size in pixel units of the full\n> +        pixel array matrix. It is often not be possible to capture the whole\n\ns/be ///\n\n> +        physical pixel array. For the largest readable area \\see\n> +        PixelArrayReadableArea.\n> +\n> +        This defines a rectangle whose top-left corner is placed in position (0,\n> +        0) and whose vertical and horizontal sizes are defined by this property.\n> +        All other rectangles that describe portions of the pixel array, such as\n> +        the optical black pixels rectangles and active pixel areas, are defined\n> +        relatively to this rectangle.\n\ns/relatively/relative/\n\n\nLooks good to me.\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> +\n> +        \\todo Rename this property to Size once we will have property\n> +              categories (i.e. Properties::PixelArray::Size)\n> +\n> +  - PixelArrayReadableArea:\n> +      type: Rectangle\n> +      description: |\n> +        The camera sensor pixel array readable area.\n> +\n> +        The PixelArrayReadableArea property defines the rectangle in pixel units\n> +        of the readable part of full pixel array matrix, including optical black\n>          pixels used for calibration, pixels which are not considered valid for\n>          capture and active pixels containing valid image data.\n>  \n> @@ -442,23 +460,25 @@ controls:\n>  \n>          For example, let's consider a pixel array matrix assembled as follows\n>  \n> -             +--------------------------------------------------+\n> -             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> -             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> +                          PixelArraySize.width\n> +             /--------------------------------------------------/\n> +             +--------------------------------------------------+ /\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| |\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| | PixelArraySize.height\n>               ...          ...           ...      ...          ...\n>  \n>               ...          ...           ...      ...          ...\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> -             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> -             +--------------------------------------------------+\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| |\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| |\n> +             +--------------------------------------------------+ /\n>  \n>          starting with two lines of non-readable pixels (x), followed by N lines\n>          of readable data (D) surrounded by two columns of non-readable pixels on\n> @@ -467,35 +487,32 @@ controls:\n>          sizes of the largest possible buffer of raw data that can be presented\n>          to applications.\n>  \n> -                             PixelArraySize.width\n> -               /----------------------------------------------/\n> -               +----------------------------------------------+ /\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| | PixelArraySize.height\n> -               ...        ...           ...      ...        ...\n> -               ...        ...           ...      ...        ...\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               +----------------------------------------------+ /\n> +                          PixelArrayReadableArea.width\n> +                /--------------------------------------------/\n> +                PixelArrayReadableArea.x\n> +             +--o-----------------------------------------------+\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> +             oxxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| / PixelArrayReadableArea.y\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| | PixelArrayReadableArea.height\n> +             ...          ...           ...      ...          ...\n>  \n> -        This defines a rectangle whose top-left corner is placed in position (0,\n> -        0) and whose vertical and horizontal sizes are defined by this property.\n> -        All other rectangles that describe portions of the pixel array, such as\n> -        the optical black pixels rectangles and active pixel areas, are defined\n> -        relatively to this rectangle.\n> +             ...          ...           ...      ...          ...\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| /\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> +             +--------------------------------------------------+\n>  \n>          All the coordinates are expressed relative to the default sensor readout\n>          direction, without any transformation (such as horizontal and vertical\n>          flipping) applied. When mapping them to the raw pixel buffer,\n>          applications shall take any configured transformation into account.\n>  \n> -        \\todo Rename this property to Size once we will have property\n> -              categories (i.e. Properties::PixelArray::Size)\n> -\n>    - PixelArrayOpticalBlackRectangles:\n>        type: Rectangle\n>        size: [n]\n> @@ -519,7 +536,7 @@ controls:\n>          they could be positioned too close to the chip margins or to the optical\n>          black shielding placed on top of optical black pixels.\n>  \n> -                             PixelArraySize.width\n> +                             PixelArrayReadableArea.width\n>                 /----------------------------------------------/\n>                    x1                                       x2\n>                 +--o---------------------------------------o---+ /\n> @@ -532,7 +549,7 @@ controls:\n>                 |IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII| |\n>                 |IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII| |\n>              y3 |IIOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOOII| |\n> -               |IIOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOOII| | PixelArraySize.height\n> +               |IIOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOOII| | PixelArrayReadableArea.height\n>                 |IIOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOOII| |\n>                 ...          ...           ...     ...       ...\n>                 ...          ...           ...     ...       ...\n> @@ -560,7 +577,7 @@ controls:\n>          skips the invalid lines and columns, producing the following data\n>          buffer, when captured to memory\n>  \n> -                             PixelArraySize.width\n> +                             PixelArrayReadableArea.width\n>                 /----------------------------------------------/\n>                                                             x1\n>                 +--------------------------------------------o-+ /\n> @@ -570,7 +587,7 @@ controls:\n>                 |OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO| |\n>              y1 oOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOO| |\n>                 |OOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOO| |\n> -               |OOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOO| | PixelArraySize.height\n> +               |OOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOO| | PixelArrayReadableArea.height\n>                 ...       ...          ...       ...         ... |\n>                 ...       ...          ...       ...         ... |\n>                 |OOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOO| |\n> @@ -578,14 +595,17 @@ controls:\n>                 +----------------------------------------------+ /\n>  \n>          then the invalid lines and columns should not be reported as part of the\n> -        PixelArraySize property in first place.\n> +        PixelArrayReadableArea property in first place. As the coordinates of\n> +        PixelArrayReadableArea are relative to the physical pixel array, care\n> +        must be taken to report it in a way that the valid pixel data maps to\n> +        the correct physical position.\n>  \n>          In this case, the position of the black pixel rectangles will be\n>  \n>              PixelArrayOpticalBlackRectangles = {\n> -               { 0, 0, y1 + 1, PixelArraySize[0] },\n> -               { 0, y1, 2, PixelArraySize[1] - y1 + 1 },\n> -               { x1, y1, 2, PixelArraySize[1] - y1 + 1 },\n> +               { 0, 0, PixelArrayReadableArea.width, y1 + 1 },\n> +               { 0, y1, 2, PixelArrayReadableArea.height - y1 + 1 },\n> +               { x1, y1, 2, PixelArrayReadableArea.height - y1 + 1 },\n>              };\n>  \n>          \\todo Rename this property to Size once we will have property\n> diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp\n> index 6a683821f219..482e387d3b24 100644\n> --- a/src/libcamera/sensor/camera_sensor_legacy.cpp\n> +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp\n> @@ -38,6 +38,7 @@\n>  #include \"libcamera/internal/media_device.h\"\n>  #include \"libcamera/internal/sysfs.h\"\n>  #include \"libcamera/internal/v4l2_subdevice.h\"\n> +#include \"linux/v4l2-common.h\"\n>  \n>  namespace libcamera {\n>  \n> @@ -131,6 +132,7 @@ private:\n>         controls::draft::TestPatternModeEnum testPatternMode_;\n>  \n>         Size pixelArraySize_;\n> +       Rectangle readableArea_;\n>         Rectangle activeArea_;\n>         const BayerFormat *bayerFormat_;\n>         bool supportFlips_;\n> @@ -390,7 +392,7 @@ int CameraSensorLegacy::validateSensorDriver()\n>          * test platforms have been updated.\n>          */\n>         Rectangle rect;\n> -       int ret = subdev_->getSelection(pad_, V4L2_SEL_TGT_CROP_BOUNDS, &rect);\n> +       int ret = subdev_->getSelection(pad_, V4L2_SEL_TGT_NATIVE_SIZE, &rect);\n>         if (ret) {\n>                 /*\n>                  * Default the pixel array size to the largest size supported\n> @@ -407,9 +409,18 @@ int CameraSensorLegacy::validateSensorDriver()\n>                 pixelArraySize_ = rect.size();\n>         }\n>  \n> +       ret = subdev_->getSelection(pad_, V4L2_SEL_TGT_CROP_BOUNDS, &readableArea_);\n> +       if (ret) {\n> +               readableArea_ = Rectangle(pixelArraySize_);\n> +               LOG(CameraSensor, Warning)\n> +                       << \"The PixelArrayReadableArea property has been defaulted to \"\n> +                       << readableArea_;\n> +               err = -EINVAL;\n> +       }\n> +\n>         ret = subdev_->getSelection(pad_, V4L2_SEL_TGT_CROP_DEFAULT, &activeArea_);\n>         if (ret) {\n> -               activeArea_ = Rectangle(pixelArraySize_);\n> +               activeArea_ = readableArea_;\n>                 LOG(CameraSensor, Warning)\n>                         << \"The PixelArrayActiveAreas property has been defaulted to \"\n>                         << activeArea_;\n> @@ -621,6 +632,7 @@ int CameraSensorLegacy::initProperties()\n>         }\n>  \n>         properties_.set(properties::PixelArraySize, pixelArraySize_);\n> +       properties_.set(properties::PixelArrayReadableArea, readableArea_);\n>         properties_.set(properties::PixelArrayActiveAreas, { activeArea_ });\n>  \n>         /* Color filter array pattern, register only for RAW sensors. */\n> @@ -882,16 +894,6 @@ int CameraSensorLegacy::sensorInfo(IPACameraSensorInfo *info) const\n>                         << \"The analogue crop rectangle has been defaulted to the active area size\";\n>         }\n>  \n> -       /*\n> -        * IPACameraSensorInfo::analogCrop::x and IPACameraSensorInfo::analogCrop::y\n> -        * are defined relatively to the active pixel area, while V4L2's\n> -        * TGT_CROP target is defined in respect to the full pixel array.\n> -        *\n> -        * Compensate it by subtracting the active area offset.\n> -        */\n> -       info->analogCrop.x -= activeArea_.x;\n> -       info->analogCrop.y -= activeArea_.y;\n> -\n>         /* The bit depth and image size depend on the currently applied format. */\n>         V4L2SubdeviceFormat format{};\n>         ret = subdev_->getFormat(pad_, &format);\n> diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp\n> index 10eba0331fe8..410edeb68983 100644\n> --- a/src/libcamera/sensor/camera_sensor_raw.cpp\n> +++ b/src/libcamera/sensor/camera_sensor_raw.cpp\n> @@ -416,6 +416,12 @@ std::optional<int> CameraSensorRaw::init()\n>         auto last = std::unique(sizes_.begin(), sizes_.end());\n>         sizes_.erase(last, sizes_.end());\n>  \n> +       /*\n> +        * \\todo Implement querying the physical sensor size based on pad 1,\n> +        * stream 0. See\n> +        * https://lore.kernel.org/linux-media/20260409201501.975242-23-sakari.ailus@linux.intel.com/\n> +        */\n> +\n>         /*\n>          * 3. Query selection rectangles. Retrieve properties, and verify that\n>          * all the expected selection rectangles are supported.\n> @@ -999,16 +1005,6 @@ int CameraSensorRaw::sensorInfo(IPACameraSensorInfo *info) const\n>         if (ret)\n>                 return ret;\n>  \n> -       /*\n> -        * IPACameraSensorInfo::analogCrop::x and IPACameraSensorInfo::analogCrop::y\n> -        * are defined relatively to the active pixel area, while V4L2's\n> -        * TGT_CROP target is defined in respect to the full pixel array.\n> -        *\n> -        * Compensate it by subtracting the active area offset.\n> -        */\n> -       info->analogCrop.x -= activeArea_.x;\n> -       info->analogCrop.y -= activeArea_.y;\n> -\n>         /* The bit depth and image size depend on the currently applied format. */\n>         V4L2SubdeviceFormat format{};\n>         ret = subdev_->getFormat(streams_.image.source, &format);\n> -- \n> 2.53.0\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 E67E6C3323\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Jul 2026 08:42:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B42B066060;\n\tTue,  7 Jul 2026 10:42:47 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 22FF165FA2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Jul 2026 10:42:46 +0200 (CEST)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:641e:b4cb:119f:3a])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id AE633673;\n\tTue,  7 Jul 2026 10:41:56 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"V7/UlvL7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1783413717;\n\tbh=vhZdPCr+xgVcY51dG1cewkkvVykFJryC02lAwlPhxmQ=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=V7/UlvL7VQJxk0vUuClE/IAoRt7kKyO3NKnhvcGR4+qf5m4R/SPCCN4co+I4KSVi0\n\tCiURlQk/w+Acm6j8Fk2+CjtmRfzyIs4BM0rb3oJB+69xD82itWH+j4SsbtcEVlSfWy\n\t8EEXqboCA2rQrNfiWYQhkSYEn3JSsNN1+yaAU4/c=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260616120828.375547-2-stefan.klug@ideasonboard.com>","References":"<20260616120828.375547-1-stefan.klug@ideasonboard.com>\n\t<20260616120828.375547-2-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v1 1/2] libcamera: Clarify meaning of PixelArraySize and\n\tother rectangles","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 07 Jul 2026 17:42:39 +0900","Message-ID":"<178341375901.292172.15649263706190620419@neptunite.rasen.tech>","User-Agent":"alot/0.0.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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":39632,"web_url":"https://patchwork.libcamera.org/comment/39632/","msgid":"<ak4cr7AX2Tia57v8@zed>","date":"2026-07-08T10:22:35","subject":"Re: [PATCH v1 1/2] libcamera: Clarify meaning of PixelArraySize and\n\tother rectangles","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Stefan\n\nOn Tue, Jun 16, 2026 at 02:08:14PM +0200, Stefan Klug wrote:\n> Current documented behavior for PixelArraySize is to report the readable\n> array size of the sensor data. If the readable array is offset relative\n> to the physical sensor array, all related rectangles (ScalerCrop,\n> PixelArrayActiveAreas) shall be reported relative to PixelArraySize.\n>\n> However no known pipeline and IPA implements it that way. All\n> pipelines/IPAs treat PixelArraySize as the physical sensor size and\n> handle the rectangles relative to that size.\n>\n> Adjust the documentation to fit the actual implementations. Add another\n> property named PixelArrayReadableArea to convey the information that\n> PixelArraySize was intended for.\n>\n> This has the added benefit that all rectangles are relative to the\n> physical sensor array, which is necessary to align tuning data like lens\n> shading correction.\n>\n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n>\n> ---\n>\n> ToDo:\n> - Implement the expected behavior in CameraSensorRaw\n> ---\n>  include/libcamera/ipa/core.mojom              |   2 +-\n>  src/libcamera/property_ids_core.yaml          | 116 ++++++++++--------\n>  src/libcamera/sensor/camera_sensor_legacy.cpp |  26 ++--\n>  src/libcamera/sensor/camera_sensor_raw.cpp    |  16 +--\n>  4 files changed, 89 insertions(+), 71 deletions(-)\n>\n> diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom\n> index bce797245829..5da780f5d256 100644\n> --- a/include/libcamera/ipa/core.mojom\n> +++ b/include/libcamera/ipa/core.mojom\n> @@ -154,7 +154,7 @@ module libcamera;\n>\n>  /**\n>   * \\var IPACameraSensorInfo::activeAreaSize\n> - * \\brief The size of the pixel array active area of the sensor\n> + * \\brief The size of the physical pixel array of the sensor in pixels\n\nYou should change the description in the next patch, as you're not yet\nmodifying CameraSensorLegacy::sensorInfo()\n\n>   */\n>\n>  /**\n> diff --git a/src/libcamera/property_ids_core.yaml b/src/libcamera/property_ids_core.yaml\n> index d5b3d309c055..96c85f9233fd 100644\n> --- a/src/libcamera/property_ids_core.yaml\n> +++ b/src/libcamera/property_ids_core.yaml\n> @@ -427,11 +427,29 @@ controls:\n>    - PixelArraySize:\n>        type: Size\n>        description: |\n> -        The camera sensor pixel array readable area vertical and horizontal\n> -        sizes, in pixels.\n> +        The camera sensor pixel array vertical and horizontal sizes, in pixels.\n>\n> -        The PixelArraySize property defines the size in pixel units of the\n> -        readable part of full pixel array matrix, including optical black\n> +        The PixelArraySize property defines the size in pixel units of the full\n> +        pixel array matrix. It is often not be possible to capture the whole\n> +        physical pixel array. For the largest readable area \\see\n> +        PixelArrayReadableArea.\n\nWhat about just:\n\n        The PixelArraySize property defines the size in pixel units of the full\n        pixel array matrix including readable and non-readable pixels.\n\n> +\n> +        This defines a rectangle whose top-left corner is placed in position (0,\n\ns/This/This property/\n\n> +        0) and whose vertical and horizontal sizes are defined by this property.\n\nIf you want to make it about rectangles:\n\n        This property defines the horizontal and vertical sizes of a\n        rectangle whose top-left corner is placed in position (0, 0).\n\n> +        All other rectangles that describe portions of the pixel array, such as\n> +        the optical black pixels rectangles and active pixel areas, are defined\n\nShould we name the properties instead of just describing them ?\n\n        All the other properties that describe portions of the pixel\n        array such as PixelArrayOpticalBlackRectangles, PixelArrayReadableArea\n        and PixelArrayActiveAreas are defined relatively to this rectangle.\n\n> +        relatively to this rectangle.\n> +\n> +        \\todo Rename this property to Size once we will have property\n> +              categories (i.e. Properties::PixelArray::Size)\n> +\n> +  - PixelArrayReadableArea:\n> +      type: Rectangle\n> +      description: |\n> +        The camera sensor pixel array readable area.\n> +\n> +        The PixelArrayReadableArea property defines the rectangle in pixel units\n> +        of the readable part of full pixel array matrix, including optical black\n>          pixels used for calibration, pixels which are not considered valid for\n>          capture and active pixels containing valid image data.\n\nI understand that the description of PixelArraySize now says that all\nother rectangles are defined relatively to it, but should we repeat it\nor not ?\n\n        The PixelArrayReadableArea property defines the rectangle in\n        pixel units relatively to PixelArraySize of the readable part\n        of full pixel array matrix, including optical black\n\nSame for PixelArrayOpticalBlackRectangles\n\nFTR the PixelArrayActiveAreas property already does that.\n\nShould we say that PixelArrayOpticalBlackRectangles and PixelArrayActiveAreas\nare always contained in PixelArrayReadableArea ?\n\n>\n> @@ -442,23 +460,25 @@ controls:\n>\n>          For example, let's consider a pixel array matrix assembled as follows\n>\n> -             +--------------------------------------------------+\n> -             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> -             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> +                          PixelArraySize.width\n> +             /--------------------------------------------------/\n> +             +--------------------------------------------------+ /\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| |\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| | PixelArraySize.height\n>               ...          ...           ...      ...          ...\n>\n>               ...          ...           ...      ...          ...\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx|\n> -             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> -             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> -             +--------------------------------------------------+\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| |\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| |\n> +             +--------------------------------------------------+ /\n>\n>          starting with two lines of non-readable pixels (x), followed by N lines\n>          of readable data (D) surrounded by two columns of non-readable pixels on\n> @@ -467,35 +487,32 @@ controls:\n>          sizes of the largest possible buffer of raw data that can be presented\n>          to applications.\n>\n> -                             PixelArraySize.width\n> -               /----------------------------------------------/\n> -               +----------------------------------------------+ /\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| | PixelArraySize.height\n> -               ...        ...           ...      ...        ...\n> -               ...        ...           ...      ...        ...\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               |DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD| |\n> -               +----------------------------------------------+ /\n> +                          PixelArrayReadableArea.width\n> +                /--------------------------------------------/\n> +                PixelArrayReadableArea.x\n> +             +--o-----------------------------------------------+\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> +             oxxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| / PixelArrayReadableArea.y\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| | PixelArrayReadableArea.height\n> +             ...          ...           ...      ...          ...\n>\n> -        This defines a rectangle whose top-left corner is placed in position (0,\n> -        0) and whose vertical and horizontal sizes are defined by this property.\n> -        All other rectangles that describe portions of the pixel array, such as\n> -        the optical black pixels rectangles and active pixel areas, are defined\n> -        relatively to this rectangle.\n> +             ...          ...           ...      ...          ...\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| |\n> +             |xxDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDxx| /\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> +             |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|\n> +             +--------------------------------------------------+\n>\n>          All the coordinates are expressed relative to the default sensor readout\n>          direction, without any transformation (such as horizontal and vertical\n>          flipping) applied. When mapping them to the raw pixel buffer,\n>          applications shall take any configured transformation into account.\n>\n> -        \\todo Rename this property to Size once we will have property\n> -              categories (i.e. Properties::PixelArray::Size)\n> -\n>    - PixelArrayOpticalBlackRectangles:\n>        type: Rectangle\n>        size: [n]\n> @@ -519,7 +536,7 @@ controls:\n>          they could be positioned too close to the chip margins or to the optical\n>          black shielding placed on top of optical black pixels.\n>\n> -                             PixelArraySize.width\n> +                             PixelArrayReadableArea.width\n>                 /----------------------------------------------/\n>                    x1                                       x2\n>                 +--o---------------------------------------o---+ /\n> @@ -532,7 +549,7 @@ controls:\n>                 |IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII| |\n>                 |IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII| |\n>              y3 |IIOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOOII| |\n> -               |IIOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOOII| | PixelArraySize.height\n> +               |IIOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOOII| | PixelArrayReadableArea.height\n>                 |IIOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOOII| |\n>                 ...          ...           ...     ...       ...\n>                 ...          ...           ...     ...       ...\n> @@ -560,7 +577,7 @@ controls:\n>          skips the invalid lines and columns, producing the following data\n>          buffer, when captured to memory\n>\n> -                             PixelArraySize.width\n> +                             PixelArrayReadableArea.width\n>                 /----------------------------------------------/\n>                                                             x1\n>                 +--------------------------------------------o-+ /\n> @@ -570,7 +587,7 @@ controls:\n>                 |OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO| |\n>              y1 oOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOO| |\n>                 |OOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOO| |\n> -               |OOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOO| | PixelArraySize.height\n> +               |OOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOO| | PixelArrayReadableArea.height\n>                 ...       ...          ...       ...         ... |\n>                 ...       ...          ...       ...         ... |\n>                 |OOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPOO| |\n> @@ -578,14 +595,17 @@ controls:\n>                 +----------------------------------------------+ /\n>\n>          then the invalid lines and columns should not be reported as part of the\n> -        PixelArraySize property in first place.\n> +        PixelArrayReadableArea property in first place. As the coordinates of\n> +        PixelArrayReadableArea are relative to the physical pixel array, care\n> +        must be taken to report it in a way that the valid pixel data maps to\n> +        the correct physical position.\n>\n>          In this case, the position of the black pixel rectangles will be\n>\n>              PixelArrayOpticalBlackRectangles = {\n> -               { 0, 0, y1 + 1, PixelArraySize[0] },\n> -               { 0, y1, 2, PixelArraySize[1] - y1 + 1 },\n> -               { x1, y1, 2, PixelArraySize[1] - y1 + 1 },\n> +               { 0, 0, PixelArrayReadableArea.width, y1 + 1 },\n\nshould the vertical height be 'y1 - 1' ?\n\n> +               { 0, y1, 2, PixelArrayReadableArea.height - y1 + 1 },\n> +               { x1, y1, 2, PixelArrayReadableArea.height - y1 + 1 },\n>              };\n>\n>          \\todo Rename this property to Size once we will have property\n> diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp\n> index 6a683821f219..482e387d3b24 100644\n> --- a/src/libcamera/sensor/camera_sensor_legacy.cpp\n> +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp\n> @@ -38,6 +38,7 @@\n>  #include \"libcamera/internal/media_device.h\"\n>  #include \"libcamera/internal/sysfs.h\"\n>  #include \"libcamera/internal/v4l2_subdevice.h\"\n> +#include \"linux/v4l2-common.h\"\n\nlibcamera/internal/v4l2_subdevice.h includes include/linux/v4l2-subdev.h\nwhich includes v4l2-common.h\n\n>\n>  namespace libcamera {\n>\n> @@ -131,6 +132,7 @@ private:\n>  \tcontrols::draft::TestPatternModeEnum testPatternMode_;\n>\n>  \tSize pixelArraySize_;\n> +\tRectangle readableArea_;\n>  \tRectangle activeArea_;\n>  \tconst BayerFormat *bayerFormat_;\n>  \tbool supportFlips_;\n> @@ -390,7 +392,7 @@ int CameraSensorLegacy::validateSensorDriver()\n>  \t * test platforms have been updated.\n>  \t */\n>  \tRectangle rect;\n> -\tint ret = subdev_->getSelection(pad_, V4L2_SEL_TGT_CROP_BOUNDS, &rect);\n> +\tint ret = subdev_->getSelection(pad_, V4L2_SEL_TGT_NATIVE_SIZE, &rect);\n>  \tif (ret) {\n>  \t\t/*\n>  \t\t * Default the pixel array size to the largest size supported\n> @@ -407,9 +409,18 @@ int CameraSensorLegacy::validateSensorDriver()\n>  \t\tpixelArraySize_ = rect.size();\n>  \t}\n>\n> +\tret = subdev_->getSelection(pad_, V4L2_SEL_TGT_CROP_BOUNDS, &readableArea_);\n> +\tif (ret) {\n> +\t\treadableArea_ = Rectangle(pixelArraySize_);\n> +\t\tLOG(CameraSensor, Warning)\n> +\t\t\t<< \"The PixelArrayReadableArea property has been defaulted to \"\n> +\t\t\t<< readableArea_;\n> +\t\terr = -EINVAL;\n> +\t}\n> +\n>  \tret = subdev_->getSelection(pad_, V4L2_SEL_TGT_CROP_DEFAULT, &activeArea_);\n>  \tif (ret) {\n> -\t\tactiveArea_ = Rectangle(pixelArraySize_);\n> +\t\tactiveArea_ = readableArea_;\n>  \t\tLOG(CameraSensor, Warning)\n>  \t\t\t<< \"The PixelArrayActiveAreas property has been defaulted to \"\n>  \t\t\t<< activeArea_;\n> @@ -621,6 +632,7 @@ int CameraSensorLegacy::initProperties()\n>  \t}\n>\n>  \tproperties_.set(properties::PixelArraySize, pixelArraySize_);\n> +\tproperties_.set(properties::PixelArrayReadableArea, readableArea_);\n>  \tproperties_.set(properties::PixelArrayActiveAreas, { activeArea_ });\n>\n>  \t/* Color filter array pattern, register only for RAW sensors. */\n> @@ -882,16 +894,6 @@ int CameraSensorLegacy::sensorInfo(IPACameraSensorInfo *info) const\n>  \t\t\t<< \"The analogue crop rectangle has been defaulted to the active area size\";\n>  \t}\n>\n> -\t/*\n> -\t * IPACameraSensorInfo::analogCrop::x and IPACameraSensorInfo::analogCrop::y\n> -\t * are defined relatively to the active pixel area, while V4L2's\n> -\t * TGT_CROP target is defined in respect to the full pixel array.\n> -\t *\n> -\t * Compensate it by subtracting the active area offset.\n> -\t */\n> -\tinfo->analogCrop.x -= activeArea_.x;\n> -\tinfo->analogCrop.y -= activeArea_.y;\n> -\n\nThe documentation of IPACameraSensorInfo::analogCrop still reports:\n\n * The analog crop rectangle top-left corner is defined as the displacement\n * from the top-left corner of the pixel array active area. The rectangle\n\nIf you want to make it relative to the physical size you should update\nthe documentation.\n\nI would do so (and move this hunk) to the next patch ?\n\n>  \t/* The bit depth and image size depend on the currently applied format. */\n>  \tV4L2SubdeviceFormat format{};\n>  \tret = subdev_->getFormat(pad_, &format);\n> diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp\n> index 10eba0331fe8..410edeb68983 100644\n> --- a/src/libcamera/sensor/camera_sensor_raw.cpp\n> +++ b/src/libcamera/sensor/camera_sensor_raw.cpp\n> @@ -416,6 +416,12 @@ std::optional<int> CameraSensorRaw::init()\n>  \tauto last = std::unique(sizes_.begin(), sizes_.end());\n>  \tsizes_.erase(last, sizes_.end());\n>\n> +\t/*\n> +\t * \\todo Implement querying the physical sensor size based on pad 1,\n> +\t * stream 0. See\n> +\t * https://lore.kernel.org/linux-media/20260409201501.975242-23-sakari.ailus@linux.intel.com/\n> +\t */\n> +\n>  \t/*\n>  \t * 3. Query selection rectangles. Retrieve properties, and verify that\n>  \t * all the expected selection rectangles are supported.\n> @@ -999,16 +1005,6 @@ int CameraSensorRaw::sensorInfo(IPACameraSensorInfo *info) const\n>  \tif (ret)\n>  \t\treturn ret;\n>\n> -\t/*\n> -\t * IPACameraSensorInfo::analogCrop::x and IPACameraSensorInfo::analogCrop::y\n> -\t * are defined relatively to the active pixel area, while V4L2's\n> -\t * TGT_CROP target is defined in respect to the full pixel array.\n> -\t *\n> -\t * Compensate it by subtracting the active area offset.\n> -\t */\n> -\tinfo->analogCrop.x -= activeArea_.x;\n> -\tinfo->analogCrop.y -= activeArea_.y;\n> -\n\nSame here, even if this needs to be reworked anyway\n\n>  \t/* The bit depth and image size depend on the currently applied format. */\n>  \tV4L2SubdeviceFormat format{};\n>  \tret = subdev_->getFormat(streams_.image.source, &format);\n> --\n> 2.53.0\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 A63F9C3306\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  8 Jul 2026 10:22:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CA19A6607C;\n\tWed,  8 Jul 2026 12:22:38 +0200 (CEST)","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 2A14666003\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 Jul 2026 12:22:38 +0200 (CEST)","from ideasonboard.com (93-46-82-201.ip106.fastwebnet.it\n\t[93.46.82.201])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 526EDE9C;\n\tWed,  8 Jul 2026 12:21:48 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"YVD1QWeb\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1783506108;\n\tbh=SnwSFLlRu0e3rD+lk4f2kDx6o4QNG88izYLVqfIWdTY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=YVD1QWebSs9i7N4Py8T46tEf3tzqhvQRA1HtEDXJNPACStDqai5BsRRX32FXaC1sA\n\t2F4muQ3EC6gc2G6hOXFUKc5rlet+L9dkzdmjn45i/xm7yhqszsPqW6bCtEz2RMIZCE\n\tfSTxx3fDCQJVGAqeEqqtpSrc51KyBVjXt5oia6b4=","Date":"Wed, 8 Jul 2026 12:22:35 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v1 1/2] libcamera: Clarify meaning of PixelArraySize and\n\tother rectangles","Message-ID":"<ak4cr7AX2Tia57v8@zed>","References":"<20260616120828.375547-1-stefan.klug@ideasonboard.com>\n\t<20260616120828.375547-2-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20260616120828.375547-2-stefan.klug@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]