xref: /OK3568_Linux_fs/kernel/include/uapi/drm/vgem_drm.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright 2016 Intel Corporation
3*4882a593Smuzhiyun  * All Rights Reserved.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Permission is hereby granted, free of charge, to any person obtaining a
6*4882a593Smuzhiyun  * copy of this software and associated documentation files (the
7*4882a593Smuzhiyun  * "Software"), to deal in the Software without restriction, including
8*4882a593Smuzhiyun  * without limitation the rights to use, copy, modify, merge, publish,
9*4882a593Smuzhiyun  * distribute, sub license, and/or sell copies of the Software, and to
10*4882a593Smuzhiyun  * permit persons to whom the Software is furnished to do so, subject to
11*4882a593Smuzhiyun  * the following conditions:
12*4882a593Smuzhiyun  *
13*4882a593Smuzhiyun  * The above copyright notice and this permission notice (including the
14*4882a593Smuzhiyun  * next paragraph) shall be included in all copies or substantial portions
15*4882a593Smuzhiyun  * of the Software.
16*4882a593Smuzhiyun  *
17*4882a593Smuzhiyun  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18*4882a593Smuzhiyun  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19*4882a593Smuzhiyun  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20*4882a593Smuzhiyun  * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
21*4882a593Smuzhiyun  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22*4882a593Smuzhiyun  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23*4882a593Smuzhiyun  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24*4882a593Smuzhiyun  *
25*4882a593Smuzhiyun  */
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun #ifndef _UAPI_VGEM_DRM_H_
28*4882a593Smuzhiyun #define _UAPI_VGEM_DRM_H_
29*4882a593Smuzhiyun 
30*4882a593Smuzhiyun #include "drm.h"
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun #if defined(__cplusplus)
33*4882a593Smuzhiyun extern "C" {
34*4882a593Smuzhiyun #endif
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun /* Please note that modifications to all structs defined here are
37*4882a593Smuzhiyun  * subject to backwards-compatibility constraints.
38*4882a593Smuzhiyun  */
39*4882a593Smuzhiyun #define DRM_VGEM_FENCE_ATTACH	0x1
40*4882a593Smuzhiyun #define DRM_VGEM_FENCE_SIGNAL	0x2
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun #define DRM_IOCTL_VGEM_FENCE_ATTACH	DRM_IOWR( DRM_COMMAND_BASE + DRM_VGEM_FENCE_ATTACH, struct drm_vgem_fence_attach)
43*4882a593Smuzhiyun #define DRM_IOCTL_VGEM_FENCE_SIGNAL	DRM_IOW( DRM_COMMAND_BASE + DRM_VGEM_FENCE_SIGNAL, struct drm_vgem_fence_signal)
44*4882a593Smuzhiyun 
45*4882a593Smuzhiyun struct drm_vgem_fence_attach {
46*4882a593Smuzhiyun 	__u32 handle;
47*4882a593Smuzhiyun 	__u32 flags;
48*4882a593Smuzhiyun #define VGEM_FENCE_WRITE	0x1
49*4882a593Smuzhiyun 	__u32 out_fence;
50*4882a593Smuzhiyun 	__u32 pad;
51*4882a593Smuzhiyun };
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun struct drm_vgem_fence_signal {
54*4882a593Smuzhiyun 	__u32 fence;
55*4882a593Smuzhiyun 	__u32 flags;
56*4882a593Smuzhiyun };
57*4882a593Smuzhiyun 
58*4882a593Smuzhiyun #if defined(__cplusplus)
59*4882a593Smuzhiyun }
60*4882a593Smuzhiyun #endif
61*4882a593Smuzhiyun 
62*4882a593Smuzhiyun #endif /* _UAPI_VGEM_DRM_H_ */
63