{"id":11575,"url":"https://patchwork.libcamera.org/api/1.1/patches/11575/?format=json","web_url":"https://patchwork.libcamera.org/patch/11575/","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":"<20210313102741.2890809-3-naush@raspberrypi.com>","date":"2021-03-13T10:27:41","name":"[libcamera-devel,2/2] pipeline: raspberrypi: Use a default format for ISP::Output0","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"b51d16d5dad6457c08569877f8c6ee17a3eba0bf","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/11575/mbox/","series":[{"id":1789,"url":"https://patchwork.libcamera.org/api/1.1/series/1789/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1789","date":"2021-03-13T10:27:39","name":"RaspberryPi: Fixes for compliance","version":1,"mbox":"https://patchwork.libcamera.org/series/1789/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11575/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11575/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 381F0BD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 13 Mar 2021 10:27:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E42D868C6F;\n\tSat, 13 Mar 2021 11:27:50 +0100 (CET)","from mail-wr1-x432.google.com (mail-wr1-x432.google.com\n\t[IPv6:2a00:1450:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DD40568C6B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Mar 2021 11:27:48 +0100 (CET)","by mail-wr1-x432.google.com with SMTP id u16so6147174wrt.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Mar 2021 02:27:48 -0800 (PST)","from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tg5sm11760178wrq.30.2021.03.13.02.27.47\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 13 Mar 2021 02:27:47 -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=\"BEMguwvJ\"; 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=oGXfsRkbz8HkDNI8+Qu7uF2j02Mpg1d79eTG83Gb1KI=;\n\tb=BEMguwvJpelShv0GkytsQTdDw96i1y9+mrsHDG5pwubNVqn741NAy0bE1jvMt8CnJW\n\tjNijz58Q10SzB+pyZVcrmK0FpIOfAZubF1Amk7GmGZkejfWVQAmw5Y79u6+GIyY6bBaU\n\tYd9Lop2PPHbOwWTxo1B4YFOwwFB8BFkXBZ/vsap98WneR7Bi3hXdi1tT8VVTrZcdsdRW\n\tXrcz+K50M7xclt7qnb14+YMWumpKveIDmhYRirRnk1vKFdGmdVH+kp2qO/BSK31gYoRI\n\t4dTgOhw6g+yPSPp/t28/fj2gugczD4ilhaFUv1CXdu82uwdcKf08f0OX+JKXJiTZdAD2\n\t+LQA==","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=oGXfsRkbz8HkDNI8+Qu7uF2j02Mpg1d79eTG83Gb1KI=;\n\tb=QR6E21jPBRJE8QdZMpb8tdqQc+ETE2+v8TzlCEXMT1WZRZW301Z2hMX9A8oI/YIaP2\n\t0ERHdnONSN9RjKboKJEWfio1SEtd4EVT/B9d+InuruZ71bP4mMyz8e7YRlAHHmUnhL28\n\tLl9SQesP3NaYAQ57hpD6PzMhxwAWXq2n3rNxDX9vJ2TLhvJwBW3/8VMi+jUHm9n/glFK\n\tlj5IP9r0/160W7raSKMcyzP3WFGdO34olpuUh0klU/zsP24ZCV9UM3i25gk1UGLTs6Uk\n\tqBu8cZFw4Co+7uQmYG80cyTi+K1Vo8031SzlnyYkPlLGRl/vvAvdcKTWgew/qWSEMUbE\n\tVnNg==","X-Gm-Message-State":"AOAM533k9/wydpePUi6i2EDhjIY47pxBBMxujo9STfEUDjmB/Ew/3QtT\n\t/VcojccaTjNYnCFUD1aMPrA3D4JmK99KYg==","X-Google-Smtp-Source":"ABdhPJzzLvymkPIVelHR0yCQfg+8JE1y3WmgEpq2/0sNU0qBiyeuEqPKD34Rs0x9MN6CFc52ys70CA==","X-Received":"by 2002:adf:e60a:: with SMTP id\n\tp10mr18596622wrm.291.1615631268268; \n\tSat, 13 Mar 2021 02:27:48 -0800 (PST)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Sat, 13 Mar 2021 10:27:41 +0000","Message-Id":"<20210313102741.2890809-3-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210313102741.2890809-1-naush@raspberrypi.com>","References":"<20210313102741.2890809-1-naush@raspberrypi.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 2/2] pipeline: raspberrypi: Use a default\n\tformat for ISP::Output0","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":"If the ISP::Output1 stream has not been configured, we must enable it\nwith a default format and resolution for internal use. This is to allow\nthe pipeline handler data flow to be consistent, and allow the IPA to\nreceive statistics for the frame.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp      | 30 ++++++++++++++++++-\n 1 file changed, 29 insertions(+), 1 deletion(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 9847e926b048..5cc04ce4eb92 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -625,7 +625,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n \t * StreamConfiguration appropriately.\n \t */\n \tV4L2DeviceFormat format;\n-\tbool output1Set = false;\n+\tbool output0Set = false, output1Set = false;\n \tfor (unsigned i = 0; i < config->size(); i++) {\n \t\tStreamConfiguration &cfg = config->at(i);\n \n@@ -662,6 +662,34 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n \n \t\tif (i != maxIndex)\n \t\t\toutput1Set = true;\n+\t\telse\n+\t\t\toutput0Set = true;\n+\t}\n+\n+\t/*\n+\t * If ISP::Output0 stream has not been configured by the application,\n+\t * we must allow the hardware to generate an output so that the data\n+\t * flow in the pipeline handler remains consistent, and we still generate\n+\t * statistics for the IPA to use. So enable the output at a very low\n+\t * resolution for internal use.\n+\t *\n+\t * \\todo Allow the pipeline to work correctly without Output0 and only\n+\t * statistics coming from the hardware.\n+\t */\n+\tif (!output0Set) {\n+\t\tmaxSize = Size(320, 240);\n+\t\tformat = {};\n+\t\tformat.size = maxSize;\n+\t\tformat.fourcc = V4L2PixelFormat::fromPixelFormat(formats::YUV420, false);\n+\t\tret = data->isp_[Isp::Output0].dev()->setFormat(&format);\n+\t\tif (ret) {\n+\t\t\tLOG(RPI, Error) << \"Failed to set default format on ISP Output0: \"\n+\t\t\t\t\t<< ret;\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tLOG(RPI, Debug) << \"Defaulting ISP Output0 format to \"\n+\t\t\t\t<< format.toString();\n \t}\n \n \t/*\n","prefixes":["libcamera-devel","2/2"]}