{"id":17489,"url":"https://patchwork.libcamera.org/api/1.1/patches/17489/?format=json","web_url":"https://patchwork.libcamera.org/patch/17489/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20221003083934.31629-3-naush@raspberrypi.com>","date":"2022-10-03T08:39:28","name":"[libcamera-devel,v1,2/9] ipa: raspberrypi: Add minimum and maximum line length fields to CameraMode","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"d67cf7fca53359bca7e1fe6b24fd767b65aee2c7","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17489/mbox/","series":[{"id":3523,"url":"https://patchwork.libcamera.org/api/1.1/series/3523/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3523","date":"2022-10-03T08:39:26","name":"Raspberry Pi: Horizontal blanking control","version":1,"mbox":"https://patchwork.libcamera.org/series/3523/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17489/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17489/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 185E6C327C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Oct 2022 08:40:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1155762CE4;\n\tMon,  3 Oct 2022 10:40:02 +0200 (CEST)","from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com\n\t[IPv6:2a00:1450:4864:20::32f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1504D61F74\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Oct 2022 10:39:59 +0200 (CEST)","by mail-wm1-x32f.google.com with SMTP id iv17so6535905wmb.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 03 Oct 2022 01:39:59 -0700 (PDT)","from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\ti13-20020a5d55cd000000b0022ae59d472esm8922787wrw.112.2022.10.03.01.39.57\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 03 Oct 2022 01:39:57 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664786402;\n\tbh=pKEJ82w+q8AzYxYD5MzI7GOYv4UyMiRvHsZgi0chqa8=;\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=Myw+jqbYpecbULYz4tCCmDocaAOx23fvAsR0U3QDjI3Fodv7MjWiuqyQ9IlpikuEZ\n\tv+T07aFVxfPyr2erCMltj0wYz+EMF90AnaWbq9IMb2ScJYRoMm2cPAiqkcEdIjIIcC\n\tlB72Bo9Ga+3UQ4Semug+u9ZE73jk3Fw9/qribhzuT1BOMtwEzrnxtt4NKUQBYSX5Up\n\t9nS77gbp9XiX+O4A3a4QfCkzomGWkCTF6iSFaT0BynmSH5+Z5nvBUjA/VDhk4QDzj1\n\tPdlJxkn4gjDT/hlJTZozsZBrQK86A9gtKSVNw0FawYHLt8/CLpgrFGLb0++aBpaNiY\n\t71O/2KDFradXg==","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=1QCNpi5jJlmRb7DM3+pXDRv9ADcRQP27dKFxrOHea6E=;\n\tb=PAODfqMPZfM/7lme+IkrjJ2KPJP0TohcXzh6UPMqHCYsKcju5wLP+sKGIgmDxatDSg\n\tGlU6gqDWf2+B1un2bqdq89VNvcQ+Y+ENM+6LpVAtOhVfRcDCRH84jBR3Yn29eSD64HFb\n\tU5AtlqwX0C3/Fn74yTtH5DMvhYAF0XSPfzC7O4pX0BaT+s919dSJsLMX4hMTAI6DC6ha\n\tUKAtzbQ2OpIG/PXrhdVM3GXoYDmYWFb9wY4Ofp7gGgh5zcd7POdlOUqm77IvnRw6Ll01\n\tDHRtcoOy9DfE5PE8a9cv2ac7BMG8D83g3l0mO9qFaV6fImO0+JOEdwLUuV2+z1eWC1ch\n\tINsQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"PAODfqMP\"; 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=1QCNpi5jJlmRb7DM3+pXDRv9ADcRQP27dKFxrOHea6E=;\n\tb=CQr0PALMdyiYH7yf/qevv54WH9baOv08/FRVBTJD/axtUGast2mTPUsFz5Fa5VH4v2\n\tvk8DRaF4WwHalJ9AQNC6eLOGqnyTz5OTHc4elZ5HTD2a5M0ZXNwc0qZydFtAstUVXs62\n\tD9/IFoadYH4YFMg43T3jAvj2NJqkDV11aQFTKebwhaWuN3gvhvrkpALraHDI67JydoQ9\n\teTQC2HbI+ibCWWu+lguNiR6PshsyYScZLxxI+OOw9M/vZxbFXhIwwnXkSrMLGUDSz48U\n\tUy02Kekuf9Ie5X2HrpkydhEzeK1OdMWOZPqEixNxEF6I7j/yuAoGFNwvMnQatZIvfh5o\n\tQm+w==","X-Gm-Message-State":"ACrzQf2hIM6LO8sfBQ0PR+k3dPbd0aeIAe+Fmh81HdgHMEZxTGgBcEev\n\tXvzdCEsBti/2UABbKsXdo1AW3ejonqrmTg==","X-Google-Smtp-Source":"AMsMyM69cSLJj/iXo+PVpnpLc4qMTRQ9o4winclxmkpQfPdxpP/UuwVna2QBW1pfxldl+gSmmph51A==","X-Received":"by 2002:a05:600c:35cc:b0:3b4:c403:7888 with SMTP id\n\tr12-20020a05600c35cc00b003b4c4037888mr6118578wmq.206.1664786398568; \n\tMon, 03 Oct 2022 01:39:58 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  3 Oct 2022 09:39:28 +0100","Message-Id":"<20221003083934.31629-3-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20221003083934.31629-1-naush@raspberrypi.com>","References":"<20221003083934.31629-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v1 2/9] ipa: raspberrypi: Add minimum and\n\tmaximum 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 (in units of pixels) to the\nCameraMode structure. 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\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/ipa/raspberrypi/cam_helper.cpp           |  8 ++++----\n src/ipa/raspberrypi/controller/camera_mode.h |  2 +-\n src/ipa/raspberrypi/raspberrypi.cpp          | 13 +++++++------\n 3 files changed, 12 insertions(+), 11 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..b7e73aae4698 100644\n--- a/src/ipa/raspberrypi/controller/camera_mode.h\n+++ b/src/ipa/raspberrypi/controller/camera_mode.h\n@@ -32,7 +32,7 @@ struct CameraMode {\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+\tlibcamera::utils::Duration minLineLength, 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 */\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","v1","2/9"]}