219d34c42272422fe67777f3ec7b924045ac2cde
[platform/kernel/linux-rpi.git] / include / uapi / drm / vc4_drm.h
1 /*
2  * Copyright © 2014-2015 Broadcom
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice (including the next
12  * paragraph) shall be included in all copies or substantial portions of the
13  * Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21  * IN THE SOFTWARE.
22  */
23
24 #ifndef _UAPI_VC4_DRM_H_
25 #define _UAPI_VC4_DRM_H_
26
27 #include "drm.h"
28
29 #define DRM_VC4_CREATE_BO                         0x03
30 #define DRM_VC4_MMAP_BO                           0x04
31
32 #define DRM_IOCTL_VC4_CREATE_BO           DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_BO, struct drm_vc4_create_bo)
33 #define DRM_IOCTL_VC4_MMAP_BO             DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_MMAP_BO, struct drm_vc4_mmap_bo)
34
35 /**
36  * struct drm_vc4_create_bo - ioctl argument for creating VC4 BOs.
37  *
38  * There are currently no values for the flags argument, but it may be
39  * used in a future extension.
40  */
41 struct drm_vc4_create_bo {
42         __u32 size;
43         __u32 flags;
44         /** Returned GEM handle for the BO. */
45         __u32 handle;
46         __u32 pad;
47 };
48
49 /**
50  * struct drm_vc4_mmap_bo - ioctl argument for mapping VC4 BOs.
51  *
52  * This doesn't actually perform an mmap.  Instead, it returns the
53  * offset you need to use in an mmap on the DRM device node.  This
54  * means that tools like valgrind end up knowing about the mapped
55  * memory.
56  *
57  * There are currently no values for the flags argument, but it may be
58  * used in a future extension.
59  */
60 struct drm_vc4_mmap_bo {
61         /** Handle for the object being mapped. */
62         __u32 handle;
63         __u32 flags;
64         /** offset into the drm node to use for subsequent mmap call. */
65         __u64 offset;
66 };
67
68 #endif /* _UAPI_VC4_DRM_H_ */