Show a patch.

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

{
    "id": 10823,
    "url": "https://patchwork.libcamera.org/api/patches/10823/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10823/",
    "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": "<20210105190522.682324-10-jacopo@jmondi.org>",
    "date": "2021-01-05T19:05:19",
    "name": "[libcamera-devel,09/12] libcamera: ipu3: Handle ScalerCrop",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "4bb7ca23ce3eb7658f3f98400ccf9fa25cbab8fd",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": {
        "id": 15,
        "url": "https://patchwork.libcamera.org/api/users/15/?format=api",
        "username": "jmondi",
        "first_name": "Jacopo",
        "last_name": "Mondi",
        "email": "jacopo@jmondi.org"
    },
    "mbox": "https://patchwork.libcamera.org/patch/10823/mbox/",
    "series": [
        {
            "id": 1568,
            "url": "https://patchwork.libcamera.org/api/series/1568/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1568",
            "date": "2021-01-05T19:05:10",
            "name": "android: Exposure times + scaler crop + android metadata",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1568/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10823/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10823/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 80686C0F1A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 Jan 2021 19:05:21 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 54DDA6345C;\n\tTue,  5 Jan 2021 20:05:21 +0100 (CET)",
            "from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D2FC633EF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Jan 2021 20:05:17 +0100 (CET)",
            "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay11.mail.gandi.net (Postfix) with ESMTPSA id 20692100002\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Jan 2021 19:05:16 +0000 (UTC)"
        ],
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue,  5 Jan 2021 20:05:19 +0100",
        "Message-Id": "<20210105190522.682324-10-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.29.2",
        "In-Reply-To": "<20210105190522.682324-1-jacopo@jmondi.org>",
        "References": "<20210105190522.682324-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 09/12] libcamera: ipu3: Handle ScalerCrop",
        "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": "Add support for caching the value of control::ScalerCrop to return\nit in the request metadata.\n\nNo cropping is currently applied on the input video device, the control\nvalue is returned in the metadata pack as it is received.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 22 ++++++++++++++++++++--\n 1 file changed, 20 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex f1329ffb0463..381524bb3499 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -66,6 +66,7 @@ public:\n \tStream rawStream_;\n \n \tint32_t exposureTime_;\n+\tRectangle scalerCrop_;\n };\n \n class IPU3CameraConfiguration : public CameraConfiguration\n@@ -75,6 +76,7 @@ public:\n \n \tStatus validate() override;\n \n+\tconst Size &cio2Size() const { return cio2Configuration_.size; }\n \tconst StreamConfiguration &cio2Format() const { return cio2Configuration_; }\n \tconst ImgUDevice::PipeConfig imguConfig() const { return pipeConfig_; }\n \n@@ -468,12 +470,19 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n \t * Pass the requested stream size to the CIO2 unit and get back the\n \t * adjusted format to be propagated to the ImgU output devices.\n \t */\n-\tconst Size &sensorSize = config->cio2Format().size;\n \tV4L2DeviceFormat cio2Format;\n-\tret = cio2->configure(sensorSize, &cio2Format);\n+\tret = cio2->configure(config->cio2Size(), &cio2Format);\n \tif (ret)\n \t\treturn ret;\n \n+\t/* Initialize the scaler crop using the sensor's analogue crop. */\n+\tCameraSensorInfo sensorInfo;\n+\tret = cio2->sensor()->sensorInfo(&sensorInfo);\n+\tif (ret)\n+\t\t/* Use the requested CIO2 output size as fallback. */\n+\t\tsensorInfo.analogCrop = Rectangle(config->cio2Size());\n+\tdata->scalerCrop_ = sensorInfo.analogCrop;\n+\n \t/*\n \t * If the ImgU gets configured, its driver seems to expect that\n \t * buffers will be queued to its outputs, as otherwise the next\n@@ -656,6 +665,14 @@ int PipelineHandlerIPU3::queueRequestDevice(Camera *camera, Request *request)\n \tIPU3CameraData *data = cameraData(camera);\n \tint error = 0;\n \n+\tControlList &controls = request->controls();\n+\tif (controls.contains(controls::ScalerCrop))\n+\t\t/*\n+\t\t * \\todo No scaling is applied. Just return the value in the\n+\t\t * request metadata as it is.\n+\t\t */\n+\t\tdata->scalerCrop_ = controls.get(controls::ScalerCrop);\n+\n \t/*\n \t * Queue a buffer on the CIO2, using the raw stream buffer provided in\n \t * the request, if any, or a CIO2 internal buffer otherwise.\n@@ -991,6 +1008,7 @@ void IPU3CameraData::imguOutputBufferReady(FrameBuffer *buffer)\n \t/* Mark the request as complete. */\n \trequest->metadata().set(controls::draft::PipelineDepth, 3);\n \trequest->metadata().set(controls::ExposureTime, exposureTime_);\n+\trequest->metadata().set(controls::ScalerCrop, scalerCrop_);\n \tpipe_->completeRequest(request);\n }\n \n",
    "prefixes": [
        "libcamera-devel",
        "09/12"
    ]
}