{"id":15426,"url":"https://patchwork.libcamera.org/api/1.1/patches/15426/?format=json","web_url":"https://patchwork.libcamera.org/patch/15426/","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":"<20220307124633.115452-2-naush@raspberrypi.com>","date":"2022-03-07T12:46:28","name":"[libcamera-devel,v1,1/6] pipeline: raspberrypi: Avoid over-allocation for ISP Output 1","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"53af004f828588596acebb54539b9c11ac8383f7","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/15426/mbox/","series":[{"id":2954,"url":"https://patchwork.libcamera.org/api/1.1/series/2954/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2954","date":"2022-03-07T12:46:27","name":"Raspberry Pi: Efficient start/stop/start sequences","version":1,"mbox":"https://patchwork.libcamera.org/series/2954/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15426/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15426/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\r\n\t[92.243.16.209])\r\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0715FC3261\r\n\tfor <parsemail@patchwork.libcamera.org>;\r\n\tMon,  7 Mar 2022 12:46:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\r\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 77CAA604EC;\r\n\tMon,  7 Mar 2022 13:46:41 +0100 (CET)","from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com\r\n\t[IPv6:2a00:1450:4864:20::42e])\r\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C7EC8604EC\r\n\tfor <libcamera-devel@lists.libcamera.org>;\r\n\tMon,  7 Mar 2022 13:46:39 +0100 (CET)","by mail-wr1-x42e.google.com with SMTP id n15so8963434wra.6\r\n\tfor <libcamera-devel@lists.libcamera.org>;\r\n\tMon, 07 Mar 2022 04:46:39 -0800 (PST)","from naush-laptop.pitowers.org\r\n\t([2a00:1098:3142:14:c644:e9b3:de0b:54c5])\r\n\tby smtp.gmail.com with ESMTPSA id\r\n\tz6-20020a1cf406000000b0037c4e2d3baesm19759582wma.19.2022.03.07.04.46.38\r\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\r\n\tMon, 07 Mar 2022 04:46:38 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\r\n\ts=mail; t=1646657201;\r\n\tbh=yvZddnRTtjoThmsHUks+8mxudSbdofrYzJUoaHH94Ys=;\r\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\r\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\r\n\tFrom;\r\n\tb=2Os/ifDYPRVN8pwmFkKFA4p8jqT3WKBdBl381bGi1oW0XErxlH7p9U83q2/XpgbKi\r\n\tnIg9FQW+VEY06FNvXitA8eMlo3JASwT3VCGFVvOXoyCQZ8UgBH6/L/sE6s1p6PcVso\r\n\tWvZHyO3cYf0GjsYr48+0bXbBhGFJMQZNYW5TH0BbZ2n8G43KbrY396OydJz/D1Qeu3\r\n\tkP2PrjvQmYMToqVmFzatj+ECxl7r50P80Q/DHRc9uO3/Q8QYl/2SB4rrWezPnqmXJ5\r\n\tfBXWXvv2n9RUo25VWXmMjSknrWRHLBMItCdDN6bvdVUaXoiHojrldlzmLK5T/ZfO5T\r\n\tSgDkBP3TJSvpg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\r\n\td=raspberrypi.com; s=google;\r\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\r\n\t:mime-version:content-transfer-encoding;\r\n\tbh=ygJkOrdw8Zj5D+CKG9Kj3kJ5HukkraTyrN0mscQXzlk=;\r\n\tb=hQR849S1sp0jmrG4WkY/rLlFU5qTrLj/CyZ6j8unlgwlVEVTaPztxnopwAtl+BNqhq\r\n\tu5DTB5UgMb4Je5cK1bra6aKTuYZfODl0x3CY9OhswDHuiqrZI4EkXcVjrljRRRRM9jv4\r\n\tdyfm6pCqnDho5Qj9JZ+OWOIwK4eI+IZd/K38Jtu6dCU31jjz18TS/NasuDGGZsX9BQKY\r\n\ty+eHKp53KbPnoTya8efW/+2CgHFD6Vqs46Q5gKWg+xsQpvZIVCnCWHGO3hwu+UTSofn3\r\n\tZR+ZsNCUGB2RoBDrYsA/UlyQG+b2sbXKLbM3fFYGk/tCNRRFB0H5wQtlGNbra6+lekn7\r\n\tLDEw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \r\n\tunprotected) header.d=raspberrypi.com\r\n\theader.i=@raspberrypi.com\r\n\theader.b=\"hQR849S1\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\r\n\td=1e100.net; s=20210112;\r\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r\n\t:references:mime-version:content-transfer-encoding;\r\n\tbh=ygJkOrdw8Zj5D+CKG9Kj3kJ5HukkraTyrN0mscQXzlk=;\r\n\tb=667oWzQUV6TaPpu5tF9Ax9+YAyRCnIhMG4+5lFZanYm+SVyrGCKrQKXgewlNdAh+wf\r\n\t6ygh6wU2MuxkmoGt6VH45dOF9oGx7v1a2RQM38WU1bNRJTyzUT5DWCa/pltXkaPksn90\r\n\tNke5or5bWB3tnY7yVi5B0DZfoqZoJCD1qgHYIBbQf5/8BP76RL0A6VZr4X8TxES9TQxA\r\n\tvTvmD5QEooOk5lj+ypu/kLilrZEA76sKJBJnCAcISLfXm7jaiH/+bnjWl3XbD1nI+set\r\n\tLalpMuk+uE+gWA8g71pCuystuIH1WSNTR2qrwb32AgZBMpW3sZDBpa4fi/G5Xmlwdj7I\r\n\t8Bjw==","X-Gm-Message-State":"AOAM530czSRkL6NjGlmMtPfI99cG4fV3db9bFCd7ZYY4wEHreL7voR+Q\r\n\tfwsy6naeaXM8eGoRMwVSM/TyGHoo0dXkLA==","X-Google-Smtp-Source":"ABdhPJzfGYBwvMa1TWcE78yi43B7EPsOl6//SbWpzUEE8amtTpp6bR9frQYMj77wjtdBViNrQq1EUA==","X-Received":"by 2002:adf:e19d:0:b0:1f1:d7eb:71f with SMTP id\r\n\taz29-20020adfe19d000000b001f1d7eb071fmr8281495wrb.512.1646657199320; \r\n\tMon, 07 Mar 2022 04:46:39 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  7 Mar 2022 12:46:28 +0000","Message-Id":"<20220307124633.115452-2-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20220307124633.115452-1-naush@raspberrypi.com>","References":"<20220307124633.115452-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v1 1/6] pipeline: raspberrypi: Avoid\r\n\tover-allocation for ISP Output 1","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>,\r\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>,\r\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Naushir Patuck via libcamera-devel\r\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":"The V4L2DeviceFormat structure for the ISP Output 1 node was a copy of what is\nused ISP Output 1 node, but with the size changed. However, the plane size and\nstride values were not updated. So there is a possibility that the buffer might\nbe over-sized for the requested resolution.\n\nFix this by only copying the relevent fields from the ISP Output 0\nV4L2DeviceFormat structure, and let the device driver size the planes as needed.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\r\nindex 29bff9d6eee4..d604c473c26c 100644\r\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\r\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\r\n@@ -844,11 +844,13 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\r\n \t * colour denoise will not run.\r\n \t */\r\n \tif (!output1Set) {\r\n-\t\tV4L2DeviceFormat output1Format = format;\r\n+\t\tV4L2DeviceFormat output1Format;\r\n \t\tconstexpr Size maxDimensions(1200, 1200);\r\n \t\tconst Size limit = maxDimensions.boundedToAspectRatio(format.size);\r\n \r\n \t\toutput1Format.size = (format.size / 2).boundedTo(limit).alignedDownTo(2, 2);\r\n+\t\toutput1Format.colorSpace = format.colorSpace;\r\n+\t\toutput1Format.fourcc = V4L2PixelFormat::fromPixelFormat(formats::YUV420);\r\n \r\n \t\tLOG(RPI, Debug) << \"Setting ISP Output1 (internal) to \"\r\n \t\t\t\t<< output1Format.toString();","prefixes":["libcamera-devel","v1","1/6"]}