{"id":14881,"url":"https://patchwork.libcamera.org/api/1.1/patches/14881/?format=json","web_url":"https://patchwork.libcamera.org/patch/14881/","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":"<20211130085830.1529550-1-vedantparanjape160201@gmail.com>","date":"2021-11-30T08:58:30","name":"[libcamera-devel,v2] v4l2: V4L2CameraProxy: Add support for DMABUF buffer I/O in REQBUF ioctl","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"f5b4df6a3c81fd2835bc290b07ca349a062d4680","submitter":{"id":85,"url":"https://patchwork.libcamera.org/api/1.1/people/85/?format=json","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14881/mbox/","series":[{"id":2780,"url":"https://patchwork.libcamera.org/api/1.1/series/2780/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2780","date":"2021-11-30T08:58:30","name":"[libcamera-devel,v2] v4l2: V4L2CameraProxy: Add support for DMABUF buffer I/O in REQBUF ioctl","version":2,"mbox":"https://patchwork.libcamera.org/series/2780/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14881/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14881/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 11206BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Nov 2021 08:59:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 34377605B4;\n\tTue, 30 Nov 2021 09:59:10 +0100 (CET)","from mail-pg1-x532.google.com (mail-pg1-x532.google.com\n\t[IPv6:2607:f8b0:4864:20::532])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D56D460230\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 09:59:07 +0100 (CET)","by mail-pg1-x532.google.com with SMTP id j11so9156968pgs.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 00:59:07 -0800 (PST)","from localhost.localdomain ([1.186.166.200])\n\tby smtp.googlemail.com with ESMTPSA id\n\tv10sm20838133pfu.123.2021.11.30.00.59.04\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 30 Nov 2021 00:59:05 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"EdxJQ3Vn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=Jw+LipgdGzjWcoydliNySzQq4j9bCXeiAIAwp8Tn7zs=;\n\tb=EdxJQ3VnfwmKmV0XxjvyzwMG9/wmiN05EJYsZeX5lFtA66KoTfhVlOezis9ahV7DDC\n\tYYExUTUGbM7w5rW3qYX8G2Rcg0uJg0UfW/tMzFhOvu5oE92J+4eyqj5LigfQuNw4+GqK\n\tPXwXLT7RvvWxYgKkt7kZONg+inHgfv6n3AVbupdwK2qUMUuQFXCpnBbg4PiaNsMCAebg\n\tfwcZeET9C6dwx9tC9jCeoxPjGSCdclElktUg+RDPmi+7nza5KfryTWZXSSrMa9MQFeKu\n\txY1uNQf944qpZmCIfFNcMQcAosljAkKolOgIX2ZBS1SMmQj6CHZOvLpmXlPUqCVHCH89\n\tWlUw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=Jw+LipgdGzjWcoydliNySzQq4j9bCXeiAIAwp8Tn7zs=;\n\tb=Op9OQ7EE6BJxfCIunLxnMlQ+rzE4hIDSMMIClYH8L0+DpPmJ1vAplWxiaHIWg/fSO5\n\tdRt5cWb8+rZkQZ+NVPd723HymegymLGhnQVYFjgZeXr609aOjJg4HU1rUStFDpkw7Fvq\n\tSwQkFsXoZvCYzEylLxFzYk2oEFPj7gWiJ4Qg3Pyd60ntblKuZQWkULMlptjbYv9wkh5p\n\tz8y2sItd+ByhkU5BKejeOieiB5yqeYDejyEioIpq4Gtyotq07kwW7cKrIuSxsl6U8uiC\n\trgzy4Ne0nD6PFpi7q537kj7vpKIA3h4PDGWKGwbrYOfV59gCQ/hgIQjm0fpF2KlKzVbp\n\t9PKw==","X-Gm-Message-State":"AOAM531fp5clEOAnKox59VKzZBVRdzXP4zuNlxtk9DOiSG/ym644jg9j\n\t6b6r5KbexL71Ac/Uz4/0EISt7DnfSXcxfmIn","X-Google-Smtp-Source":"ABdhPJyL/EijjL/usrNLlKWh4ynBLj2sEPIR5Oi89iNJxbNdUsQaihcHRj6V7j84Uv0juE8Q8FfnJg==","X-Received":"by 2002:a65:40c3:: with SMTP id\n\tu3mr39606432pgp.160.1638262745997; \n\tTue, 30 Nov 2021 00:59:05 -0800 (PST)","From":"Vedant Paranjape <vedantparanjape160201@gmail.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 30 Nov 2021 14:28:30 +0530","Message-Id":"<20211130085830.1529550-1-vedantparanjape160201@gmail.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2] v4l2: V4L2CameraProxy: Add support for\n\tDMABUF buffer I/O in REQBUF ioctl","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>","Cc":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"To support importing DMABUF, we need to reqbufs with DMABUF mode.\n\nThis patch enables using V4L2_MEMORY_DMABUF as one of the memory types\nin vidioc_reqbuf to initialise DMA Buffer I/O\n\nBug: https://bugs.libcamera.org/show_bug.cgi?id=89\n\nSigned-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n---\n src/v4l2/v4l2_camera_proxy.cpp | 8 +++++---\n 1 file changed, 5 insertions(+), 3 deletions(-)","diff":"diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\nindex f194e06345b7..49db766d9f9d 100644\n--- a/src/v4l2/v4l2_camera_proxy.cpp\n+++ b/src/v4l2/v4l2_camera_proxy.cpp\n@@ -160,7 +160,8 @@ bool V4L2CameraProxy::validateBufferType(uint32_t type)\n \n bool V4L2CameraProxy::validateMemoryType(uint32_t memory)\n {\n-\treturn memory == V4L2_MEMORY_MMAP;\n+\treturn (memory == V4L2_MEMORY_MMAP) ||\n+\t       (memory == V4L2_MEMORY_DMABUF);\n }\n \n void V4L2CameraProxy::setFmtFromConfig(const StreamConfiguration &streamConfig)\n@@ -468,7 +469,8 @@ int V4L2CameraProxy::vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuf\n \tif (!hasOwnership(file) && owner_)\n \t\treturn -EBUSY;\n \n-\targ->capabilities = V4L2_BUF_CAP_SUPPORTS_MMAP;\n+\targ->capabilities = V4L2_BUF_CAP_SUPPORTS_MMAP |\n+\t\t\t    V4L2_BUF_CAP_SUPPORTS_DMABUF;\n \tmemset(arg->reserved, 0, sizeof(arg->reserved));\n \n \tif (arg->count == 0) {\n@@ -511,7 +513,7 @@ int V4L2CameraProxy::vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuf\n \t\tstruct v4l2_buffer buf = {};\n \t\tbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;\n \t\tbuf.length = v4l2PixFormat_.sizeimage;\n-\t\tbuf.memory = V4L2_MEMORY_MMAP;\n+\t\tbuf.memory = arg->memory;\n \t\tbuf.m.offset = i * v4l2PixFormat_.sizeimage;\n \t\tbuf.index = i;\n \t\tbuf.flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;\n","prefixes":["libcamera-devel","v2"]}