History

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.

Greg Hackmann committed 7 years ago

Commit bb2bb901 parent ed63bb13 files · +69 −4Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/dma-buf.h+3−0
@@ -35,7 +35,10 @@ struct dma_buf_sync { · 34 unmodified lines
35#define DMA_BUF_SYNC_VALID_FLAGS_MASK \35#define DMA_BUF_SYNC_VALID_FLAGS_MASK \
36 (DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)36 (DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)
37 37
38#define DMA_BUF_NAME_LEN 32
39
38#define DMA_BUF_BASE 'b'40#define DMA_BUF_BASE 'b'
39#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)41#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
42#define DMA_BUF_SET_NAME _IOW(DMA_BUF_BASE, 1, const char *)
40 43
41#endif44#endif