Show a patch.

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

{
    "id": 18101,
    "url": "https://patchwork.libcamera.org/api/patches/18101/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18101/",
    "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": "<20230112110633.25329-1-david.plowman@raspberrypi.com>",
    "date": "2023-01-12T11:06:33",
    "name": "[libcamera-devel] pipeline: raspberrypi: Improve the values reported in the ScalerCrop control",
    "commit_ref": "4133dbe2b3c2a0f06b4382c66a36d7adf9c72a57",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "bc57a1e91fb19b08fdcc054cd47bc6b89816bbab",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18101/mbox/",
    "series": [
        {
            "id": 3704,
            "url": "https://patchwork.libcamera.org/api/series/3704/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3704",
            "date": "2023-01-12T11:06:33",
            "name": "[libcamera-devel] pipeline: raspberrypi: Improve the values reported in the ScalerCrop control",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3704/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18101/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18101/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 86DCAC3240\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Jan 2023 11:06:39 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CA3E4625CF;\n\tThu, 12 Jan 2023 12:06:38 +0100 (CET)",
            "from mail-wm1-x331.google.com (mail-wm1-x331.google.com\n\t[IPv6:2a00:1450:4864:20::331])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4E52361F05\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Jan 2023 12:06:36 +0100 (CET)",
            "by mail-wm1-x331.google.com with SMTP id\n\ti17-20020a05600c355100b003d99434b1cfso14735385wmq.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Jan 2023 03:06:36 -0800 (PST)",
            "from pi4-davidp.pitowers.org\n\t([2a00:1098:3142:14:e4a2:3070:eea4:e434])\n\tby smtp.gmail.com with ESMTPSA id\n\tf11-20020a05600c4e8b00b003d04e4ed873sm29841722wmq.22.2023.01.12.03.06.34\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 12 Jan 2023 03:06:35 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1673521598;\n\tbh=xPiopR120v4Z4oi1OyCyf0x0thBJ4Q7vzttadYgQdbQ=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=F8pySWYBApk0HaJ9zvXzR7rIWb6k83/Fo37H88B/zR2TNBT8k0jUPFRSEVpoWadUd\n\tdansUkQA6JTqk28lHzVIg3WpN9JGvnrPZfq3iOAGt9gcs5UKFDPMiqGA0x3mwgzwAf\n\t/mSvdy9uKFQVP+GO0qIlbonuiDAPMDinauWThotAALqkxurBVBagROlgLw4oAgsZ7G\n\twzqUPeUHZEzOjDCP0T5wly/W19TU76RDv3IkXO3W/lvKcL8pF0bKj9D/YnKwV2/JbJ\n\taTSGvoJZWEuf7XkvHVPyHePFv+c97FjwVLg0/vig7fhwhO7AzBTUihEHDHsc3ZXgSt\n\tGQdh0Sggxo7GQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=FluAGgwqe2Ej6b0HtW8dFkRGtz9mtiy4vnrAJZlJU5I=;\n\tb=s9CFnLLi9CBKAj9Fhb179i5U0UlpWQX2q5///CrLnnB40l5CSTa17yLrMYyTsOIQxk\n\tTY3nhbqab+gMd4OC014SNaCdwl1l5/025pm7XO4Yh0SVo2JwvYoIZHIgQXQ9vdTJmyIV\n\tYKtiNjQ2bwBzcVjMCMBTkJkWhv3FW0WX2O+kTetZybaLVZLu2lYPg1YHit2f5bE+1XWn\n\tdE/kaHp3SRQZwxdHMs9e9UGBgRY78vFTjLhfxst5/V5cwtWeX7H4GEop027u83jeEPYz\n\tXrOnZJBFHEKOA7qO6sQju4oigiZRtEWJFTsomSDV3j3ebtig6yVYDc5P6X39Nd+hjQ4Y\n\tSTeQ=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"s9CFnLLi\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=FluAGgwqe2Ej6b0HtW8dFkRGtz9mtiy4vnrAJZlJU5I=;\n\tb=Wxdc5K5mpLNRaQ8muAMYMjF1U/QSYIZQrC9DoNN67fboYjtCKsmChoHBB34AzHF/7N\n\tcHKLY989UFwM4HLyffSlZYP6lq5yMaMJwjiiLw5y51VG2llp5aCrxWwA6QNpvZARw984\n\tckjRh5ClX4wg9BuKfm6Zn5VHIAsmfr4TGXtXcy+FbXnzIEMzeeph/A6cFlhwLUYr2/Bt\n\t3VbfsiNvMByKIgtn0o4RogdLmjZVQb3Ea3p+oisG0W4UN+irISbYQK43cBuF6sCvDN+n\n\tgSA1sNMYAztfa7TS05jQx289BA8tlFZoUvYk2IWJyVI5K/JNGC0wS+Ko/hFCkDv6dn91\n\tOT9Q==",
        "X-Gm-Message-State": "AFqh2kryi0fyR3QKOurS6j/mAFiVTg2IYfZGMUbsGNAN1FuJG7Vzjm8a\n\tbN1D5efS+Hy2zt5mFmlVJfnOZ+54pGfPb+YZ",
        "X-Google-Smtp-Source": "AMrXdXvML6oVWXJGj4zAfjUSS0X7CX8soeOH80N17VXnBX7uX6eUhrOTN2i2IRrUKuuA4xJLena9uw==",
        "X-Received": "by 2002:a05:600c:34ce:b0:3cf:614e:b587 with SMTP id\n\td14-20020a05600c34ce00b003cf614eb587mr58239064wmq.26.1673521595578; \n\tThu, 12 Jan 2023 03:06:35 -0800 (PST)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 12 Jan 2023 11:06:33 +0000",
        "Message-Id": "<20230112110633.25329-1-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH] pipeline: raspberrypi: Improve the values\n\treported in the ScalerCrop control",
        "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>",
        "From": "David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "David Plowman <david.plowman@raspberrypi.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Previously the x,y offsets in the min/max ScalerCrop control values\nwere zero. Here we make them the same as the sensor's analogue crop\noffset which is I think less misleading.\n\nWith this change, it also seems reasonable to advertise the default\nscaler crop value to be the true default that you will get. This makes\nit possible for applications to see what that value will be without\nhaving to start the camera and wait for frames.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 8569df17..809af4d2 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -905,6 +905,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n \t/* Adjust aspect ratio by providing crops on the input image. */\n \tSize size = unicamFormat.size.boundedToAspectRatio(maxSize);\n \tRectangle crop = size.centeredTo(Rectangle(unicamFormat.size).center());\n+\tRectangle defaultCrop = crop;\n \tdata->ispCrop_ = crop;\n \n \tdata->isp_[Isp::Input].dev()->setSelection(V4L2_SEL_TGT_CROP, &crop);\n@@ -958,9 +959,9 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n \t\tctrlMap.emplace(c.first, c.second);\n \n \t/* Add the ScalerCrop control limits based on the current mode. */\n-\tRectangle ispMinCrop(data->ispMinCropSize_);\n-\tispMinCrop.scaleBy(data->sensorInfo_.analogCrop.size(), data->sensorInfo_.outputSize);\n-\tctrlMap[&controls::ScalerCrop] = ControlInfo(ispMinCrop, Rectangle(data->sensorInfo_.analogCrop.size()));\n+\tRectangle ispMinCrop = data->scaleIspCrop(Rectangle(data->ispMinCropSize_));\n+\tdefaultCrop = data->scaleIspCrop(defaultCrop);\n+\tctrlMap[&controls::ScalerCrop] = ControlInfo(ispMinCrop, data->sensorInfo_.analogCrop, defaultCrop);\n \n \tdata->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap());\n \n",
    "prefixes": [
        "libcamera-devel"
    ]
}