Show a patch.

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

{
    "id": 8820,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/8820/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/8820/",
    "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": "<20200715093911.554684-1-naush@raspberrypi.com>",
    "date": "2020-07-15T09:39:10",
    "name": "[libcamera-devel,v2,1/2] include: linux: Add dma-buf.h and dma-heap.h UAPI headers",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b3b9e84f966db4e90ff90f70ac5d0f9fa4b04c5a",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/8820/mbox/",
    "series": [
        {
            "id": 1109,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1109/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1109",
            "date": "2020-07-15T09:39:10",
            "name": "[libcamera-devel,v2,1/2] include: linux: Add dma-buf.h and dma-heap.h UAPI headers",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1109/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/8820/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/8820/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 8655ABD790\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jul 2020 09:39:21 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0CEAA60993;\n\tWed, 15 Jul 2020 11:39:21 +0200 (CEST)",
            "from mail-wr1-x443.google.com (mail-wr1-x443.google.com\n\t[IPv6:2a00:1450:4864:20::443])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A4DBA605B0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2020 11:39:19 +0200 (CEST)",
            "by mail-wr1-x443.google.com with SMTP id z2so1743111wrp.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jul 2020 02:39:19 -0700 (PDT)",
            "from naushir-VirtualBox.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tj145sm2730785wmj.7.2020.07.15.02.39.17\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 15 Jul 2020 02:39:17 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"jhYxQPfh\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=qMWF/tn7sh4I9tmtx0QCFi1d0CsjwBBNPrQwF1OtyZ0=;\n\tb=jhYxQPfhZcRct/IxNZ5zQ2tLREF2iAbQIcugqvBvGu1wzu/CXJnL2itDKE4DIk3G47\n\t7fTW6gEvDwKgSZ6USC31RUNuFgQ2tTWiQUgf48uiBTeuzKBZDDzyg0XqexEfnpaIlmyJ\n\tXez7S58Ac0jUQLpOLLgP/hyv+QnFDHYCqaGeo+llD2GE12xRFQBKqnPm9Ij74P8PVwBt\n\t3wFr2CkWNmGc/vKQNXtR3g4l6v/pqmxYZzXi4FToWrCF7F0umvgeO7OGPD7i21dYU5x2\n\tXpCV9WWaLkuPDfiQDc7t86fDcBjX7Pw9KNwqouEXI8FTAgkGb0NGKvFUJD+OWn0Gp1yV\n\tHrow==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=qMWF/tn7sh4I9tmtx0QCFi1d0CsjwBBNPrQwF1OtyZ0=;\n\tb=LS31eCLO8rbS8hQSxZAqCdmWvZwvfcuIt6lkHnDzTCg0gxvmDe2cj5WfxByh1Urmkk\n\tIxSaZXOVxLFz3vXqZsXLlZmmJ8COeRQftCdiqyr4PdoEZkKVn12mX+6En8siMRHLcvY6\n\to6aCdtac69RZnctBtEGoRKAcCSN4dpfei07dP0tk5zOScrNWFUQY7U+nro+GMFKsZ68q\n\tZT8egXXLXqABJ//VCc2Nd/4xQGXe5DKzODeXLLGbm34kESoNyRDg5CcYsPzyk3Yct6Ml\n\tdW4+pY25+onMKB3Oc4BmFXdHyawZ4AqevHTFYQOslQpMoYSFnBEvMFWwaZe7/uUXW7Xq\n\tQx7w==",
        "X-Gm-Message-State": "AOAM531ygrSubnSj/+qVewDWqTV65APcIRx+wAb1Ez0QGqcpslJnZfWK\n\tN+CHGpMPRrDibQX3A2rJSQtrGuj7tjo=",
        "X-Google-Smtp-Source": "ABdhPJxd1scXGPHmTile5aNeOOjbLawDdDoyWI3QfnNYc72RiDxoVEDQ6yfAvVWmaf6AWlSPooZXcA==",
        "X-Received": "by 2002:adf:f504:: with SMTP id\n\tq4mr10165164wro.163.1594805958714; \n\tWed, 15 Jul 2020 02:39:18 -0700 (PDT)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 15 Jul 2020 10:39:10 +0100",
        "Message-Id": "<20200715093911.554684-1-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2 1/2] include: linux: Add dma-buf.h and\n\tdma-heap.h UAPI headers",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "This commit adds the dmabuf UAPI headers from the mainline Linux kernel\nv5.6.19. They are required by the Raspberry Pi library for lens shading\ntable allocations.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n include/linux/dma-buf.h  | 50 +++++++++++++++++++++++++++++++++++++\n include/linux/dma-heap.h | 53 ++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 103 insertions(+)\n create mode 100644 include/linux/dma-buf.h\n create mode 100644 include/linux/dma-heap.h",
    "diff": "diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h\nnew file mode 100644\nindex 00000000..7f30393b\n--- /dev/null\n+++ b/include/linux/dma-buf.h\n@@ -0,0 +1,50 @@\n+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n+/*\n+ * Framework for buffer objects that can be shared across devices/subsystems.\n+ *\n+ * Copyright(C) 2015 Intel Ltd\n+ *\n+ * This program is free software; you can redistribute it and/or modify it\n+ * under the terms of the GNU General Public License version 2 as published by\n+ * the Free Software Foundation.\n+ *\n+ * This program is distributed in the hope that it will be useful, but WITHOUT\n+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\n+ * more details.\n+ *\n+ * You should have received a copy of the GNU General Public License along with\n+ * this program.  If not, see <http://www.gnu.org/licenses/>.\n+ */\n+\n+#ifndef _DMA_BUF_UAPI_H_\n+#define _DMA_BUF_UAPI_H_\n+\n+#include <linux/types.h>\n+\n+/* begin/end dma-buf functions used for userspace mmap. */\n+struct dma_buf_sync {\n+\t__u64 flags;\n+};\n+\n+#define DMA_BUF_SYNC_READ      (1 << 0)\n+#define DMA_BUF_SYNC_WRITE     (2 << 0)\n+#define DMA_BUF_SYNC_RW        (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE)\n+#define DMA_BUF_SYNC_START     (0 << 2)\n+#define DMA_BUF_SYNC_END       (1 << 2)\n+#define DMA_BUF_SYNC_VALID_FLAGS_MASK \\\n+\t(DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)\n+\n+#define DMA_BUF_NAME_LEN\t32\n+\n+#define DMA_BUF_BASE\t\t'b'\n+#define DMA_BUF_IOCTL_SYNC\t_IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)\n+\n+/* 32/64bitness of this uapi was botched in android, there's no difference\n+ * between them in actual uapi, they're just different numbers.\n+ */\n+#define DMA_BUF_SET_NAME\t_IOW(DMA_BUF_BASE, 1, const char *)\n+#define DMA_BUF_SET_NAME_A\t_IOW(DMA_BUF_BASE, 1, u32)\n+#define DMA_BUF_SET_NAME_B\t_IOW(DMA_BUF_BASE, 1, u64)\n+\n+#endif\ndiff --git a/include/linux/dma-heap.h b/include/linux/dma-heap.h\nnew file mode 100644\nindex 00000000..6f84fa08\n--- /dev/null\n+++ b/include/linux/dma-heap.h\n@@ -0,0 +1,53 @@\n+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n+/*\n+ * DMABUF Heaps Userspace API\n+ *\n+ * Copyright (C) 2011 Google, Inc.\n+ * Copyright (C) 2019 Linaro Ltd.\n+ */\n+#ifndef _UAPI_LINUX_DMABUF_POOL_H\n+#define _UAPI_LINUX_DMABUF_POOL_H\n+\n+#include <linux/ioctl.h>\n+#include <linux/types.h>\n+\n+/**\n+ * DOC: DMABUF Heaps Userspace API\n+ */\n+\n+/* Valid FD_FLAGS are O_CLOEXEC, O_RDONLY, O_WRONLY, O_RDWR */\n+#define DMA_HEAP_VALID_FD_FLAGS (O_CLOEXEC | O_ACCMODE)\n+\n+/* Currently no heap flags */\n+#define DMA_HEAP_VALID_HEAP_FLAGS (0)\n+\n+/**\n+ * struct dma_heap_allocation_data - metadata passed from userspace for\n+ *                                      allocations\n+ * @len:\t\tsize of the allocation\n+ * @fd:\t\t\twill be populated with a fd which provides the\n+ *\t\t\thandle to the allocated dma-buf\n+ * @fd_flags:\t\tfile descriptor flags used when allocating\n+ * @heap_flags:\t\tflags passed to heap\n+ *\n+ * Provided by userspace as an argument to the ioctl\n+ */\n+struct dma_heap_allocation_data {\n+\t__u64 len;\n+\t__u32 fd;\n+\t__u32 fd_flags;\n+\t__u64 heap_flags;\n+};\n+\n+#define DMA_HEAP_IOC_MAGIC\t\t'H'\n+\n+/**\n+ * DOC: DMA_HEAP_IOCTL_ALLOC - allocate memory from pool\n+ *\n+ * Takes a dma_heap_allocation_data struct and returns it with the fd field\n+ * populated with the dmabuf handle of the allocation.\n+ */\n+#define DMA_HEAP_IOCTL_ALLOC\t_IOWR(DMA_HEAP_IOC_MAGIC, 0x0,\\\n+\t\t\t\t      struct dma_heap_allocation_data)\n+\n+#endif /* _UAPI_LINUX_DMABUF_POOL_H */\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "1/2"
    ]
}