[{"id":11559,"web_url":"https://patchwork.libcamera.org/comment/11559/","msgid":"<20200724151654.GA5400@kaaira-HP-Pavilion-Notebook>","date":"2020-07-24T15:16:54","subject":"Re: [libcamera-devel] [PATCH 6/7] libcamera: pipeline: vimc: Queue\n\tthe buffers","submitter":{"id":39,"url":"https://patchwork.libcamera.org/api/people/39/","name":"Kaaira Gupta","email":"kgupta@es.iitr.ac.in"},"content":"On Wed, Jul 22, 2020 at 07:00:08PM +0530, Kaaira Gupta wrote:\n> Queue the buffers correctly according to the streams requested.\n> \n> Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>\n> ---\n>  src/libcamera/pipeline/vimc/vimc.cpp | 31 +++++++++++++++++++---------\n>  1 file changed, 21 insertions(+), 10 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\n> index 6010e1e..7e8d355 100644\n> --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> @@ -536,19 +536,30 @@ int PipelineHandlerVimc::processControls(VimcCameraData *data, Request *request)\n>  int PipelineHandlerVimc::queueRequestDevice(Camera *camera, Request *request)\n>  {\n>  \tVimcCameraData *data = cameraData(camera);\n> -\tFrameBuffer *buffer = request->findBuffer(&data->rgbStream_);\n> -\tif (!buffer) {\n> -\t\tLOG(VIMC, Error)\n> -\t\t\t<< \"Attempt to queue request with invalid stream\";\n> +\tfor (auto it : request->buffers()) {\n> +\t\tStream *stream = static_cast<Stream *>(it.first);\n> +\t\tFrameBuffer *buffer = it.second;\n> +\t\tif (!buffer) {\n> +\t\t\tLOG(VIMC, Error)\n> +\t\t\t\t<< \"Attempt to queue request with invalid stream\";\n> +\n> +\t\t\treturn -ENOENT;\n> +\t\t}\n>  \n> -\t\treturn -ENOENT;\n> -\t}\n> +\t\tint ret;\n>  \n> -\tint ret = processControls(data, request);\n> -\tif (ret < 0)\n> -\t\treturn ret;\n> +\t\tif (stream == &data->rgbStream_)\n> +\t\t\tret = data->video_->queueBuffer(buffer);\n> +\t\tif (stream == &data->rawStream_)\n> +\t\t\tret = data->raw_->queueBuffer(buffer);\n> +\t\telse\n> +\t\t\tcontinue;\n>  \n> -\tret = data->video_->queueBuffer(buffer);\n> +\t\tif (ret < 0)\n> +\t\t\treturn ret;\n> +\t\treturn ret;\n\nThis return statement prevents control from moving out of the loop.\nIt should be removed.\n\n> +\t}\n> +\tint ret = processControls(data, request);\n>  \tif (ret < 0)\n>  \t\treturn ret;\n\nSince there is a 'return 0' after this, it could simply be\n\n\tret = processControls(data, request);\n\treturn ret;\n\nby declaring ret outside of the loop ofcourse.\n\n>  \n> -- \n> 2.17.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 8911ABD878\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Jul 2020 15:17:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1EC6F60540;\n\tFri, 24 Jul 2020 17:17:10 +0200 (CEST)","from mail-pf1-x444.google.com (mail-pf1-x444.google.com\n\t[IPv6:2607:f8b0:4864:20::444])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AD08560535\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Jul 2020 17:17:08 +0200 (CEST)","by mail-pf1-x444.google.com with SMTP id m9so5295495pfh.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Jul 2020 08:17:08 -0700 (PDT)","from kaaira-HP-Pavilion-Notebook\n\t([2401:4900:417b:9d16:4deb:bf11:98f6:86e6])\n\tby smtp.gmail.com with ESMTPSA id\n\ts131sm6766411pgc.30.2020.07.24.08.17.03\n\t(version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);\n\tFri, 24 Jul 2020 08:17:05 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=es-iitr-ac-in.20150623.gappssmtp.com\n\theader.i=@es-iitr-ac-in.20150623.gappssmtp.com\n\theader.b=\"YozB1DsY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623;\n\th=from:date:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=OpFhC3bvvnqherliIcrttZ4Re2AVo7nYtKGEVe5KDTM=;\n\tb=YozB1DsYxvjiH7bERW+nvtfyEex0imHNbGFSt4tMr233GysKBnzDZextP/aE4RZ0oq\n\txeg90U2KOvobmOcKtuRaNYi53V4Wi99kQYj+QkecJbJ3KYjlvOAJFxYWh90Pl8zDrgXD\n\tJLgdHQ22huIaKVsMZP+EjvwgpKeItf+PulV67shLUNM/bpJeByf3LhbxOzdE1XHE9j0i\n\t+mrRwvevfLBXG1BocltUZ7CnBsCWrUh8j/nDbPLu76iTz0IaT12vr8l2eGtPcCkqzvxE\n\txTv5k266Z+CJLOKbP+p9+t82LcL2ba8M/KDri2SYNuKsFFIHPy8uiTtMSWjmIUwPzHel\n\teUxg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:date:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=OpFhC3bvvnqherliIcrttZ4Re2AVo7nYtKGEVe5KDTM=;\n\tb=UisVVqm+T3G75FkNTDb+K1bcMoW7TLvqZHMMGIMYtf81/rztxAzezoAsrHnpzAWIvK\n\tx91TZ2yXv8NFhYFWLHnUuYlK5kpDmJqpHJkDnqkJSIVy+qTjAz3M6DbePSQSbsaygP4F\n\ts2nKWPz36aCY+GaJoUCg4VVFAJAiwkFJKSvMGm0U//BHhAUu5pNf1+QO4hCIW7qqlwwZ\n\tg+ENlJJ9bjlYrCuKqdlwBJ8MKBMW3pDDOLgTPi5GyrUpRtDD40w6XEQEH6/R0FTggHev\n\tX5BPIpdPY/UrPuy1vStjF+ixGUjXr0rf6LM427sf3KTD8UI6+sXvIZgaTDgvAAzrGx6l\n\tUmVA==","X-Gm-Message-State":"AOAM530iUZorfcBYMsnRONB5v9hpwNU7fooSjqPLzAtBxuTg82IlHNjN\n\tkI65Bn1Uit3My+wfmpqcv7J0hg==","X-Google-Smtp-Source":"ABdhPJz9SW45IjAIg9o0pc1gJXps0AnvED3QbxQkVPnMHv4C445aectxY/Lnpj83/h8Qjn/iUHSiFQ==","X-Received":"by 2002:a63:2e86:: with SMTP id\n\tu128mr2625775pgu.228.1595603826062; \n\tFri, 24 Jul 2020 08:17:06 -0700 (PDT)","From":"Kaaira Gupta <kgupta@es.iitr.ac.in>","X-Google-Original-From":"Kaaira Gupta <Kaairakgupta@es.iitr.ac.in>","Date":"Fri, 24 Jul 2020 20:46:54 +0530","To":"Kaaira Gupta <kgupta@es.iitr.ac.in>","Message-ID":"<20200724151654.GA5400@kaaira-HP-Pavilion-Notebook>","References":"<20200722133009.26528-1-kgupta@es.iitr.ac.in>\n\t<20200722133009.26528-7-kgupta@es.iitr.ac.in>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200722133009.26528-7-kgupta@es.iitr.ac.in>","User-Agent":"Mutt/1.9.4 (2018-02-28)","Subject":"Re: [libcamera-devel] [PATCH 6/7] libcamera: pipeline: vimc: Queue\n\tthe buffers","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]