{"id":17602,"url":"https://patchwork.libcamera.org/api/patches/17602/?format=json","web_url":"https://patchwork.libcamera.org/patch/17602/","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":"<20221014131846.27169-7-naush@raspberrypi.com>","date":"2022-10-14T13:18:42","name":"[libcamera-devel,v1,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/17602/mbox/","series":[{"id":3555,"url":"https://patchwork.libcamera.org/api/series/3555/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3555","date":"2022-10-14T13:18:37","name":"Raspberry Pi: Platform configuration and buffer allocation improvements","version":1,"mbox":"https://patchwork.libcamera.org/series/3555/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17602/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17602/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 3A7D6C3285\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 14 Oct 2022 13:19:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D2E6262DDC;\n\tFri, 14 Oct 2022 15:19:02 +0200 (CEST)","from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com\n\t[IPv6:2a00:1450:4864:20::42c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B700962DB8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Oct 2022 15:18:56 +0200 (CEST)","by mail-wr1-x42c.google.com with SMTP id a3so7614218wrt.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Oct 2022 06:18:56 -0700 (PDT)","from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tg17-20020a05600c001100b003c6bbe910fdsm8282458wmc.9.2022.10.14.06.18.55\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 14 Oct 2022 06:18:55 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665753542;\n\tbh=o6vkO44sTYo09jqM8FE/PBg/ldHf52mz0DXOsl9R4Lc=;\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=FykogZo8aA7Oi7LMdib9hrQsyRmeMswGRZ7Qw38jFi6wA8PmipG4JUfDAtVHH0+dt\n\tCsYizI7u28PsZbbbEoh4SLpOgHjkdzCY3PbfnzrlPpO+G2nbt/457f4vOBaDNYEP9Y\n\tyGlYc6yiKtLWkuJIaroi9UT1gSDRQc6bpWbQ2DXH+B0y6E9XZvWT/BoKmc/3nBxjGl\n\tSDm2rylScAeBPoNg3FH9LTkRsOdccwvwZRSrTAK9QEpv4X2oLUOhAAMUFjoO02bFdT\n\t/h1Ip1rPHkre/saDtIQIStjjPWvQMfl0BXZi/hl/bHYCBfsgfONiodVsR0ELvEFu/k\n\t43eGgk/+XgbrA==","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=lxqK9ryVYJYYkTjSeTRaI0AsUv563issP0mEV9l+D1I=;\n\tb=msQGbA2qUAFct6K8hxjD2tuaMT17RbeKilvGy1/L/TE7m4bNY8zLgMPpm60UrC0po5\n\t8clWlk6hqzOyO1D1Z/XGkPRPbq/YjCq/H0mo9JsQTYT1JQJFRpDLwxe2wCWC2YIjILoJ\n\tzJy6YDbSOjQttua+dIEqYYio5dwA6gnG7lx7sG8M5CJt01e9OdpUiXHvtZkT8pdlBB9I\n\t525mTvqMav+CKuQ037JfbwDePEtw++TjiJqvH5MBudM9hL3f6aqFeInKAJIL+GQCma3I\n\tbbOTl9YCcHThb3aOfff4aVc4Aji72haMZCHYtLiQLqEY4tz1eeGyh5XcZ/O6qSF1tyE3\n\tJWXQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"msQGbA2q\"; 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=lxqK9ryVYJYYkTjSeTRaI0AsUv563issP0mEV9l+D1I=;\n\tb=zLHfGbrKhLnIDi9iAIGAveaW61he8OSUDrv+1O2LETstmTDYTjySVGpi6qNFE3FvOW\n\tBr8ZaUvIJsP7fVNGA2FBW4lkzGnbAMTEfcOf1Sr6Sbd0jjxKpugzcdBbpIxKvA5bHaO4\n\tqKf8HHPmTHLUGtTYAuJO4n12zeBssWfnFS7F9k7Pp9hbb9nXV8wYOZUkB+PsortNgL9w\n\tMedlaiiKQD+PXeXD6/iRCTpxEAl8T+Y+hQMwiieiMxwchCrsBATCXnsS2XGu+LAAMom8\n\tfq8xxRyLgpVdtiC5GcmTT0jm0jGZ/t3IbfXqE9Hm6G9HsLSCdq//hy6BQOpPRGuUHqxb\n\tab4A==","X-Gm-Message-State":"ACrzQf2rZILA/I7bbn2gfuymtRjK0bFdKVsm+khfCzEA4WoTix+tjkW4\n\t9L08yYz4MjwKBeooI64BO6YN3oR0GaQYZQ==","X-Google-Smtp-Source":"AMsMyM7fWxEMz4Df4F0StJml//8dtQ8ZUWDdZm+p77DCgIZSh2i8St1xrYIpSAmRY40XI87BhSS9jg==","X-Received":"by 2002:a05:6000:184e:b0:22e:4612:496d with SMTP id\n\tc14-20020a056000184e00b0022e4612496dmr3431400wri.91.1665753536214; \n\tFri, 14 Oct 2022 06:18:56 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 14 Oct 2022 14:18:42 +0100","Message-Id":"<20221014131846.27169-7-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20221014131846.27169-1-naush@raspberrypi.com>","References":"<20221014131846.27169-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v1 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>\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 fc674e4f5bdd..2aba0430c02e 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1030,21 +1030,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@@ -1061,6 +1046,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","v1","06/10"]}