{"id":17973,"url":"https://patchwork.libcamera.org/api/patches/17973/?format=json","web_url":"https://patchwork.libcamera.org/patch/17973/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20221209090050.19441-10-naush@raspberrypi.com>","date":"2022-12-09T09:00:47","name":"[libcamera-devel,v4,09/12] pipeline: raspberrypi: Validate MandatoryRequestBuffer in queueRequestDevice()","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"2d49d047ed065b29af84598198e31b7facc0bdfd","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17973/mbox/","series":[{"id":3663,"url":"https://patchwork.libcamera.org/api/series/3663/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3663","date":"2022-12-09T09:00:38","name":"Raspberry Pi: Platform configuration and buffer allocation improvements","version":4,"mbox":"https://patchwork.libcamera.org/series/3663/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17973/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17973/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 0C936BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 Dec 2022 09:01:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AFEFB63364;\n\tFri,  9 Dec 2022 10:01:41 +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 CD1BB63360\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Dec 2022 10:01:35 +0100 (CET)","by mail-wm1-x331.google.com with SMTP id\n\tf13-20020a1cc90d000000b003d08c4cf679so2904970wmb.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 09 Dec 2022 01:01:35 -0800 (PST)","from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tbd10-20020a05600c1f0a00b003cf774c31a0sm7773674wmb.16.2022.12.09.01.01.34\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 09 Dec 2022 01:01:34 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1670576501;\n\tbh=d7Qi8omVLjX6Hj2aZtGXJjcZEqUCQWLP8qUpHRkfNM4=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=p53K+Hqlgf1fdN1CSm7INzZumBHkcZiVhk8OIoLwFPRKSk3FvczI8JPAwRBTc0Cgw\n\tZ8gvIucbeWxCiv+ca7LwD5eEnxr6NqwvBfOFq9iJDcoPrdGiNsurn2ff6xNMxibgjo\n\tuGO3E9TcXDFqYw5qPtW0o0woUfwPERIGZvf2wFUuWA4S58HUZAnJeukYnuy4M2wKZm\n\t7/++NYGW99m/mODMhfaa9h7YF6Ocn6fDHrcXDW2oonPEuZvkU3M8MKfbesqfjWecBc\n\tprIjY0m3bxcCnfSAOuCm6NCSzTTM+9blPLKxMI5BrHb0/zcBoMozbHQ0JHdGnWhg96\n\tHQS545F1RrGPA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=rCI8A1BvcyB6cCko9jaDzabqfodtnUyq6LuLmTxg2ik=;\n\tb=WF1L/nOSSIYSL0W2C+M8Tgc8zrdLhmHEP51n25hTbPn/KlhLfrJcJFUYNC8Jn3hks3\n\tf8Be6WJC63e7pD8o0JOcnBEduJ59aJrlLzRImfXmXw1+yK8cEwMx9zUZ9XosoOK/S1TR\n\ttqjenMSDT3yAX2r1eQ3xOMaMzbu6F9q9ViYAJ2S0E59Y52q7FYPS6w1hfNERhDcLPisO\n\thv6b2ScpfzhrFbZUZYHUD8dnAn949nNrcr1N78dcAkuNvBXnx9F7wdEQHJFzcpeYQTX5\n\tbdmBJ9f2znCceatcTrKjbZpX5HOHQA6V98OtSsuoPFNqiPZ2X6QUShCml1ZTGCr6UmNk\n\tqqsw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"WF1L/nOS\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=rCI8A1BvcyB6cCko9jaDzabqfodtnUyq6LuLmTxg2ik=;\n\tb=fRXczBZ5fIEoC+Ui/qCn2i4vLbE0rDKMktNJwCHL+aLZYWmjCW4JqR3eIxFC/ylmy7\n\tNN//iU8EvyzImTFNrTnwZ/q94yWPTA2GnQ8FrC4+NdUt26cig2uviXY962o76RoNclao\n\t9lVjuVaCXul1dwsZhQWSxxA4/IosE19eXGy2TXR+E57OZRtL1YysEVLEGmusLrXfqPCj\n\tZ733YlSohSqSlLKBWBDNYqa4LiA4PhiFUF7LBbAgXbwlnaxoRjvfs4cf22J6NW97R/Up\n\t9XkjwDSSuvkvMBQ8dNolVnmmXlX4If8JILi7n9N/sVs0UF0zpjwo6l+eASQZo73IVmwS\n\t4Cdg==","X-Gm-Message-State":"ANoB5pkv7aH5RE7t8zmyCeuzGBX1XhYQT2DLAI39FiyybqZ73dL6DPAW\n\teUKjta2AslYZuGm63kokdRkCIuTv6x/37OS1","X-Google-Smtp-Source":"AA0mqf6ApOc7NMiGg2UsNq6zJCf6mbUhmFi/7vgxJX6NrCVyYay3L6TOqybpTH5OtLM3K2Bvpb6ggw==","X-Received":"by 2002:a1c:cc1a:0:b0:3cf:5583:8b3f with SMTP id\n\th26-20020a1ccc1a000000b003cf55838b3fmr4421669wmb.20.1670576495241; \n\tFri, 09 Dec 2022 01:01:35 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  9 Dec 2022 09:00:47 +0000","Message-Id":"<20221209090050.19441-10-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20221209090050.19441-1-naush@raspberrypi.com>","References":"<20221209090050.19441-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 09/12] pipeline: raspberrypi: Validate\n\tMandatoryRequestBuffer in queueRequestDevice()","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":"Naushir Patuck via libcamera-devel\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":"Add some validation in queueRequestDevice() to ensure that a frame buffer is\nprovided in a Request if the MandatoryRequestBuffer flag has been set in\nthe StreamConfiguration for every configured stream.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 8 ++++++++\n 1 file changed, 8 insertions(+)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 45e66839efb9..2c2b79fa021d 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1152,6 +1152,14 @@ int PipelineHandlerRPi::queueRequestDevice(Camera *camera, Request *request)\n \t\t\tstream->setExternalBuffer(buffer);\n \t\t}\n \n+\t\tif (!buffer && (stream->configuration().hints &\n+\t\t\t\tStreamConfiguration::Hint::MandatoryRequestBuffer)) {\n+\t\t\tLOG(RPI, Error) << \"MandatoryRequestBuffer hint set for stream \"\n+\t\t\t\t\t<< stream->name()\n+\t\t\t\t\t<< \", but no request buffer provided\";\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n \t\t/*\n \t\t * If no buffer is provided by the request for this stream, we\n \t\t * queue a nullptr to the stream to signify that it must use an\n","prefixes":["libcamera-devel","v4","09/12"]}