summaryrefslogtreecommitdiff
path: root/include/uapi/linux/dma-buf.h
diff options
context:
space:
mode:
authorGreg Hackmann <ghackmann@google.com>2019-06-13 15:34:07 -0700
committerSumit Semwal <sumit.semwal@linaro.org>2019-06-14 15:00:51 +0530
commitbb2bb903042517b8fb17b2bc21e00512f2dcac01 (patch)
treecae5b81f60ea2d1ceefd2e2d3bfe3fd4e8aa63da /include/uapi/linux/dma-buf.h
parented63bb1d1f8469586006a9ca63c42344401aa2ab (diff)
dma-buf: add DMA_BUF_SET_NAME ioctls
This patch adds complimentary DMA_BUF_SET_NAME ioctls, which lets userspace processes attach a free-form name to each buffer. This information can be extremely helpful for tracking and accounting shared buffers. For example, on Android, we know what each buffer will be used for at allocation time: GL, multimedia, camera, etc. The userspace allocator can use DMA_BUF_SET_NAME to associate that information with the buffer, so we can later give developers a breakdown of how much memory they're allocating for graphics, camera, etc. Signed-off-by: Greg Hackmann <ghackmann@google.com> Signed-off-by: Chenbo Feng <fengc@google.com> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20190613223408.139221-3-fengc@google.com
Diffstat (limited to 'include/uapi/linux/dma-buf.h')
-rw-r--r--include/uapi/linux/dma-buf.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/uapi/linux/dma-buf.h b/include/uapi/linux/dma-buf.h
index d75df5210a4a..dbc7092e04b5 100644
--- a/include/uapi/linux/dma-buf.h
+++ b/include/uapi/linux/dma-buf.h
@@ -35,7 +35,10 @@ struct dma_buf_sync {
#define DMA_BUF_SYNC_VALID_FLAGS_MASK \
(DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)
+#define DMA_BUF_NAME_LEN 32
+
#define DMA_BUF_BASE 'b'
#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
+#define DMA_BUF_SET_NAME _IOW(DMA_BUF_BASE, 1, const char *)
#endif