Patch Detail
Show a patch.
GET /api/1.1/patches/18946/?format=api
{ "id": 18946, "url": "https://patchwork.libcamera.org/api/1.1/patches/18946/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18946/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20230821131039.127370-4-gabbymg94@gmail.com>", "date": "2023-08-21T13:10:37", "name": "[libcamera-devel,RFC,v2,3/5] libcamera: v4l2 device: Store buffer info in planes", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "d47412e03e705c70062ac9e765a3f0571bdd9916", "submitter": { "id": 160, "url": "https://patchwork.libcamera.org/api/1.1/people/160/?format=api", "name": "Gabrielle George", "email": "gabbymg94@gmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18946/mbox/", "series": [ { "id": 4004, "url": "https://patchwork.libcamera.org/api/1.1/series/4004/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4004", "date": "2023-08-21T13:10:34", "name": "Add UVC Metadata buffer timestamp support", "version": 2, "mbox": "https://patchwork.libcamera.org/series/4004/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18946/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18946/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 5077EC32B1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 21 Aug 2023 13:10:49 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D79B8628C0;\n\tMon, 21 Aug 2023 15:10:48 +0200 (CEST)", "from mail-oa1-x36.google.com (mail-oa1-x36.google.com\n\t[IPv6:2001:4860:4864:20::36])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1B8FB627E1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Aug 2023 15:10:46 +0200 (CEST)", "by mail-oa1-x36.google.com with SMTP id\n\t586e51a60fabf-1c4dd644cf8so2202463fac.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Aug 2023 06:10:46 -0700 (PDT)", "from localhost.localdomain (97-115-76-16.ptld.qwest.net.\n\t[97.115.76.16]) by smtp.gmail.com with ESMTPSA id\n\tci1-20020a056871c48100b001bb51450d85sm4160283oac.4.2023.08.21.06.10.43\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 21 Aug 2023 06:10:44 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1692623448;\n\tbh=x0m3Q6Zm5HNEYCWrPDKCa4gssb4L4IG3sXuRHUIlQiY=;\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=IMix/AsxD5AZoeQ5jqN62BP4sh2PiEwjpJjQfm8Z5Gt/5ecm5N9Z+k48O8KmUXr+y\n\tVRhtgM5c4oTq1mdi35LiODTRSnuTpzHpDAI9voZFylsGvKAMgcRNfoYJ5DwPoop2rj\n\tiVKmGCaa9JgYPcHx7TxyIccdgj6dgl9tz0GJ/ewc5Zyk98C0zjZpfVZTTk/zZYvR3X\n\twy/sh0BubSnCj8MubZgRojOGi0HpP8fLt8G+asY+WyG6FhT63zIAxO5Y1p7nW53ZD/\n\t5K9xO5kwjVu2rrIHABf9k1uLCRyPW3BWMmvHZfO0z2wKBoN/SfqhLvGLc0XNgD9Cc2\n\tboavBcKnB44kw==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20221208; t=1692623444; x=1693228244;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:to:from:from:to:cc:subject:date:message-id\n\t:reply-to; bh=nS1565gi8HITXrBfkzEzaklAo8ZiCurdIwCfe5mRzKg=;\n\tb=GvwjXhmZnKwXgiHvvIBI7WFqCpCfIyKjbtkvDD73oz7XlGjJ4FU5rr4Exm31In2rDM\n\tRLJq6/xPRWav9LbZ9vxWePdU1XUds+Ij/KFLwF10ILCULdHUQBi0L0UWIsZ5n5i2Mv5H\n\tkCdp008rEa46aSjDLgLLFjgTsOW60efp6XSFZVYheR/FhFLQ48xWfzmYO4Vu57s3qd2R\n\t7DT1WTwligYoXGpF0570uIiFT/hJpB655OurMUqQJwYRvUNNFV4aTI8JxxO5fmB/ReWT\n\tLqUQlR8UE6CpLOv2QIIaUdxm9aR5Idhbm8BqhIkrPk7SWm+oHMaNjFToTx9BnvuN5i+G\n\tDsUw==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"GvwjXhmZ\"; dkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1692623444; x=1693228244;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=nS1565gi8HITXrBfkzEzaklAo8ZiCurdIwCfe5mRzKg=;\n\tb=aFkBcZLKsxFRO9D0uQS3hPUper1757TUHzWUN7MeJBq5FoarRRu5V3hZF0LtoYpbLG\n\tPEH872Y5EODIJeG6z1pKSAAorOzdNFd4byrU8lqXzh1N42TIyzwIpJy+o8VK7nveox14\n\tyNTvOUuKi/cQ3vEPFHculCW1NpPKDd4+79aKYNCm+LRsjNEnn6kUOPG9CNP7/6AkWnXr\n\tej9BXQezNzsRlscuB3eNdawRzaio+VLa7dpDf5SpBR2HkbZe/RMsBKyyudpQlyco/dmd\n\tCdU6dQ5sNgayi+Vm7Ao0r2JCcwLlOEbMlemuBkCDYtYhvAry4zWPS9fdZosE22C+ehOt\n\tp8QQ==", "X-Gm-Message-State": "AOJu0Ywd/CTuos+Ohv0pSoq3tVuobRccvNkS8Jy4Y/FuqYJU8xU9e4hW\n\tah0/O3JpVz+aSaq+0iK3YEyf1INTvlg=", "X-Google-Smtp-Source": "AGHT+IEJmgsGy9aZkt9MLs2B85KK4lKLaxgd7vEqCTitMK+t+4iqvf7ZgM/61brhB9CqPgPEHh7tjw==", "X-Received": "by 2002:a05:6870:470e:b0:1be:deef:748a with SMTP id\n\tb14-20020a056870470e00b001bedeef748amr9832354oaq.50.1692623444515; \n\tMon, 21 Aug 2023 06:10:44 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org, kieran.bingham@ideasonboard.com,\n\tvedantparanjape160201@gmail.com, gabbymg94@gmail.com", "Date": "Mon, 21 Aug 2023 06:10:37 -0700", "Message-Id": "<20230821131039.127370-4-gabbymg94@gmail.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20230821131039.127370-1-gabbymg94@gmail.com>", "References": "<20230821131039.127370-1-gabbymg94@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [RFC PATCH v2 3/5] libcamera: v4l2 device: Store\n\tbuffer info in planes", "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": "Gabby George via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Gabby George <gabbymg94@gmail.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "To perform a memory mapping using mmap, the MappedFrameBuffer class\nneeds the plane offset and file descriptor information of the frame\nbuffer's plane(s). This information is provided in the response to\nREQBUF, which happens during buffer allocation. Store the plane offset\nand file descriptor information in the buffer's plane at the time of\nallocation.\n\nCurrently, there is a metadata buffer type (metadata format UVCH) that\ndoes not support exporting buffers using EXPBUF, so this should only\nbe done if the buffer type is metadata capture.\n\nSigned-off-by: Gabby George <gabbymg94@gmail.com>\n---\n src/libcamera/v4l2_videodevice.cpp | 31 +++++++++++++++++++-----------\n 1 file changed, 20 insertions(+), 11 deletions(-)", "diff": "diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex a72ef64d..e57cb131 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -1402,18 +1402,27 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index)\n \n \tstd::vector<FrameBuffer::Plane> planes;\n \tfor (unsigned int nplane = 0; nplane < numPlanes; nplane++) {\n-\t\tUniqueFD fd = exportDmabufFd(buf.index, nplane);\n-\t\tif (!fd.isValid())\n-\t\t\treturn nullptr;\n-\n \t\tFrameBuffer::Plane plane;\n-\t\tplane.fd = SharedFD(std::move(fd));\n-\t\t/*\n-\t\t * V4L2 API doesn't provide dmabuf offset information of plane.\n-\t\t * Set 0 as a placeholder offset.\n-\t\t * \\todo Set the right offset once V4L2 API provides a way.\n-\t\t */\n-\t\tplane.offset = 0;\n+\n+\t\tif (buf.type == V4L2_BUF_TYPE_META_CAPTURE) {\n+\t\t\t/*\n+\t\t\t * Dmabuf fd is not exported for metadata, so store\n+\t\t\t * the offset from the querybuf call and this device's fd.\n+\t\t\t */\n+\t\t\tplane.fd = SharedFD(this->fd());\n+\t\t\tplane.offset = buf.m.offset;\n+\t\t} else {\n+\t\t\tUniqueFD fd = exportDmabufFd(buf.index, nplane);\n+\t\t\tif (!fd.isValid())\n+\t\t\t\treturn nullptr;\n+\t\t\tplane.fd = SharedFD(std::move(fd));\n+\t\t\t/*\n+\t\t\t* V4L2 API doesn't provide dmabuf offset information of plane.\n+\t\t\t* Set 0 as a placeholder offset.\n+\t\t\t* \\todo Set the right offset once V4L2 API provides a way.\n+\t\t\t*/\n+\t\t\tplane.offset = 0;\n+\t\t}\n \t\tplane.length = multiPlanar ? buf.m.planes[nplane].length : buf.length;\n \n \t\tplanes.push_back(std::move(plane));\n", "prefixes": [ "libcamera-devel", "RFC", "v2", "3/5" ] }