{"id":13622,"url":"https://patchwork.libcamera.org/api/patches/13622/?format=json","web_url":"https://patchwork.libcamera.org/patch/13622/","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":"<20210906020100.14430-12-laurent.pinchart@ideasonboard.com>","date":"2021-09-06T02:00:44","name":"[libcamera-devel,v2,11/27] libcamera: v4l2_videodevice: Document plane handling in createBuffer()","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"248a6765181881eb2665f01519b17ea636331a0a","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/13622/mbox/","series":[{"id":2446,"url":"https://patchwork.libcamera.org/api/series/2446/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2446","date":"2021-09-06T02:00:33","name":"libcamera: Handle fallout of FrameBuffer offset support","version":2,"mbox":"https://patchwork.libcamera.org/series/2446/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13622/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13622/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 654F6C324A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Sep 2021 02:01:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E521E6917F;\n\tMon,  6 Sep 2021 04:01:38 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5F77069179\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Sep 2021 04:01:25 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id ED952317;\n\tMon,  6 Sep 2021 04:01:24 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"VrGhWzjH\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630893685;\n\tbh=01N1ZgIx+X2DwgcJlzMy1w63JnMIRFmJhfzVca4M7jU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=VrGhWzjHepnMnBLrpGtDT1hJ1udRpvBobZW0XHuIpvXQcpxyPPJL7avXukj9C2rUT\n\tP24iwVGzvPdqpAAhJbqW7m88MdsiSQNWaPUXwRFgcrWJnG1bswPPSbxnJfCkYk9I00\n\tgQBPq5nfJh9vFGCqYQpCnApubJyOH15CARHwIbt4=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  6 Sep 2021 05:00:44 +0300","Message-Id":"<20210906020100.14430-12-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.32.0","In-Reply-To":"<20210906020100.14430-1-laurent.pinchart@ideasonboard.com>","References":"<20210906020100.14430-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 11/27] libcamera: v4l2_videodevice:\n\tDocument plane handling in createBuffer()","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The V4L2VideoDevice::createBuffer() calculates offsets manually when\nusing a multi-planar pixel format and a single-planar V4L2 format. The\nprocess isn't trivial, document it.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/v4l2_videodevice.cpp | 9 +++++++++\n 1 file changed, 9 insertions(+)","diff":"diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex 1483181a0856..88535f5a07c7 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -1334,10 +1334,19 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index)\n \t}\n \n \t/*\n+\t * If we have a multi-planar format with a V4L2 single-planar buffer,\n+\t * split the single V4L2 plane into multiple FrameBuffer planes by\n+\t * computing the offsets manually.\n+\t *\n \t * The format info is not guaranteed to be valid, as there are no\n \t * PixelFormatInfo for metadata formats, so check it first.\n \t */\n \tif (formatInfo_->isValid() && formatInfo_->numPlanes() != numPlanes) {\n+\t\t/*\n+\t\t * There's no valid situation where the number of colour planes\n+\t\t * differs from the number of V4L2 planes and the V4L2 buffer\n+\t\t * has more than one plane.\n+\t\t */\n \t\tASSERT(numPlanes == 1u);\n \n \t\tplanes.resize(formatInfo_->numPlanes());\n","prefixes":["libcamera-devel","v2","11/27"]}