Show a patch.

GET /api/1.1/patches/14814/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 14814,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14814/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14814/",
    "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": "<20211128061556.503443-1-vedantparanjape160201@gmail.com>",
    "date": "2021-11-28T06:15:56",
    "name": "[libcamera-devel,v2] v4l2: V4L2CameraProxy: Add EXPBUF as one of the supported ioctl",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "50db2eb2a8309252c9478a508b03a0fad45fdb90",
    "submitter": {
        "id": 85,
        "url": "https://patchwork.libcamera.org/api/1.1/people/85/?format=api",
        "name": "Vedant Paranjape",
        "email": "vedantparanjape160201@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14814/mbox/",
    "series": [
        {
            "id": 2767,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2767/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2767",
            "date": "2021-11-28T06:15:56",
            "name": "[libcamera-devel,v2] v4l2: V4L2CameraProxy: Add EXPBUF as one of the supported ioctl",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/2767/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14814/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14814/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 C4D70BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Nov 2021 06:16:37 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E40326057B;\n\tSun, 28 Nov 2021 07:16:36 +0100 (CET)",
            "from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com\n\t[IPv6:2607:f8b0:4864:20::102d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4D1FF6011B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Nov 2021 07:16:35 +0100 (CET)",
            "by mail-pj1-x102d.google.com with SMTP id\n\tfv9-20020a17090b0e8900b001a6a5ab1392so11146789pjb.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 27 Nov 2021 22:16:35 -0800 (PST)",
            "from localhost.localdomain ([1.186.167.22])\n\tby smtp.googlemail.com with ESMTPSA id\n\ts4sm2731745pgj.4.2021.11.27.22.16.31\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 27 Nov 2021 22:16:32 -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=\"BBWeztDL\"; 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=Zt315uIxDO+Gv3HAdxjm813NXGUd6JBOBj3KBlV8D7A=;\n\tb=BBWeztDLtueTEgkOi7kCGrFxolQUhRjS/Q4j3QgpIn7DPKReyOAPAdNE0qb57Fk3M+\n\tQg3Qf2jgM+Fprzcunp9VO4vkcgAGvKhcSjmexa1KaIJi6cVrFkIzgeELd9ufnX+JgDJI\n\tjyXCM9ZwFibpHhf5n41JXQRcEcNNZZycl2z4o18NBVk980SRKlGPYtIB1zHvMfJsqkNY\n\tlApjWj/avciGYXXZYZdLazHM3ER8/vv0CB+fK2H+N3C+7Dbe8CNoyKXDEshaA5RpqJAy\n\tNDsyzsGtsqC8txjQsKkg0WqIgrhBUf0CizpUIHGEVmnHPtzEZ7p6g+uEOUeP52dGVccg\n\taSZQ==",
        "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=Zt315uIxDO+Gv3HAdxjm813NXGUd6JBOBj3KBlV8D7A=;\n\tb=MkZCFPQagkqPSDFOFtm8dL8blE2MMNjwieTGJJgb15JOgvDvlEstvjNnia9uxrgQVh\n\t3/vApASnFT3y4w02OlwBqRiMXhyeMEBu7OZE14OW/J4tUX9Cfs7uYmoH9pRa3qLtdUiE\n\t/yO93SJUEXcz3SRNemG3rogzkjgXPG1Vc7BXJD3H4MiyAfLYLwt00F1xzsL5cLaEwewG\n\tvSVNANxpZZnHkOXKPIYMJNUCRLRWsam3NY5bLTTIvLGK+Fvok29z2J/1WT9fwgLaWkQ6\n\tyLlx5tdSWKsQLTA111jYzZIRTdrSS6puKgYw5orAzELXL2Nhfrxf/23KPHfhlkUKQTAr\n\t6n5A==",
        "X-Gm-Message-State": "AOAM532Z1CO8Rh++zi1FC1DBihWzqmCc7w0suD7ewMgoAf6md9Ou9CPX\n\tPS51g1M5fWUsRWe1DBhZvIEyP9Yaz7+AYQ==",
        "X-Google-Smtp-Source": "ABdhPJxqC9aol2cTUP9bxPLs2ihZndI6pBkDVN2/kz/EfDvg1aDftA4P8NfQmtLpHXM9l/r5nQIhJw==",
        "X-Received": "by 2002:a17:902:860b:b0:143:87bf:648f with SMTP id\n\tf11-20020a170902860b00b0014387bf648fmr51083487plo.11.1638080193109; \n\tSat, 27 Nov 2021 22:16:33 -0800 (PST)",
        "From": "Vedant Paranjape <vedantparanjape160201@gmail.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sun, 28 Nov 2021 11:45:56 +0530",
        "Message-Id": "<20211128061556.503443-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 EXPBUF as\n\tone of the supported 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 DMABUF as one of the memory buffer, we need to implement\nEXPBUF in the v4l2 compat layer.\n\nThis patch implements vidioc_expbuf as one of the supported ioctls.\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 | 37 ++++++++++++++++++++++++++++++++++\n src/v4l2/v4l2_camera_proxy.h   |  1 +\n 2 files changed, 38 insertions(+)",
    "diff": "diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\nindex 3610e63cade3..cb2f93631ab9 100644\n--- a/src/v4l2/v4l2_camera_proxy.cpp\n+++ b/src/v4l2/v4l2_camera_proxy.cpp\n@@ -624,6 +624,39 @@ int V4L2CameraProxy::vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n \treturn 0;\n }\n \n+int V4L2CameraProxy::vidioc_expbuf(V4L2CameraFile *file, struct v4l2_exportbuffer *arg)\n+{\n+\tLOG(V4L2Compat, Debug) << \"Servicing vidioc_expbuf fd = \" << file->efd();\n+\n+\tif (!hasOwnership(file))\n+\t\treturn -EBUSY;\n+\n+\t/* \\todo Verify that the memory type is MMAP when adding DMABUF support */\n+\tif (!validateBufferType(arg->type))\n+\t\treturn -EINVAL;\n+\n+\tif (arg->index >= bufferCount_)\n+\t\treturn -EINVAL;\n+\n+\tif (arg->flags & ~(O_CLOEXEC | O_ACCMODE))\n+\t\treturn -EINVAL;\n+\n+\tLOG(V4L2Compat, Debug) << arg->index << \" : index of the buffer\";\n+\n+\tif (file->priority() < maxPriority())\n+\t\treturn -EBUSY;\n+\n+\tmemset(arg->reserved, 0, sizeof(arg->reserved));\n+\n+\targ->fd = fcntl(buffers_[arg->index].m.fd,\n+\t\t\targ->flags & O_CLOEXEC ? F_DUPFD_CLOEXEC : F_DUPFD, 0);\n+\targ->fd = fcntl(arg->fd, F_SETFL, 0);\n+\n+\tLOG(V4L2Compat, Debug) << \"Exported buffer at index: \" << arg->index;\n+\n+\treturn 0;\n+}\n+\n int V4L2CameraProxy::vidioc_streamon(V4L2CameraFile *file, int *arg)\n {\n \tLOG(V4L2Compat, Debug) << \"Servicing vidioc_streamon fd = \" << file->efd();\n@@ -685,6 +718,7 @@ const std::set<unsigned long> V4L2CameraProxy::supportedIoctls_ = {\n \tVIDIOC_QUERYBUF,\n \tVIDIOC_QBUF,\n \tVIDIOC_DQBUF,\n+\tVIDIOC_EXPBUF,\n \tVIDIOC_STREAMON,\n \tVIDIOC_STREAMOFF,\n };\n@@ -755,6 +789,9 @@ int V4L2CameraProxy::ioctl(V4L2CameraFile *file, unsigned long request, void *ar\n \tcase VIDIOC_DQBUF:\n \t\tret = vidioc_dqbuf(file, static_cast<struct v4l2_buffer *>(arg), &locker);\n \t\tbreak;\n+\tcase VIDIOC_EXPBUF:\n+\t\tret = vidioc_expbuf(file, static_cast<struct v4l2_exportbuffer *>(arg));\n+\t\tbreak;\n \tcase VIDIOC_STREAMON:\n \t\tret = vidioc_streamon(file, static_cast<int *>(arg));\n \t\tbreak;\ndiff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h\nindex fccec241879d..81ef7788e9fe 100644\n--- a/src/v4l2/v4l2_camera_proxy.h\n+++ b/src/v4l2/v4l2_camera_proxy.h\n@@ -58,6 +58,7 @@ private:\n \tint vidioc_qbuf(V4L2CameraFile *file, struct v4l2_buffer *arg);\n \tint vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg,\n \t\t\t libcamera::MutexLocker *locker);\n+\tint vidioc_expbuf(V4L2CameraFile *file, struct v4l2_exportbuffer *arg);\n \tint vidioc_streamon(V4L2CameraFile *file, int *arg);\n \tint vidioc_streamoff(V4L2CameraFile *file, int *arg);\n \n",
    "prefixes": [
        "libcamera-devel",
        "v2"
    ]
}