Patch Detail
Show a patch.
GET /api/1.1/patches/17972/?format=api
{ "id": 17972, "url": "https://patchwork.libcamera.org/api/1.1/patches/17972/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17972/", "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": "<20221209090050.19441-9-naush@raspberrypi.com>", "date": "2022-12-09T09:00:46", "name": "[libcamera-devel,v4,08/12] pipeline: raspberrypi: Handle MandatoryRequestBuffer hints for ISP Output0", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "58a2a9f516b1c40d5fbabe8062b48d64065e0670", "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/17972/mbox/", "series": [ { "id": 3663, "url": "https://patchwork.libcamera.org/api/1.1/series/3663/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3663", "date": "2022-12-09T09:00:38", "name": "Raspberry Pi: Platform configuration and buffer allocation improvements", "version": 4, "mbox": "https://patchwork.libcamera.org/series/3663/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17972/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17972/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 77CA0C3284\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 9 Dec 2022 09:01:41 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1DB9A63366;\n\tFri, 9 Dec 2022 10:01:41 +0100 (CET)", "from mail-wm1-x333.google.com (mail-wm1-x333.google.com\n\t[IPv6:2a00:1450:4864:20::333])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6094D61F1E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 9 Dec 2022 10:01:35 +0100 (CET)", "by mail-wm1-x333.google.com with SMTP id ay40so3070343wmb.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 09 Dec 2022 01:01:35 -0800 (PST)", "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tbd10-20020a05600c1f0a00b003cf774c31a0sm7773674wmb.16.2022.12.09.01.01.33\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 09 Dec 2022 01:01:34 -0800 (PST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1670576501;\n\tbh=BiHLTGRIZrIxROdmyYa5tRAbZuIiIL1LaiHBSzWJ660=;\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=IATLDTL3+vv0TcWQ5MrODlRsP+3o/kFqD6e7e8NJQ2vbRY5qqi6h4+XcC9knTnHDA\n\teV6rQw7pbr507L37qEdNZkKl6HBqbTL13uUpyNcDEcszJ7jko7xghob3dLwTODZSsj\n\tu5uj72Y44aLIj7d8aw75S9iIuNOyCJw3wmo9Wn8vHdCPkGKk+fH+RmhUZuKEIJpSQ3\n\tJPVcbSuwTB7Tx8XiMnx4Ymtzq0PRTTnvNPb1XDDSmGPddCAk0B9cgMzkSX6LvVg2rW\n\t8xsVeAvIdXpAn18Eg3lyXHeMxDFjbiLMWoHDoViN6fH4BbQUqJ8hccWrZ1F/E3EM+N\n\tERon4pQhAOI7w==", "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=aoZyfBtUFeCD/JFLmCZNa14e1yWfA5Pwc8ENXkV9xSs=;\n\tb=JKQQaj+Fi+YP5LTOH3yvFlDTYbY5Cqa10SoQIsV+TPvNJZ7TsDE6saTue13agX6LtM\n\ttTf31fRIOMRCxkisLwzf7ydMDMqSFsPYiUJ8H4glXyde6NjNQYuPYhbuCpv4+hNSeopQ\n\tNc6V03kPp8KxMs9IL0+lvHx4g5FKl0vFu5GFssHVG8vfg5VvT7vs6Tm5ENArgHn6GQGC\n\tt5d4CmaUJ+2V6l2r6PKnEbyWoIG/6BKHUzbMiRngE3GRE1vkWHsdoZZ7mWWuH+IddvXU\n\tkuLhrbuZQcIqnCQjok/1kLEZgm+hIHWq3K9Zm5v+PrNGapikcTqoSRn/+ullX8vjPKeY\n\tvTWw==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"JKQQaj+F\"; 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=aoZyfBtUFeCD/JFLmCZNa14e1yWfA5Pwc8ENXkV9xSs=;\n\tb=WKW82AorOLw4osZluLhFCiznoUdzYcaJiDzlUb4imO8EyUsFPkY0B0F00mvl0DHJgH\n\tK7w9Uo95ZQL1m/V//cwnVnDWRk1O/De0+DKUeZfTSYUc7TLRZs3bobaVbjt71mQR+n/L\n\tIpa4kF3Jp/eWZ0Nc40AdMURfB7HNnucZAxEI8PvkZIf0KBf30i+7bmDDuPOYlc3OulzX\n\ttlxhsoNBJlIqnP50VcCZ2bWw7BvhKXZOU7KihZ6xQvqvE687kezmTpNZ/Zu2CsbgAHwf\n\tdhAErH6HWhMs//b9KsfL1JR5ec2IGPsXx4KWWquK2sXG/E1IPk7ro8Mdyhe0PVNAEH5M\n\tqzUw==", "X-Gm-Message-State": "ANoB5pkhB98GQsHr4FjRGgVyN4Id5WvmUKl38GY3/4dG28jzIhaUNkRE\n\tby63Hvq2euGuXrzUOuHOou8P6FW3C35Kb/PF", "X-Google-Smtp-Source": "AA0mqf7eZKYJgrIT1KGg+M8cvb66z3AshP1P0FukkOkBulyK32sWzJ+dytS3+P/Y5EEbNuUHMIGjHQ==", "X-Received": "by 2002:a05:600c:1f09:b0:3d0:7d89:2256 with SMTP id\n\tbd9-20020a05600c1f0900b003d07d892256mr4387226wmb.13.1670576494621; \n\tFri, 09 Dec 2022 01:01:34 -0800 (PST)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 9 Dec 2022 09:00:46 +0000", "Message-Id": "<20221209090050.19441-9-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20221209090050.19441-1-naush@raspberrypi.com>", "References": "<20221209090050.19441-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v4 08/12] pipeline: raspberrypi: Handle\n\tMandatoryRequestBuffer hints for ISP Output0", "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": "Look for MandatoryRequestBuffer flag in the hints field of the ISP Output0\nStreamConfiguration structure. If this flag is set, it guarantees that the\napplication will provide buffers for the ISP, do not allocate any internal\nbuffers for the device.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp | 29 ++++++++++++++-----\n 1 file changed, 22 insertions(+), 7 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 9a316eda6fea..45e66839efb9 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1452,7 +1452,7 @@ int PipelineHandlerRPi::prepareBuffers(Camera *camera)\n \tRPiCameraData *data = cameraData(camera);\n \tunsigned int minUnicamBuffers = data->config_.minUnicamBuffers,\n \t\t minTotalUnicamBuffers = data->config_.minTotalUnicamBuffers,\n-\t\t numRawBuffers = 0;\n+\t\t numRawBuffers = 0, minIspBuffers = 1;\n \tint ret;\n \n \tfor (Stream *s : camera->streams()) {\n@@ -1476,8 +1476,21 @@ int PipelineHandlerRPi::prepareBuffers(Camera *camera)\n \t\t\t\t\tminTotalUnicamBuffers = 0;\n \t\t\t\t}\n \t\t\t}\n-\n-\t\t\tbreak;\n+\t\t} else if (s == &data->isp_[Isp::Output0]) {\n+\t\t\t/*\n+\t\t\t * Since the ISP runs synchronous with the IPA and requests,\n+\t\t\t * we only ever need a maximum of one internal buffer. Any\n+\t\t\t * buffers the application wants to hold onto will already\n+\t\t\t * be exported through PipelineHandlerRPi::exportFrameBuffers().\n+\t\t\t *\n+\t\t\t * However, as above, if the application provides a guarantee\n+\t\t\t * that the buffer will always be provided for the ISP Output0\n+\t\t\t * stream in a Request, we don't need any internal buffers\n+\t\t\t * allocated.\n+\t\t\t */\n+\t\t\tif (!data->dropFrameCount_ && s->configuration().hints &\n+\t\t\t StreamConfiguration::Hint::MandatoryRequestBuffer)\n+\t\t\t\tminIspBuffers = 0;\n \t\t}\n \t}\n \n@@ -1513,12 +1526,14 @@ int PipelineHandlerRPi::prepareBuffers(Camera *camera)\n \t\t\t * so allocate the minimum required to avoid frame drops.\n \t\t\t */\n \t\t\tnumBuffers = data->config_.minTotalUnicamBuffers;\n+\t\t} else if (stream == &data->isp_[Isp::Output0]) {\n+\t\t\t/* Buffer count for this is handled in the earlier loop above. */\n+\t\t\tnumBuffers = minIspBuffers;\n \t\t} else {\n \t\t\t/*\n-\t\t\t * Since the ISP runs synchronous with the IPA and requests,\n-\t\t\t * we only ever need one set of internal buffers. Any buffers\n-\t\t\t * the application wants to hold onto will already be exported\n-\t\t\t * through PipelineHandlerRPi::exportFrameBuffers().\n+\t\t\t * Same reasoning as for ISP Output 0, we only ever need\n+\t\t\t * a maximum of one internal buffer for Output1 (required\n+\t\t\t * for colour denoise) and ISP statistics.\n \t\t\t */\n \t\t\tnumBuffers = 1;\n \t\t}\n", "prefixes": [ "libcamera-devel", "v4", "08/12" ] }