[{"id":25707,"web_url":"https://patchwork.libcamera.org/comment/25707/","msgid":"<CAHW6GY+v8LBkcUt+JbFdpDbHVNbDUuLEuXBDkrDgw0O=-aT-QQ@mail.gmail.com>","date":"2022-11-01T12:06:46","subject":"Re: [libcamera-devel] [PATCH v1 06/10] pipeline: raspberrypi:\n\tReorder startup drop frame initialisation","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nThanks for the patch.\n\nOn Fri, 14 Oct 2022 at 14:19, Naushir Patuck via libcamera-devel\n<libcamera-devel@lists.libcamera.org> wrote:\n>\n> Reorder the code such that the IPA requested startup drop frames count is\n> available before the pipeline handler allocates any stream buffers.\n>\n> This will be used in a subsequent change to stop Unicam buffer allocations if\n> there are no startup drop frames required.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nThanks!\nDavid\n\n> ---\n>  .../pipeline/raspberrypi/raspberrypi.cpp      | 30 +++++++++----------\n>  1 file changed, 15 insertions(+), 15 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 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>         RPiCameraData *data = cameraData(camera);\n>         int ret;\n>\n> -       for (auto const stream : data->streams_)\n> -               stream->resetBuffers();\n> -\n> -       if (!data->buffersAllocated_) {\n> -               /* Allocate buffers for internal pipeline usage. */\n> -               ret = prepareBuffers(camera);\n> -               if (ret) {\n> -                       LOG(RPI, Error) << \"Failed to allocate buffers\";\n> -                       data->freeBuffers();\n> -                       stop(camera);\n> -                       return ret;\n> -               }\n> -               data->buffersAllocated_ = true;\n> -       }\n> -\n>         /* Check if a ScalerCrop control was specified. */\n>         if (controls)\n>                 data->applyScalerCrop(*controls);\n> @@ -1061,6 +1046,21 @@ int PipelineHandlerRPi::start(Camera *camera, const ControlList *controls)\n>         /* Configure the number of dropped frames required on startup. */\n>         data->dropFrameCount_ = startConfig.dropFrameCount;\n>\n> +       for (auto const stream : data->streams_)\n> +               stream->resetBuffers();\n> +\n> +       if (!data->buffersAllocated_) {\n> +               /* Allocate buffers for internal pipeline usage. */\n> +               ret = prepareBuffers(camera);\n> +               if (ret) {\n> +                       LOG(RPI, Error) << \"Failed to allocate buffers\";\n> +                       data->freeBuffers();\n> +                       stop(camera);\n> +                       return ret;\n> +               }\n> +               data->buffersAllocated_ = true;\n> +       }\n> +\n>         /* We need to set the dropFrameCount_ before queueing buffers. */\n>         ret = queueAllBuffers(camera);\n>         if (ret) {\n> --\n> 2.25.1\n>","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 3BF01BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  1 Nov 2022 12:07:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E44006303F;\n\tTue,  1 Nov 2022 13:06:59 +0100 (CET)","from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com\n\t[IPv6:2607:f8b0:4864:20::1035])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 16E2863009\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  1 Nov 2022 13:06:59 +0100 (CET)","by mail-pj1-x1035.google.com with SMTP id\n\tu8-20020a17090a5e4800b002106dcdd4a0so18614901pji.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 01 Nov 2022 05:06:59 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1667304419;\n\tbh=ZW/l4JgOxLJn1/9N/acmeqkw1UX2IRloEM2mrRM68fw=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=fLsfr6QABSOJUKpp/1cdZ/vWYdR0p4wpN4PzBCa6Ee25HG5upJEOt5UAXQOKgEh34\n\toBj/UentoSiqOe+g1QVUKOFgyPBUhDQ1F5ik+8jaoShOAtur7U5guieD3yAJ6aIAk8\n\tco6lc9j5heYpHSViASTfsjmtE1igIxnhze2zaWsebkqrAXAYw1uXrRPYk8T6YxnjwS\n\tVlPvUGbU9m/kd1SmpTCm3lbXubdnXx/oFi8lBfXy+4cxkKOBarGF5nlDnnSoIMRT0h\n\tPPZeTI4q9TQcE7wT+yLQxYLwJphK5vyaNZhS1fK8zYavXVIt+3lqrkW8oUkD7MYSKO\n\tSbiZ9lmxrskfA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=dnCaPCOk49CCRljnhUvLaPWuwPRsbW1DVCV8tDH567A=;\n\tb=terVEmgsOK6pbsApGGeP3x4pY7UCDf69y/psEjImGPdBuvqG2EOdLRM1oGOmgZIu2J\n\tDFi/OCZaBLEXH70NIOcMHOqcvjxO7rr7Hu4Ycs/+4PeuZJVnKgSuk1W3HMhQED4PKnzv\n\tBOYa/CQcEH/FGSwUENSB7CyXOFFvOhvwC5QbQlxG6uASXiScUAwjNC93L3lZKAUGqAIC\n\tlMqePgszLdgBzLA+iBJE+fJ7rRr70LDZGqdTCc4nWKNDcQbBeDAiKP1oRGZXA9iHCGoC\n\tbDl+R9BxRqi7lQ52xbEa0xdJiX/GO5lYw/HluVCXUAQZGtmex96W2JEnA0vU8bkfCpR+\n\tYL7Q=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"terVEmgs\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=dnCaPCOk49CCRljnhUvLaPWuwPRsbW1DVCV8tDH567A=;\n\tb=t609OWHJsTIYVQqc7AM3J1KHGKhGQ5DEWyqitjDFJl4hpRIfQIqjOk43XczS7qWL5P\n\tpg2E7PgE5XzqrwSPW5H6sDyrTAnPGz4P5WuhVxlKgYi478cN3+7YuPDfn+ktTHP3EN7K\n\tuNWasPn1pw7vErqmVYDgy5Gm5paJwpXaQI0Rv/FwfiFEUKwYpYiWk0i2PnV9ZtuRy3lW\n\tH/6RbmxzFooga2r9bgpHBitQYV4WKhzlq88c6JC1OEkeDDb8TJr4Kek0LPVF4clF0x2z\n\t/ng0KUrDBrcA3kp/vOSvVMhLMJc3jWiQbaIFtQU7MQ1GOioenyyqEUOOplkV2jmS6+Xh\n\tv5wg==","X-Gm-Message-State":"ACrzQf0JjbMVpF8zMAoi08PhLxgeg3dW7nFHjphiCxl9Dz0D29cNcah7\n\t0XfyfkDP1VEkzH51PKouod2Kwo3eZsDIJFVpMPcmqIDqc4Q=","X-Google-Smtp-Source":"AMsMyM4qcZUOh9RhFYql3uSUMEvv8V/5W3IpkjKr4bma73VZxFlzfAYKi36rgO2WZ4HENIaOo+kMRXvbqC9mlNhvs1U=","X-Received":"by 2002:a17:902:720a:b0:181:150c:fcc4 with SMTP id\n\tba10-20020a170902720a00b00181150cfcc4mr19627276plb.109.1667304417634;\n\tTue, 01 Nov 2022 05:06:57 -0700 (PDT)","MIME-Version":"1.0","References":"<20221014131846.27169-1-naush@raspberrypi.com>\n\t<20221014131846.27169-7-naush@raspberrypi.com>","In-Reply-To":"<20221014131846.27169-7-naush@raspberrypi.com>","Date":"Tue, 1 Nov 2022 12:06:46 +0000","Message-ID":"<CAHW6GY+v8LBkcUt+JbFdpDbHVNbDUuLEuXBDkrDgw0O=-aT-QQ@mail.gmail.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v1 06/10] pipeline: raspberrypi:\n\tReorder startup 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":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]