{"id":11010,"url":"https://patchwork.libcamera.org/api/1.1/patches/11010/?format=json","web_url":"https://patchwork.libcamera.org/patch/11010/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20210126162412.824033-2-naush@raspberrypi.com>","date":"2021-01-26T16:24:07","name":"[libcamera-devel,v4,1/6] pipeline: raspberrypi: Refactor stream configuration routine","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"3c53070314cb60664d10f5e1f9b3de039ba31e6f","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11010/mbox/","series":[{"id":1611,"url":"https://patchwork.libcamera.org/api/1.1/series/1611/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1611","date":"2021-01-26T16:24:06","name":"Raspberry Pi: Colour denoise","version":4,"mbox":"https://patchwork.libcamera.org/series/1611/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11010/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11010/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 4C928C0F2B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Jan 2021 16:24:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1F4D66831C;\n\tTue, 26 Jan 2021 17:24:20 +0100 (CET)","from mail-wm1-x331.google.com (mail-wm1-x331.google.com\n\t[IPv6:2a00:1450:4864:20::331])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4ACE168312\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Jan 2021 17:24:18 +0100 (CET)","by mail-wm1-x331.google.com with SMTP id j18so2961184wmi.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Jan 2021 08:24:18 -0800 (PST)","from naushir-VirtualBox.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tm18sm8725809wrx.17.2021.01.26.08.24.16\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 26 Jan 2021 08:24:17 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"X8EeQbms\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=UyFjSnujeS0bFhaSast+12b5DEuvqd6mLGYgdgtqrLs=;\n\tb=X8EeQbmstPDazgYMl25LVW5B8LFWsNNmXmhY4eNytAwPgxaFsfudt8OPlL6AgGour6\n\t1lgeKBmN1cAq+GYd94L3q+H5Ue2Mlrix5uI6KzK7PTBkV6tzj9X8MqKUy9Nudf92pOLZ\n\t3DbHsIY3S2Y/2HCTGpi0vM6cjEwYgbozEOaAVXaEVGZs3+s9rI0S+RDBKbZid4KAmrWB\n\tBhLvLVZsN+e6Na4jBP90wmxK2LR2fBPWvNGxmRA4KNHjeEYe1lrVgiVpwkpk/qIx1kFe\n\t6/Itfq4tqMSFQIQWDcWRWRbHdldOy8yiFby4nTbzSeC/M5Un6q+x7rgs0u0dF0Edmrwy\n\tyg1A==","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:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=UyFjSnujeS0bFhaSast+12b5DEuvqd6mLGYgdgtqrLs=;\n\tb=mQX6v1LbeeNno/uevPsBC8KbDUxdJ4TBs7RhvC7+ZxTEfBwyrTy/1UnF4XZ4AkmLE1\n\tAu5YQrpwUbPu931k1skUXpArck+Sesv4pdYI0sizk33FcMuqHrexhP0siiIzpOx29I8u\n\t/nzvIUiXwf4OnbA8lsQlAqUxKJyjmaIo1uCu/NflKGnOHCzvkLEcWG9ARedwjA3DdG46\n\tPkQmPxtPijyO+qkScRl0oMq/zhU4nvq1ixN6TRFavNsvGCyc+ScNqUUh0fv7GGX9Egi2\n\tQB/9OWvAXfLmMOEFsnz/PmN67oWcTuuDHzhMt7bzSWmEj8YGwWcYf+8fnm9An9vJ+Sd2\n\ttvvw==","X-Gm-Message-State":"AOAM530qtKpEJNJjmmFgDRTryCkdNLqeya2472VZz/76a16aP/+kP0Wj\n\tJSC500CSViWBDL8G+4JYv7BFJfoqv0MIFxfV","X-Google-Smtp-Source":"ABdhPJwYeYmBSxdbo3VDSZ/rKwOVtmI8+WDid0CNYd0ItJHBQbdNXhNpooDmu5wd2iOlwXbRWHWt8A==","X-Received":"by 2002:a1c:3b02:: with SMTP id i2mr438213wma.141.1611678257693; \n\tTue, 26 Jan 2021 08:24:17 -0800 (PST)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 26 Jan 2021 16:24:07 +0000","Message-Id":"<20210126162412.824033-2-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210126162412.824033-1-naush@raspberrypi.com>","References":"<20210126162412.824033-1-naush@raspberrypi.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v4 1/6] pipeline: raspberrypi: Refactor\n\tstream configuration routine","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>","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>"},"content":"Refactor the high/low resolution stream format and output selection\nroutine. This change is in preparation of adding 1/4 resolution output\nfor fast colour denoise.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp      | 57 ++++++-------------\n 1 file changed, 16 insertions(+), 41 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 524cc960dd37..d9895c779725 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -624,52 +624,27 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n \t\t\tcontinue;\n \t\t}\n \n-\t\tif (i == maxIndex) {\n-\t\t\t/* ISP main output format. */\n-\t\t\tV4L2VideoDevice *dev = data->isp_[Isp::Output0].dev();\n-\t\t\tV4L2PixelFormat fourcc = dev->toV4L2PixelFormat(cfg.pixelFormat);\n-\t\t\tformat.size = cfg.size;\n-\t\t\tformat.fourcc = fourcc;\n-\n-\t\t\tret = dev->setFormat(&format);\n-\t\t\tif (ret)\n-\t\t\t\treturn -EINVAL;\n-\n-\t\t\tif (format.size != cfg.size || format.fourcc != fourcc) {\n-\t\t\t\tLOG(RPI, Error)\n-\t\t\t\t\t<< \"Failed to set format on ISP capture0 device: \"\n-\t\t\t\t\t<< format.toString();\n-\t\t\t\treturn -EINVAL;\n-\t\t\t}\n-\n-\t\t\tcfg.setStream(&data->isp_[Isp::Output0]);\n-\t\t\tdata->isp_[Isp::Output0].setExternal(true);\n-\t\t}\n+\t\t/* The largest resolution gets routed to the ISP Output 0 node. */\n+\t\tRPi::Stream *stream = (i == maxIndex) ? &data->isp_[Isp::Output0]\n+\t\t\t\t\t\t      : &data->isp_[Isp::Output1];\n \n-\t\t/*\n-\t\t * ISP second output format. This fallthrough means that if a\n-\t\t * second output stream has not been configured, we simply use\n-\t\t * the Output0 configuration.\n-\t\t */\n-\t\tV4L2VideoDevice *dev = data->isp_[Isp::Output1].dev();\n-\t\tformat.fourcc = dev->toV4L2PixelFormat(cfg.pixelFormat);\n+\t\tV4L2PixelFormat fourcc = stream->dev()->toV4L2PixelFormat(cfg.pixelFormat);\n \t\tformat.size = cfg.size;\n+\t\tformat.fourcc = fourcc;\n \n-\t\tret = dev->setFormat(&format);\n-\t\tif (ret) {\n+\t\tret = stream->dev()->setFormat(&format);\n+\t\tif (ret)\n+\t\t\treturn -EINVAL;\n+\n+\t\tif (format.size != cfg.size || format.fourcc != fourcc) {\n \t\t\tLOG(RPI, Error)\n-\t\t\t\t<< \"Failed to set format on ISP capture1 device: \"\n-\t\t\t\t<< format.toString();\n-\t\t\treturn ret;\n-\t\t}\n-\t\t/*\n-\t\t * If we have not yet provided a stream for this config, it\n-\t\t * means this is to be routed from Output1.\n-\t\t */\n-\t\tif (!cfg.stream()) {\n-\t\t\tcfg.setStream(&data->isp_[Isp::Output1]);\n-\t\t\tdata->isp_[Isp::Output1].setExternal(true);\n+\t\t\t\t<< \"Failed get requested format on \" << stream->name()\n+\t\t\t\t<< \", returned \" << format.toString();\n+\t\t\treturn -EINVAL;\n \t\t}\n+\n+\t\tcfg.setStream(stream);\n+\t\tstream->setExternal(true);\n \t}\n \n \t/* ISP statistics output format. */\n","prefixes":["libcamera-devel","v4","1/6"]}