summaryrefstree
path: root/kernel/drivers/dma-buf/dma-buf-container.h
blob: e53143374e028d4c5d8666406899ad2a4170bfeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * Copyright(C) 2018 Samsung Electronics Co., Ltd.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 as published by
 * the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _DMA_BUF_CONTAINER_H_
#define _DMA_BUF_CONTAINER_H_

#include <linux/types.h>
#include <linux/compat.h>

#include <uapi/linux/dma-buf.h>

#ifdef CONFIG_COMPAT

struct compat_dma_buf_merge {
	compat_uptr_t dma_bufs;
	__s32 count;
	__s32 dmabuf_container;
	__u32 reserved[2];
};
#define DMA_BUF_COMPAT_IOCTL_MERGE \
		_IOWR(DMA_BUF_BASE, 13, struct compat_dma_buf_merge)

#endif

struct dma_buf;

#ifdef CONFIG_DMA_BUF_CONTAINER

long dma_buf_merge_ioctl(struct dma_buf *dmabuf,
			 unsigned int cmd, unsigned long arg);

int dmabuf_container_set_mask_user(struct dma_buf *dmabuf, unsigned long arg);
int dmabuf_container_get_mask_user(struct dma_buf *dmabuf, unsigned long arg);
#else

static inline long dma_buf_merge_ioctl(struct dma_buf *dmabuf,
				       unsigned int cmd, unsigned long arg)
{
	return -ENOTTY;
}

static inline int dmabuf_container_set_mask_user(struct dma_buf *dmabuf,
						 unsigned long arg)
{
	return -ENOTTY;
}
static inline int dmabuf_container_get_mask_user(struct dma_buf *dmabuf,
						 unsigned long arg)
{
	return -ENOTTY;
}
#endif

#endif /* _DMA_BUF_CONTAINER_H_ */