Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux...
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / rogue_m / include / pvr_fd_sync_kernel.h
1 /*************************************************************************/ /*!
2 @File           pvr_fd_sync_kernel.h
3 @Title          Kernel/userspace interface definitions to use the kernel sync
4                 driver
5 @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
6 @License        Dual MIT/GPLv2
7
8 The contents of this file are subject to the MIT license as set out below.
9
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 Alternatively, the contents of this file may be used under the terms of
21 the GNU General Public License Version 2 ("GPL") in which case the provisions
22 of GPL are applicable instead of those above.
23
24 If you wish to allow use of your version of this file only under the terms of
25 GPL, and not to allow others to use your version of this file under the terms
26 of the MIT license, indicate your decision by deleting the provisions above
27 and replace them with the notice and other provisions required by GPL as set
28 out in the file called "GPL-COPYING" included in this distribution. If you do
29 not delete the provisions above, a recipient may use your version of this file
30 under the terms of either the MIT license or GPL.
31
32 This License is also included in this distribution in the file called
33 "MIT-COPYING".
34
35 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
36 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
37 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
38 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
39 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
40 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
41 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42 */ /**************************************************************************/
43 /* vi: set ts=8: */
44
45
46 #ifndef _PVR_FD_SYNC_KERNEL_H_
47 #define _PVR_FD_SYNC_KERNEL_H_
48
49 #include <linux/types.h>
50 #include <linux/ioctl.h>
51
52 #define PVR_SYNC_MAX_QUERY_FENCE_POINTS 14
53
54 #define PVR_SYNC_IOC_MAGIC 'W'
55
56 #define PVR_SYNC_IOC_CREATE_FENCE \
57  _IOWR(PVR_SYNC_IOC_MAGIC, 0, struct pvr_sync_create_fence_ioctl_data)
58
59 #define PVR_SYNC_IOC_ENABLE_FENCING \
60  _IOW(PVR_SYNC_IOC_MAGIC,  1, struct pvr_sync_enable_fencing_ioctl_data)
61
62 #define PVR_SYNC_IOC_ALLOC_FENCE \
63  _IOWR(PVR_SYNC_IOC_MAGIC, 3, struct pvr_sync_alloc_fence_ioctl_data)
64
65 #define PVR_SYNC_IOC_RENAME \
66  _IOWR(PVR_SYNC_IOC_MAGIC, 4, struct pvr_sync_rename_ioctl_data)
67
68 #define PVR_SYNC_IOC_FORCE_SW_ONLY \
69  _IO(PVR_SYNC_IOC_MAGIC,   5)
70
71 #define PVRSYNC_MODNAME "pvr_sync"
72
73 struct pvr_sync_alloc_fence_ioctl_data
74 {
75         /* Output */
76         int                             iFenceFd;
77         int                             bTimelineIdle;
78 }
79 __attribute__((packed, aligned(8)));
80
81 struct pvr_sync_create_fence_ioctl_data
82 {
83         /* Input */
84         int                             iAllocFenceFd;
85         char                            szName[32];
86
87         /* Output */
88         int                             iFenceFd;
89 }
90 __attribute__((packed, aligned(8)));
91
92 struct pvr_sync_enable_fencing_ioctl_data
93 {
94         /* Input */
95         int                             bFencingEnabled;
96 }
97 __attribute__((packed, aligned(8)));
98
99 struct pvr_sync_pt_info {
100         /* Output */
101         __u32 id;
102         __u32 ui32FWAddr;
103         __u32 ui32CurrOp;
104         __u32 ui32NextOp;
105         __u32 ui32TlTaken;
106 } __attribute__((packed, aligned(8)));
107
108 struct pvr_sync_rename_ioctl_data
109 {
110         /* Input */
111         char szName[32];
112 } __attribute__((packed, aligned(8)));
113
114 #endif /* _PVR_FD_SYNC_KERNEL_H_ */