Show a patch.

GET /api/1.1/patches/11181/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 11181,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/11181/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11181/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20210208013805.30842-1-laurent.pinchart@ideasonboard.com>",
    "date": "2021-02-08T01:38:05",
    "name": "[libcamera-devel] libcamera: camera_sensor: Use active area size as resolution",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "827ca2e911bd0e21fa43ceb44da56b112a94cdea",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": {
        "id": 14,
        "url": "https://patchwork.libcamera.org/api/1.1/users/14/?format=api",
        "username": "pinchartl",
        "first_name": "Laurent",
        "last_name": "Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/11181/mbox/",
    "series": [
        {
            "id": 1661,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1661/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1661",
            "date": "2021-02-08T01:38:05",
            "name": "[libcamera-devel] libcamera: camera_sensor: Use active area size as resolution",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1661/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11181/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11181/checks/",
    "tags": {},
    "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 D8563BD162\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  8 Feb 2021 01:38:35 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 573C760300;\n\tMon,  8 Feb 2021 02:38:35 +0100 (CET)",
            "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 9084960106\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Feb 2021 02:38:33 +0100 (CET)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 62CF83D7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Feb 2021 02:38:32 +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=\"URkVQQv3\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1612748312;\n\tbh=9yHqxdNo2RSD12Y5FsVxryjExNdkAwHQl0u1hjbyVZs=;\n\th=From:To:Subject:Date:From;\n\tb=URkVQQv3CFkBDTbyao6zQOhTTf6MOhU3VAhRc3/CF/3jVKu4aBP2YtlBAro/guJmB\n\tnzHMwNYy/LBBHpDGjE/Z19Ni33ozj1ehU+GYSFi9MPCimaC+9DIjqO+zBqrY9Dd7NB\n\tN5tJBdVXcVy8GwIP847YvnlcA6UUnl7pe3PAways=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  8 Feb 2021 03:38:05 +0200",
        "Message-Id": "<20210208013805.30842-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.28.0",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH] libcamera: camera_sensor: Use active area\n\tsize as resolution",
        "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>",
        "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>"
    },
    "content": "When a sensor can upscale the image, the native sensor resolution isn't\nequal to the largest size reported by the sensor. Use the active area\nsize instead, and default it to the largest enumerated size if the crop\nrectangle targets are not supported.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/camera_sensor.h |  3 +--\n src/libcamera/camera_sensor.cpp            | 16 ++++++++--------\n 2 files changed, 9 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h\nindex c8f81882a958..74c35d1c8922 100644\n--- a/include/libcamera/internal/camera_sensor.h\n+++ b/include/libcamera/internal/camera_sensor.h\n@@ -55,7 +55,7 @@ public:\n \tconst MediaEntity *entity() const { return entity_; }\n \tconst std::vector<unsigned int> &mbusCodes() const { return mbusCodes_; }\n \tconst std::vector<Size> &sizes() const { return sizes_; }\n-\tconst Size &resolution() const { return resolution_; }\n+\tSize resolution() const { return activeArea_.size(); }\n \n \tV4L2SubdeviceFormat getFormat(const std::vector<unsigned int> &mbusCodes,\n \t\t\t\t      const Size &size) const;\n@@ -87,7 +87,6 @@ private:\n \tstd::string id_;\n \n \tV4L2Subdevice::Formats formats_;\n-\tSize resolution_;\n \tstd::vector<unsigned int> mbusCodes_;\n \tstd::vector<Size> sizes_;\n \ndiff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex c9e8d49b7935..59834ffcdd94 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -234,10 +234,12 @@ int CameraSensor::init()\n \tsizes_.erase(last, sizes_.end());\n \n \t/*\n-\t * The sizes_ vector is sorted in ascending order, the resolution is\n-\t * thus the last element of the vector.\n+\t * Initialize the pixel array size as the largest size supported by the\n+\t * sensor. It will be overridden later using the crop bounds. The\n+\t * sizes_ vector is sorted in ascending order, the largest size is thus\n+\t * the last element of the vector.\n \t */\n-\tresolution_ = sizes_.back();\n+\tpixelArraySize_ = sizes_.back();\n \n \t/*\n \t * VIMC is a bit special, as it does not yet support all the mandatory\n@@ -307,14 +309,13 @@ int CameraSensor::validateSensorDriver()\n \tRectangle rect;\n \tint ret = subdev_->getSelection(pad_, V4L2_SEL_TGT_CROP_BOUNDS, &rect);\n \tif (ret) {\n-\t\trect = Rectangle(resolution());\n \t\tLOG(CameraSensor, Warning)\n \t\t\t<< \"The PixelArraySize property has been defaulted to \"\n-\t\t\t<< rect.toString();\n+\t\t\t<< pixelArraySize_.toString();\n \t\terr = -EINVAL;\n+\t} else {\n+\t\tpixelArraySize_ = rect.size();\n \t}\n-\tpixelArraySize_.width = rect.width;\n-\tpixelArraySize_.height = rect.height;\n \n \tret = subdev_->getSelection(pad_, V4L2_SEL_TGT_CROP_DEFAULT, &activeArea_);\n \tif (ret) {\n@@ -380,7 +381,6 @@ int CameraSensor::validateSensorDriver()\n  */\n void CameraSensor::initVimcDefaultProperties()\n {\n-\tpixelArraySize_ = resolution();\n \tactiveArea_ = Rectangle(pixelArraySize_);\n }\n \n",
    "prefixes": [
        "libcamera-devel"
    ]
}