Show a patch.

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

{
    "id": 3524,
    "url": "https://patchwork.libcamera.org/api/patches/3524/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/3524/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20200424215304.558317-7-jacopo@jmondi.org>",
    "date": "2020-04-24T21:52:57",
    "name": "[libcamera-devel,v3,06/13] libcamera: camera_sensor: Collect pixel array properties",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "60a1e36d818a27a430399f0ad7a2c91296acf7ac",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/3524/mbox/",
    "series": [
        {
            "id": 822,
            "url": "https://patchwork.libcamera.org/api/series/822/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=822",
            "date": "2020-04-24T21:52:51",
            "name": "libcamera: Add CameraSensorInfo",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/822/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/3524/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/3524/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4B52762F37\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Apr 2020 23:50:10 +0200 (CEST)",
            "from uno.homenet.telecomitalia.it\n\t(host240-55-dynamic.3-87-r.retail.telecomitalia.it [87.3.55.240])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay3-d.mail.gandi.net (Postfix) with ESMTPSA id A0B1E60004;\n\tFri, 24 Apr 2020 21:50:09 +0000 (UTC)"
        ],
        "X-Originating-IP": "87.3.55.240",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 24 Apr 2020 23:52:57 +0200",
        "Message-Id": "<20200424215304.558317-7-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.26.1",
        "In-Reply-To": "<20200424215304.558317-1-jacopo@jmondi.org>",
        "References": "<20200424215304.558317-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 06/13] libcamera: camera_sensor:\n\tCollect 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>",
        "X-List-Received-Date": "Fri, 24 Apr 2020 21:50:10 -0000"
    },
    "content": "Collect the sensor pixel array properties by retrieving the subdevice\nnative size and active pixel array size.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/camera_sensor.cpp | 23 +++++++++++++++++++++++\n 1 file changed, 23 insertions(+)",
    "diff": "diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 8d7abc7147a7..a54751fecf5a 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -169,6 +169,29 @@ int CameraSensor::initProperties()\n \t\tpropertyValue = rotationControl->second.def().get<int32_t>();\n \tproperties_.set(properties::Rotation, propertyValue);\n \n+\t/*\n+\t * Sensor pixel array properties. Conditionally register them if the\n+\t * sub-device provides support for the selection API.\n+\t */\n+\tSize size{};\n+\tint ret = subdev_->getNativeSize(0, &size);\n+\tif (ret && ret != -ENOTTY)\n+\t\treturn ret;\n+\tif (!ret)\n+\t\tproperties_.set(properties::PixelArray, { static_cast<int>(size.width),\n+\t\t\t\t\t\t\t  static_cast<int>(size.height) });\n+\n+\t/*\n+\t * \\todo The sub-device API only support a single active area rectangle\n+\t */\n+\tRectangle rect{};\n+\tret = subdev_->getActiveArea(0, &rect);\n+\tif (ret && ret != -ENOTTY)\n+\t\treturn ret;\n+\tif (!ret)\n+\t\tproperties_.set(properties::ActiveAreas, { rect.x, rect.y,\n+\t\t\t\t\t\t\t   static_cast<int>(rect.width),\n+\t\t\t\t\t\t\t   static_cast<int>(rect.height) });\n \treturn 0;\n }\n \n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "06/13"
    ]
}