Show a patch.

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

{
    "id": 20833,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/20833/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20833/",
    "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": "<20240808102346.13065-3-naush@raspberrypi.com>",
    "date": "2024-08-08T10:23:41",
    "name": "[v1,2/7] pipeline: rpi: Remove CameraData::scalerCrop_",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f96290337c925d4f9690de06eee9ca9f11c89da1",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/20833/mbox/",
    "series": [
        {
            "id": 4501,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4501/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4501",
            "date": "2024-08-08T10:23:39",
            "name": "Raspberry Pi: Add controls::rpi::ScalerCrops",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4501/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/20833/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20833/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 C6DE0C324E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  8 Aug 2024 10:23:59 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3E822633B1;\n\tThu,  8 Aug 2024 12:23:53 +0200 (CEST)",
            "from mail-wr1-x432.google.com (mail-wr1-x432.google.com\n\t[IPv6:2a00:1450:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F22AF63382\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 Aug 2024 12:23:47 +0200 (CEST)",
            "by mail-wr1-x432.google.com with SMTP id\n\tffacd0b85a97d-368380828d6so427060f8f.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 08 Aug 2024 03:23:47 -0700 (PDT)",
            "from naush-laptop.pitowers.org ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-36d272290c2sm1404234f8f.92.2024.08.08.03.23.46\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 08 Aug 2024 03:23:46 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"pnCrsCfo\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1723112627; x=1723717427;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=8sYDQCCj57XZitX0+7BLhUA3FP4/j7VspqlO+P/HyUY=;\n\tb=pnCrsCfoMwdi4BiksWzLh3HmTvrvu61ap6MPixRnt1Iat5Azq3r4L9dVoXeFjGGTG/\n\tEaejBs8+esGeCrgWbpAtslCW4e5lyfSOJjSAIW8sn24Ak5DiXg8+8MUtLOD4cVIOKJL0\n\tVfm789Omu9zLKhGy6Ek6bEk0s7m08C1oFKhmY8eW9xBvwwNsBsG3uM64C+Mafn6NEZ0O\n\tmDMpEuIXrdcKfxB7I8Asijcgt1GVSQ4YBP4i4reOMqQ1arcUIBrWgB8BJsXo7AegqjsZ\n\tokQAEX9b7B/Y2Q4cEMTGf4IIllpEkzIIwprCQcZUytSq56kiBREp4G1uJviUdPKDS9X3\n\tYjpg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1723112627; x=1723717427;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=8sYDQCCj57XZitX0+7BLhUA3FP4/j7VspqlO+P/HyUY=;\n\tb=IfJU1WOxoONU2UOrM15M7HQopBKzpC9iqWduYRsF/cul2N4vkSCtVp5LGrbEh3OiE1\n\t6tldT/e+L/5jFohn5KylTfdvJ6Vuv5SdgEi6bMQryCFMxGaOZsuv5VdxMz6HYPoKG3RF\n\tKHnDSynoBlEJXNVtP2cu/xcy5AIrui6rGvcBDhD2nr0xNvDNV3f78i9j77XvqNi57nAR\n\tqGhh+48nk9RcSK0WuXKkEZR0SN82B0VibP1sdzcFTYR/ypHuYqenTKiEObbq7s518qqn\n\t6kp1kfJ5BkA9Hjz5vwqOMmU25I1nChh1QCYCZY7tRsOXjMLz0L0NNfWXh8JgfIUpEPSv\n\t4HOQ==",
        "X-Gm-Message-State": "AOJu0YxKMCR/XG+9TvffvRpyH2iK0p0WVu1BEjKVrWA/njE0hQVADLRE\n\tpSYcdahN3/zimUkPOr9tnfA/1f785fYLOR7ofj/K07Ais6aw07B2AdCkoiBH18kMApkLx3a7jRb\n\ti",
        "X-Google-Smtp-Source": "AGHT+IHuzKcbdu+6yEQxqqSvyqM2vmBsibvD9At9FjqwgVKkEMETk8yCcbII2fgdlLYqBU9OHgHX5g==",
        "X-Received": "by 2002:adf:ec85:0:b0:367:434f:ca9a with SMTP id\n\tffacd0b85a97d-36d2728fea8mr882259f8f.0.1723112627142; \n\tThu, 08 Aug 2024 03:23:47 -0700 (PDT)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Naushir Patuck <naush@raspberrypi.com>",
        "Subject": "[PATCH v1 2/7] pipeline: rpi: Remove CameraData::scalerCrop_",
        "Date": "Thu,  8 Aug 2024 11:23:41 +0100",
        "Message-Id": "<20240808102346.13065-3-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240808102346.13065-1-naush@raspberrypi.com>",
        "References": "<20240808102346.13065-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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>"
    },
    "content": "Do not cache the scalerCrop_ parameter. The cached value is used to\nupdate the request metadata, but since this is not an expensive\noperation (and can only occur once per frame), caching it is of limited\nvalue.\n\nThis will simplify logic in a future commit where we can specify a\ncrop per-output stream.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n .../pipeline/rpi/common/pipeline_base.cpp       | 17 +++--------------\n .../pipeline/rpi/common/pipeline_base.h         |  1 -\n 2 files changed, 3 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\nindex 3041fd1ed9fd..5322fd798a36 100644\n--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n@@ -544,12 +544,6 @@ int PipelineHandlerBase::configure(Camera *camera, CameraConfiguration *config)\n \t\treturn ret;\n \t}\n \n-\t/*\n-\t * Set the scaler crop to the value we are using (scaled to native sensor\n-\t * coordinates).\n-\t */\n-\tdata->scalerCrop_ = data->scaleIspCrop(data->ispCrop_);\n-\n \t/*\n \t * Update the ScalerCropMaximum to the correct value for this camera mode.\n \t * For us, it's the same as the \"analogue crop\".\n@@ -569,7 +563,8 @@ int PipelineHandlerBase::configure(Camera *camera, CameraConfiguration *config)\n \n \t/* Add the ScalerCrop control limits based on the current mode. */\n \tRectangle ispMinCrop = data->scaleIspCrop(Rectangle(data->ispMinCropSize_));\n-\tctrlMap[&controls::ScalerCrop] = ControlInfo(ispMinCrop, data->sensorInfo_.analogCrop, data->scalerCrop_);\n+\tctrlMap[&controls::ScalerCrop] = ControlInfo(ispMinCrop, data->sensorInfo_.analogCrop,\n+\t\t\t\t\t\t     data->scaleIspCrop(data->ispCrop_));\n \n \tdata->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap());\n \n@@ -1321,12 +1316,6 @@ void CameraData::applyScalerCrop(const ControlList &controls)\n \t\t\tispCrop_ = ispCrop;\n \t\t\tplatformSetIspCrop();\n \n-\t\t\t/*\n-\t\t\t * Also update the ScalerCrop in the metadata with what we actually\n-\t\t\t * used. But we must first rescale that from ISP (camera mode) pixels\n-\t\t\t * back into sensor native pixels.\n-\t\t\t */\n-\t\t\tscalerCrop_ = scaleIspCrop(ispCrop_);\n \t\t}\n \t}\n }\n@@ -1483,7 +1472,7 @@ void CameraData::fillRequestMetadata(const ControlList &bufferControls, Request\n \trequest->metadata().set(controls::SensorTimestamp,\n \t\t\t\tbufferControls.get(controls::SensorTimestamp).value_or(0));\n \n-\trequest->metadata().set(controls::ScalerCrop, scalerCrop_);\n+\trequest->metadata().set(controls::ScalerCrop, scaleIspCrop(ispCrop_));\n }\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.h b/src/libcamera/pipeline/rpi/common/pipeline_base.h\nindex f9cecf70f179..5161c16e518f 100644\n--- a/src/libcamera/pipeline/rpi/common/pipeline_base.h\n+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.h\n@@ -134,7 +134,6 @@ public:\n \t/* For handling digital zoom. */\n \tIPACameraSensorInfo sensorInfo_;\n \tRectangle ispCrop_; /* crop in ISP (camera mode) pixels */\n-\tRectangle scalerCrop_; /* crop in sensor native pixels */\n \tSize ispMinCropSize_;\n \n \tunsigned int dropFrameCount_;\n",
    "prefixes": [
        "v1",
        "2/7"
    ]
}