Show a patch.

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

{
    "id": 17543,
    "url": "https://patchwork.libcamera.org/api/patches/17543/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17543/",
    "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": "<20221006131744.5179-3-naush@raspberrypi.com>",
    "date": "2022-10-06T13:17:36",
    "name": "[libcamera-devel,v2,02/10] ipa: raspberrypi: Add minimum and maximum line length fields to CameraMode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "21eec26bd263024529b599599eb2ab1b3923e133",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/17543/mbox/",
    "series": [
        {
            "id": 3537,
            "url": "https://patchwork.libcamera.org/api/series/3537/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3537",
            "date": "2022-10-06T13:17:34",
            "name": "Raspberry Pi: Horizontal blanking control",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/3537/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17543/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17543/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 E906FBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Oct 2022 13:17:58 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9121562D05;\n\tThu,  6 Oct 2022 15:17:58 +0200 (CEST)",
            "from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com\n\t[IPv6:2a00:1450:4864:20::42e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F123062CF1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Oct 2022 15:17:54 +0200 (CEST)",
            "by mail-wr1-x42e.google.com with SMTP id bq9so2690640wrb.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 06 Oct 2022 06:17:54 -0700 (PDT)",
            "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tq18-20020a056000137200b0022cc7c32309sm17986049wrz.115.2022.10.06.06.17.53\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 06 Oct 2022 06:17:53 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665062278;\n\tbh=DfzHQ0bZZY8QgmiGOX9cjtXd5ci7YtVJOuyas16zy9A=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=OfGA84Tqm1hRjLoKxzmNv87R4UK2BULjEhOwKqx8VyPv2RrqqlJYvBAs6V6aRUjNI\n\tgy3twsvvFFfQSBYysrpT4qKp0nGpaf2azRMd8sDtIejrwwPnR/wRqgOhy/IHVFZwXr\n\tbmxcVGkOrxZAc5rSaV740As17vbZq/+SzZhj6hv+ZqEbXocPamqeYFb0opTqLmSw7E\n\tMddrH5hIAt9zPIKkgpQ6FBbVJLsX5NPo21rXmt5PHmtVPH4TL+Dcvn1yUbxpIrzeWa\n\t70K+0ZwXATHYT3fKH5tYdJ8E191pXM1GoVsYLG08/o7JCnUMz6LhHPBINp1wxuCpmZ\n\t3NtXGWqeyhFPA==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\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\tbh=tM2HZQgNPT7c6W3h2GI86+7wXtUs/IeSla0L7MdHmWA=;\n\tb=Lc93DDfiM925gVVxX9JXBk+WI2vnXLKZfPMMl6633tfvypS87nxrP9yMeEmBJnQEPr\n\taU0gXmBIFoKlMQ0YF0IoXiImN2Eb0dlwy4DLUJQtLlVtmiodoQ/WRflmVCu8Fwktlf2f\n\tsotMJFElMkS2v0KHWbS/SiMduFQWRFDEnW/AWFkU6QC8x0SEgZflibXXyw5KwvT6yEBY\n\trMqM/RT5Ef7C4e0UCJBsqcHrgMDCo9+O1Vg7o5P56jWsFkAKlhbB7wX2l8pANsJfIs5g\n\ttQ7NoHdJEiffWEdwVcI0DJrWoj83qUHp7sWrzGA+rxSerO9yEb1JJzPAEePIeuVQCiB0\n\tqLGw=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"Lc93DDfi\"; 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:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date;\n\tbh=tM2HZQgNPT7c6W3h2GI86+7wXtUs/IeSla0L7MdHmWA=;\n\tb=IJhkT7akgX04Bs0RqZXuUzk9jKmG2yyz8iwk9oKoGdWIAr6T6FmHKV9kzbybHXIDLY\n\tzX39MncNzTIgL9HEx6KfTij0HZH1jC2cwrii5MxnXPNm4GirgkH4NuzSHbhMz71QVHIC\n\t1JpQRgclQstte0NhQVF2CrilXCZhFA641Fnw0upEzII/pPXSGkhS1DOg9BfXVvn66s0S\n\tyYSt+f4fQYJaCGx8P+YOFu/PxxVeV8cvShCoN4Qf05viQ4V/lb3rsarNNl9peyganYkz\n\tHd1j6I8I0WsADqYwSqs5YgEkmeKWJMSYnAX4e0xUjvbvSh2TJvLLFWP8R/HG6HtpWs+U\n\tJehQ==",
        "X-Gm-Message-State": "ACrzQf0ZTpbfUHcC9xXDRlt4mrgU3XSp63xwqSdnkfSusrKOQqIyQz3K\n\tzv+lSUKznkKbuxrn0Xfx8lBj21kE/EP0LA==",
        "X-Google-Smtp-Source": "AMsMyM4qRDSm+NqxlMztrl3P2/eP0dej/8Qve8A0wT30Ee8x615ALYdm4X5xzmRe34kSBN3Bpr+mqQ==",
        "X-Received": "by 2002:a05:6000:154e:b0:22a:3177:1985 with SMTP id\n\t14-20020a056000154e00b0022a31771985mr3212296wry.117.1665062274479; \n\tThu, 06 Oct 2022 06:17:54 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu,  6 Oct 2022 14:17:36 +0100",
        "Message-Id": "<20221006131744.5179-3-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221006131744.5179-1-naush@raspberrypi.com>",
        "References": "<20221006131744.5179-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 02/10] ipa: raspberrypi: Add minimum\n\tand maximum line length fields to CameraMode",
        "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": "Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Naushir Patuck <naush@raspberrypi.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add fields for minimum and maximum line length duration to the CameraMode\nstructure. This replaces the existing lineLength field.\n\nAny use of the existing lineLength field is replaced by the new minLineLength\nfield, as logically we always want to use the fastest sensor readout by default.\n\nAs a drive-by cosmetic change, split all fields in the CameraMode structure into\nseparate lines.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nTested-by: Dave Stevenson <dave.stevenson@raspberrypi.com>\n---\n src/ipa/raspberrypi/cam_helper.cpp           |  8 +++----\n src/ipa/raspberrypi/controller/camera_mode.h | 23 +++++++++++++-------\n src/ipa/raspberrypi/raspberrypi.cpp          | 13 ++++++-----\n 3 files changed, 26 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp\nindex cac8f39ee763..42251ba29682 100644\n--- a/src/ipa/raspberrypi/cam_helper.cpp\n+++ b/src/ipa/raspberrypi/cam_helper.cpp\n@@ -64,13 +64,13 @@ void CamHelper::process([[maybe_unused]] StatisticsPtr &stats,\n uint32_t CamHelper::exposureLines(const Duration exposure) const\n {\n \tassert(initialized_);\n-\treturn exposure / mode_.lineLength;\n+\treturn exposure / mode_.minLineLength;\n }\n \n Duration CamHelper::exposure(uint32_t exposureLines) const\n {\n \tassert(initialized_);\n-\treturn exposureLines * mode_.lineLength;\n+\treturn exposureLines * mode_.minLineLength;\n }\n \n uint32_t CamHelper::getVBlanking(Duration &exposure,\n@@ -86,8 +86,8 @@ uint32_t CamHelper::getVBlanking(Duration &exposure,\n \t * minFrameDuration and maxFrameDuration are clamped by the caller\n \t * based on the limits for the active sensor mode.\n \t */\n-\tframeLengthMin = minFrameDuration / mode_.lineLength;\n-\tframeLengthMax = maxFrameDuration / mode_.lineLength;\n+\tframeLengthMin = minFrameDuration / mode_.minLineLength;\n+\tframeLengthMax = maxFrameDuration / mode_.minLineLength;\n \n \t/*\n \t * Limit the exposure to the maximum frame duration requested, and\ndiff --git a/src/ipa/raspberrypi/controller/camera_mode.h b/src/ipa/raspberrypi/controller/camera_mode.h\nindex a6ccf8c1c600..6bc35b771946 100644\n--- a/src/ipa/raspberrypi/controller/camera_mode.h\n+++ b/src/ipa/raspberrypi/controller/camera_mode.h\n@@ -20,23 +20,30 @@ struct CameraMode {\n \t/* bit depth of the raw camera output */\n \tuint32_t bitdepth;\n \t/* size in pixels of frames in this mode */\n-\tuint16_t width, height;\n+\tuint16_t width;\n+\tuint16_t height;\n \t/* size of full resolution uncropped frame (\"sensor frame\") */\n-\tuint16_t sensorWidth, sensorHeight;\n+\tuint16_t sensorWidth;\n+\tuint16_t sensorHeight;\n \t/* binning factor (1 = no binning, 2 = 2-pixel binning etc.) */\n-\tuint8_t binX, binY;\n+\tuint8_t binX;\n+\tuint8_t binY;\n \t/* location of top left pixel in the sensor frame */\n-\tuint16_t cropX, cropY;\n+\tuint16_t cropX;\n+\tuint16_t cropY;\n \t/* scaling factor (so if uncropped, width*scaleX is sensorWidth) */\n-\tdouble scaleX, scaleY;\n+\tdouble scaleX;\n+\tdouble scaleY;\n \t/* scaling of the noise compared to the native sensor mode */\n \tdouble noiseFactor;\n-\t/* line time */\n-\tlibcamera::utils::Duration lineLength;\n+\t/* minimum and maximum line time */\n+\tlibcamera::utils::Duration minLineLength;\n+\tlibcamera::utils::Duration maxLineLength;\n \t/* any camera transform *not* reflected already in the camera tuning */\n \tlibcamera::Transform transform;\n \t/* minimum and maximum fame lengths in units of lines */\n-\tuint32_t minFrameLength, maxFrameLength;\n+\tuint32_t minFrameLength;\n+\tuint32_t maxFrameLength;\n \t/* sensitivity of this mode */\n \tdouble sensitivity;\n };\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 358a119da222..67326bcf4a14 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -314,7 +314,7 @@ void IPARPi::start(const ControlList &controls, StartConfig *startConfig)\n \t}\n \n \tstartConfig->dropFrameCount = dropFrameCount_;\n-\tconst Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.lineLength;\n+\tconst Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.minLineLength;\n \tstartConfig->maxSensorFrameLengthMs = maxSensorFrameDuration.get<std::milli>();\n \n \tfirstStart_ = false;\n@@ -356,7 +356,8 @@ void IPARPi::setMode(const IPACameraSensorInfo &sensorInfo)\n \t * Calculate the line length as the ratio between the line length in\n \t * pixels and the pixel rate.\n \t */\n-\tmode_.lineLength = sensorInfo.minLineLength * (1.0s / sensorInfo.pixelRate);\n+\tmode_.minLineLength = sensorInfo.minLineLength * (1.0s / sensorInfo.pixelRate);\n+\tmode_.maxLineLength = sensorInfo.maxLineLength * (1.0s / sensorInfo.pixelRate);\n \n \t/*\n \t * Set the frame length limits for the mode to ensure exposure and\n@@ -458,8 +459,8 @@ int IPARPi::configure(const IPACameraSensorInfo &sensorInfo,\n \t * based on the current sensor mode.\n \t */\n \tControlInfoMap::Map ctrlMap = ipaControls;\n-\tconst Duration minSensorFrameDuration = mode_.minFrameLength * mode_.lineLength;\n-\tconst Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.lineLength;\n+\tconst Duration minSensorFrameDuration = mode_.minFrameLength * mode_.minLineLength;\n+\tconst Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.minLineLength;\n \tctrlMap[&controls::FrameDurationLimits] =\n \t\tControlInfo(static_cast<int64_t>(minSensorFrameDuration.get<std::micro>()),\n \t\t\t    static_cast<int64_t>(maxSensorFrameDuration.get<std::micro>()));\n@@ -1150,8 +1151,8 @@ void IPARPi::applyAWB(const struct AwbStatus *awbStatus, ControlList &ctrls)\n \n void IPARPi::applyFrameDurations(Duration minFrameDuration, Duration maxFrameDuration)\n {\n-\tconst Duration minSensorFrameDuration = mode_.minFrameLength * mode_.lineLength;\n-\tconst Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.lineLength;\n+\tconst Duration minSensorFrameDuration = mode_.minFrameLength * mode_.minLineLength;\n+\tconst Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.minLineLength;\n \n \t/*\n \t * This will only be applied once AGC recalculations occur.\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "02/10"
    ]
}