• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  * Framework for buffer objects that can be shared across devices/subsystems.
4  *
5  * Copyright(C) 2015 Intel Ltd
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License version 2 as published by
9  * the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef _DMA_BUF_UAPI_H_
21 #define _DMA_BUF_UAPI_H_
22 
23 #include <linux/types.h>
24 
25 /* begin/end dma-buf functions used for userspace mmap. */
26 struct dma_buf_sync {
27 	__u64 flags;
28 };
29 
30 #define DMA_BUF_SYNC_READ      (1 << 0)
31 #define DMA_BUF_SYNC_WRITE     (2 << 0)
32 #define DMA_BUF_SYNC_RW        (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE)
33 #define DMA_BUF_SYNC_START     (0 << 2)
34 #define DMA_BUF_SYNC_END       (1 << 2)
35 #define DMA_BUF_SYNC_VALID_FLAGS_MASK \
36 	(DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)
37 
38 #define DMA_BUF_NAME_LEN	32
39 
40 #define DMA_BUF_BASE		'b'
41 #define DMA_BUF_IOCTL_SYNC	_IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
42 
43 /* 32/64bitness of this uapi was botched in android, there's no difference
44  * between them in actual uapi, they're just different numbers.
45  */
46 #define DMA_BUF_SET_NAME	_IOW(DMA_BUF_BASE, 1, const char *)
47 #define DMA_BUF_SET_NAME_A	_IOW(DMA_BUF_BASE, 1, __u32)
48 #define DMA_BUF_SET_NAME_B	_IOW(DMA_BUF_BASE, 1, __u64)
49 
50 #endif
51