Patch Detail
Show a patch.
GET /api/patches/17912/?format=api
{ "id": 17912, "url": "https://patchwork.libcamera.org/api/patches/17912/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17912/", "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": "<20221129134534.2933-6-naush@raspberrypi.com>", "date": "2022-11-29T13:45:29", "name": "[libcamera-devel,v2,05/10] pipeline: raspberrypi: Disable StreamOn for ISP Output0/1 when dropping frames", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "417a8d14d2a480c5bbac4177e60f1a6b0876432c", "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/17912/mbox/", "series": [ { "id": 3647, "url": "https://patchwork.libcamera.org/api/series/3647/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3647", "date": "2022-11-29T13:45:24", "name": "Raspberry Pi: Platform configuration and buffer allocation improvements", "version": 2, "mbox": "https://patchwork.libcamera.org/series/3647/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17912/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17912/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 BB51FBE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 29 Nov 2022 13:45:46 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6FFE663348;\n\tTue, 29 Nov 2022 14:45:46 +0100 (CET)", "from mail-wr1-x433.google.com (mail-wr1-x433.google.com\n\t[IPv6:2a00:1450:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CE3F063334\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Nov 2022 14:45:41 +0100 (CET)", "by mail-wr1-x433.google.com with SMTP id o5so13157503wrm.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Nov 2022 05:45:41 -0800 (PST)", "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tn8-20020a05600c3b8800b003cfbbd54178sm3565636wms.2.2022.11.29.05.45.40\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 29 Nov 2022 05:45:40 -0800 (PST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669729546;\n\tbh=VmJ10ySTnoK2DomNYykhigrgND5ZRn760On8UiajsLA=;\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=HA6TEcnf+GG+aE4x6w8OahF4lD3R1NCOudZtj2HVTkXRB9fJO2YXALgkgc79nKcI5\n\tSUmhU3HyS4LeF+mHt1urZCQvyctKmaXnOw49Ztf43vmNJS5I67IslEx9Mjo2ULg8RL\n\t9XovygDveGo4cJENrMoE1hkFZ8xeRNfe+4g2+qxHEMoXQ5JOlc8JHhTTYNOu740IvH\n\t7NtmtcKxuNJmyWMpnMk3FrPSUYpghcoeBVZRaWzpoFOm4RGYCYNaj8R67b+xIbL23p\n\t2HMIFJCBUS1SF81HxaihkAhsnIBad2g3QaI96k5BzET4m1G1DFChD9wm7etQhA8Fmi\n\ttrrjOTc8essDw==", "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\t:message-id:reply-to;\n\tbh=s6JWaOD5ahc87t7hdCafQKuhJnaZNJKSyQwGAo5ftKI=;\n\tb=S7laaz2rPkTC20d47V0XF+vz1wSwI1B38r3HNqqHBzJPHG/W+PU51olc73DjaVBZs7\n\t/9FQb0yys4Os0tpe9CakwMnttxHtwJLwIbMVE95sM0dhiotNayMNXRU1D9TvsYDR1dHT\n\tR8HWaaMXj2+8tLWdXkQ3sTfzppoNPcQ35HIPbyiTBhkshw8jpdX+0p9uMHdXXd8gn0eb\n\tPHj3PuqoAnrBN7ob2vCWaRSrBDz+xTFOBmyJ6v9bcCZ/Dybgh5bWtd2ACYog80eJ/avR\n\tdlYuviKhRNBY+k4HGrokT0UlTNIKfc9INdiINcrcTHj9Ewt76URDOse4vCQQ8BAKBN2h\n\t83Cw==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"S7laaz2r\"; 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:message-id:reply-to;\n\tbh=s6JWaOD5ahc87t7hdCafQKuhJnaZNJKSyQwGAo5ftKI=;\n\tb=zyf8iSIZJt5dePqPYpSoQbKbJAh1QPudDBGc5Ce7lomTo1DpKF4AmMCENE165aSK4j\n\tC47ixtWn22rxZoKHXh4vd5+Siqo0ufth0IALruRleDwnET1wgYI9R34Du7r+BmavyvJD\n\t/YiWEa520YYDTavjoPSgty8N+qREhC9QU9ZKFskxs454BDZNyyShWpYs08zv/QEnlawc\n\tg9QBT3UnyXg42p+PoDxvXogCRKWM/HVnOv4RK2OIF53qst8qMr4k0lLWikfisZiNxI+N\n\toCcjMc87ImFyFLpTn426F3PBaw9veYnDhCu7uITfMKTOan6ASP6Nu6MBQI648YTdajRg\n\trfbQ==", "X-Gm-Message-State": "ANoB5pllyEMX3V7HXY0QL8abJ3zPcB1FjMpuAQ1CpYmf9vCXOaXuSXPd\n\tjoRVWNld2jD3MMSoswpJkSq5Uj0F6c95Ew==", "X-Google-Smtp-Source": "AA0mqf66cN5QDHIZclC7A5vDNOfcaB9d31PTwv7OvBzbSyGJCzY7JWbIR/e3eul7lL2QMMkYFPTYOg==", "X-Received": "by 2002:adf:ab1d:0:b0:242:e73:f642 with SMTP id\n\tq29-20020adfab1d000000b002420e73f642mr9098390wrc.184.1669729541340; \n\tTue, 29 Nov 2022 05:45:41 -0800 (PST)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 29 Nov 2022 13:45:29 +0000", "Message-Id": "<20221129134534.2933-6-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20221129134534.2933-1-naush@raspberrypi.com>", "References": "<20221129134534.2933-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 05/10] pipeline: raspberrypi: Disable\n\tStreamOn for ISP Output0/1 when dropping frames", "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": "If the pipeline handler is required to drop startup frames by the IPA, do not\ncall StreamOn on the ISP Output0 and Output1 device nodes from\nPipelineHandlerRPi::start. This stops the ISP from generating output on those\nchannels giving improving latency, and more crucially does not require internal\nbuffers to be allocated to deal with this condition.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n .../pipeline/raspberrypi/data/default.json | 2 +-\n .../pipeline/raspberrypi/raspberrypi.cpp | 34 ++++++++++++++++---\n 2 files changed, 31 insertions(+), 5 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/raspberrypi/data/default.json b/src/libcamera/pipeline/raspberrypi/data/default.json\nindex d709e31850af..a7ea735c87f4 100644\n--- a/src/libcamera/pipeline/raspberrypi/data/default.json\n+++ b/src/libcamera/pipeline/raspberrypi/data/default.json\n@@ -14,7 +14,7 @@\n # min_total_unicam_buffers - external buffer count)\n \"min_total_unicam_buffers\": 4,\n \n- # The number of internal buffers used for ISP Output0. This must be set to 1.\n+ # The number of internal buffers used for ISP Output0.\n \"num_output0_buffers\": 1\n }\n }\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex ce411453db0a..86eb43a3a3c5 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1094,8 +1094,18 @@ int PipelineHandlerRPi::start(Camera *camera, const ControlList *controls)\n \n \tdata->state_ = RPiCameraData::State::Idle;\n \n-\t/* Start all streams. */\n+\t/*\n+\t * Start all streams with the exception of ISP Output0 and Output1 if\n+\t * we are dropping some start-up frames. This saves a tiny bit of latency\n+\t * and avoids the need for allocating an Output0 buffer only to handle\n+\t * startup drop frame conditions.\n+\t */\n \tfor (auto const stream : data->streams_) {\n+\t\tif (data->dropFrameCount_ &&\n+\t\t (stream == &data->isp_[Isp::Output0] ||\n+\t\t stream == &data->isp_[Isp::Output1]))\n+\t\t\tcontinue;\n+\n \t\tret = stream->dev()->streamOn();\n \t\tif (ret) {\n \t\t\tstop(camera);\n@@ -1500,6 +1510,13 @@ int PipelineHandlerRPi::queueAllBuffers(Camera *camera)\n \t\t\tif (ret < 0)\n \t\t\t\treturn ret;\n \t\t} else {\n+\t\t\t/*\n+\t\t\t * We don't enable streaming for Output0 and Output1 for\n+\t\t\t * startup frame drops, so don't queue any buffers.\n+\t\t\t */\n+\t\t\tif (stream == &data->isp_[Isp::Output0] ||\n+\t\t\t stream == &data->isp_[Isp::Output1])\n+\t\t\t\tcontinue;\n \t\t\t/*\n \t\t\t * For external streams, we must queue up a set of internal\n \t\t\t * buffers to handle the number of drop frames requested by\n@@ -2169,16 +2186,25 @@ void RPiCameraData::checkRequestCompleted()\n \t}\n \n \t/*\n-\t * Make sure we have three outputs completed in the case of a dropped\n-\t * frame.\n+\t * Only the ISP statistics output is generated when we are dropping\n+\t * frames on startup.\n \t */\n \tif (state_ == State::IpaComplete &&\n-\t ((ispOutputCount_ == 3 && dropFrameCount_) || requestCompleted)) {\n+\t ((ispOutputCount_ == 1 && dropFrameCount_) || requestCompleted)) {\n \t\tstate_ = State::Idle;\n \t\tif (dropFrameCount_) {\n \t\t\tdropFrameCount_--;\n \t\t\tLOG(RPI, Debug) << \"Dropping frame at the request of the IPA (\"\n \t\t\t\t\t<< dropFrameCount_ << \" left)\";\n+\t\t\t/*\n+\t\t\t * If we have finished dropping startup frames, start\n+\t\t\t * streaming on the ISP Output0 and Output1 nodes for\n+\t\t\t * normal operation.\n+\t\t\t */\n+\t\t\tif (!dropFrameCount_) {\n+\t\t\t\tisp_[Isp::Output0].dev()->streamOn();\n+\t\t\t\tisp_[Isp::Output1].dev()->streamOn();\n+\t\t\t}\n \t\t}\n \t}\n }\n", "prefixes": [ "libcamera-devel", "v2", "05/10" ] }