{"id":17913,"url":"https://patchwork.libcamera.org/api/patches/17913/?format=json","web_url":"https://patchwork.libcamera.org/patch/17913/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20221129134534.2933-7-naush@raspberrypi.com>","date":"2022-11-29T13:45:30","name":"[libcamera-devel,v2,06/10] pipeline: raspberrypi: Reorder startup drop frame initialisation","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"ff791e119ad0da0aa7691ec299702cf9d4d0e1e9","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17913/mbox/","series":[{"id":3647,"url":"https://patchwork.libcamera.org/api/series/3647/?format=json","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/17913/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17913/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 D5F69BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 29 Nov 2022 13:45:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9A2196333E;\n\tTue, 29 Nov 2022 14:45:49 +0100 (CET)","from mail-wr1-x434.google.com (mail-wr1-x434.google.com\n\t[IPv6:2a00:1450:4864:20::434])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D456363340\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Nov 2022 14:45:42 +0100 (CET)","by mail-wr1-x434.google.com with SMTP id h11so14868660wrw.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Nov 2022 05:45:42 -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.41\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 29 Nov 2022 05:45:41 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669729549;\n\tbh=HF0ifAuMwXahZfN9Y84qtX+8Io2LtllLKhr1Mmmd9Xc=;\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=yWFcuxXqWj3s2He457uVt023VyYPh5qngE4uWb9pxaTIAEQhWMsX+sloiU3QqD2zy\n\tzQY1LvSKtBy0tw8nMTvmLe5VVEnCdq16AstKEWaa6Tg/aMs4FMYAVoq5R6FlH8tu5z\n\t4QO8RFzNaHbkK9DMUdEe1PF9BlejMVnzYsKiBr3xVbkLOEa5YL39SPIyWiBTKAuMCT\n\t6r/3MUaCFn+1Kvu2sn+VEb/HGv6CWN4NHdHWN4m+4UIo8N3VAhc5s7CrCeEE0IyCtK\n\t8jZL3H2df0mURPh/0mEdAIINclnD15qsceJoGMGr3z3nutFMJDYQ/fazwKEFSHVBA1\n\t5inIDCjwJQ9gA==","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=cUsJZiqpEEbEwFHCx4GPjdPrMvQweo8Nuue7++bQ370=;\n\tb=k9Xsz4t+/crxHlT1Im3kfShT4N22MNm71vGIdmzJjMM1GBA6z6iEHNkJae2J3e3nli\n\tQvzfC21ehhe644GU6GR5X00flNVuCU7h7UhNLLmsE8E4C/tCRTxxAL/Drj50IaUK3Ums\n\tkla035ckUKN5isd5KtPm0DV5oCsQBm9gJ2z0qOVNmjmqZrYBEABQ9XqdWz5Q4dq7vTAO\n\tEfEXNZffFBwHrCfOERASjPcB7RkePoyY39uzXdF8MmEFoBFe4NnED+AuffDncBQ5aK1J\n\tjZL/CvgBEPs1BuQ6qi5SI+XcsdlpYpiCIO3O4RpaXJQshCjbzXDmFu/q6v+2+RacM9AP\n\t2h7g=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"k9Xsz4t+\"; 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=cUsJZiqpEEbEwFHCx4GPjdPrMvQweo8Nuue7++bQ370=;\n\tb=EF5PBgQdJa50VD6O7S8cuqM2cfCOpi1Oog9LoCLHchdlrKp79Nut3dCuphJp4PY8s0\n\tvJIslCj7ioMxOGkU1Ai6d6SspvspMExlEUP/t4UUg+Gn5h8Uyouzq3JkXgFKOQKHg8Bu\n\tvpAtaWI0XGM2asez5zStyXWVoloBnXrhmrN9oQscvvvWEhZ5Eir/Hk+v9ElV3eAfkBrh\n\tVYSYZ5tOlGlI2fxU6eH3nOCqTi8VBCyXM1FTZYnMaBhlxwHN6ER/4nVSnAaDxBmIs5Vo\n\tq8onHpJGwlWF3HsBWgyCEsbfA5JtJln7qkThUQY6tJ4Svx9en/XS1fN8evtecGzy/V0b\n\tuLXA==","X-Gm-Message-State":"ANoB5pmqxqaxArP913JlZo+u1hBOqKipeRsTWWIWgLI5/pukvEPVT6jp\n\tp6csGzyRjAkB4Sb41VGTvate6GwZaPMldw==","X-Google-Smtp-Source":"AA0mqf4UzllLXArxLPcJoL+DA7SZkFSJIGENoBTggaNo8qkW+jKQspuT+/tELccZVKmIr91lqCsLow==","X-Received":"by 2002:adf:ed8e:0:b0:241:d7ce:4395 with SMTP id\n\tc14-20020adfed8e000000b00241d7ce4395mr26300110wro.553.1669729542072; \n\tTue, 29 Nov 2022 05:45:42 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 29 Nov 2022 13:45:30 +0000","Message-Id":"<20221129134534.2933-7-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 06/10] pipeline: raspberrypi: Reorder\n\tstartup drop frame initialisation","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":"Reorder the code such that the IPA requested startup drop frames count is\navailable before the pipeline handler allocates any stream buffers.\n\nThis will be used in a subsequent change to stop Unicam buffer allocations if\nthere are no startup drop frames required.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp      | 30 +++++++++----------\n 1 file changed, 15 insertions(+), 15 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 86eb43a3a3c5..742521927780 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1044,21 +1044,6 @@ int PipelineHandlerRPi::start(Camera *camera, const ControlList *controls)\n \tRPiCameraData *data = cameraData(camera);\n \tint ret;\n \n-\tfor (auto const stream : data->streams_)\n-\t\tstream->resetBuffers();\n-\n-\tif (!data->buffersAllocated_) {\n-\t\t/* Allocate buffers for internal pipeline usage. */\n-\t\tret = prepareBuffers(camera);\n-\t\tif (ret) {\n-\t\t\tLOG(RPI, Error) << \"Failed to allocate buffers\";\n-\t\t\tdata->freeBuffers();\n-\t\t\tstop(camera);\n-\t\t\treturn ret;\n-\t\t}\n-\t\tdata->buffersAllocated_ = true;\n-\t}\n-\n \t/* Check if a ScalerCrop control was specified. */\n \tif (controls)\n \t\tdata->applyScalerCrop(*controls);\n@@ -1075,6 +1060,21 @@ int PipelineHandlerRPi::start(Camera *camera, const ControlList *controls)\n \t/* Configure the number of dropped frames required on startup. */\n \tdata->dropFrameCount_ = startConfig.dropFrameCount;\n \n+\tfor (auto const stream : data->streams_)\n+\t\tstream->resetBuffers();\n+\n+\tif (!data->buffersAllocated_) {\n+\t\t/* Allocate buffers for internal pipeline usage. */\n+\t\tret = prepareBuffers(camera);\n+\t\tif (ret) {\n+\t\t\tLOG(RPI, Error) << \"Failed to allocate buffers\";\n+\t\t\tdata->freeBuffers();\n+\t\t\tstop(camera);\n+\t\t\treturn ret;\n+\t\t}\n+\t\tdata->buffersAllocated_ = true;\n+\t}\n+\n \t/* We need to set the dropFrameCount_ before queueing buffers. */\n \tret = queueAllBuffers(camera);\n \tif (ret) {\n","prefixes":["libcamera-devel","v2","06/10"]}