libdrm_vigs added
[platform/upstream/libdrm.git] / include / drm / vigs_drm.h
1 /*
2  * vigs_drm.h
3  */
4
5 /*
6  * Copyright (c) 2013 Samsung Electronics Co., Ltd.
7  * Authors:
8  * Stanislav Vorobiov <s.vorobiov@samsung.com>
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining a
11  * copy of this software and associated documentation files (the "Software"),
12  * to deal in the Software without restriction, including without limitation
13  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  * and/or sell copies of the Software, and to permit persons to whom the
15  * Software is furnished to do so, subject to the following conditions:
16  *
17  * The above copyright notice and this permission notice (including the next
18  * paragraph) shall be included in all copies or substantial portions of the
19  * Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
24  * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27  * OTHER DEALINGS IN THE SOFTWARE.
28  */
29
30 #ifndef _VIGS_DRM_H_
31 #define _VIGS_DRM_H_
32
33 /*
34  * Bump this whenever driver interface changes.
35  */
36 #define DRM_VIGS_DRIVER_VERSION 9
37
38 /*
39  * Surface access flags.
40  */
41 #define DRM_VIGS_SAF_READ 1
42 #define DRM_VIGS_SAF_WRITE 2
43 #define DRM_VIGS_SAF_MASK 3
44
45 struct drm_vigs_get_protocol_version
46 {
47     uint32_t version;
48 };
49
50 struct drm_vigs_create_surface
51 {
52     uint32_t width;
53     uint32_t height;
54     uint32_t stride;
55     uint32_t format;
56     uint32_t handle;
57     uint32_t size;
58     uint32_t id;
59 };
60
61 struct drm_vigs_create_execbuffer
62 {
63     uint32_t size;
64     uint32_t handle;
65 };
66
67 struct drm_vigs_gem_map
68 {
69     uint32_t handle;
70     int track_access;
71     unsigned long address;
72 };
73
74 struct drm_vigs_surface_info
75 {
76     uint32_t handle;
77     uint32_t width;
78     uint32_t height;
79     uint32_t stride;
80     uint32_t format;
81     uint32_t size;
82     uint32_t id;
83 };
84
85 struct drm_vigs_exec
86 {
87     uint32_t handle;
88 };
89
90 struct drm_vigs_surface_set_gpu_dirty
91 {
92     uint32_t handle;
93 };
94
95 struct drm_vigs_surface_start_access
96 {
97     unsigned long address;
98     uint32_t saf;
99 };
100
101 struct drm_vigs_surface_end_access
102 {
103     unsigned long address;
104     int sync;
105 };
106
107 #define DRM_VIGS_GET_PROTOCOL_VERSION 0x00
108 #define DRM_VIGS_CREATE_SURFACE 0x01
109 #define DRM_VIGS_CREATE_EXECBUFFER 0x02
110 #define DRM_VIGS_GEM_MAP 0x03
111 #define DRM_VIGS_SURFACE_INFO 0x04
112 #define DRM_VIGS_EXEC 0x05
113 #define DRM_VIGS_SURFACE_SET_GPU_DIRTY 0x06
114 #define DRM_VIGS_SURFACE_START_ACCESS 0x07
115 #define DRM_VIGS_SURFACE_END_ACCESS 0x08
116
117 #define DRM_IOCTL_VIGS_GET_PROTOCOL_VERSION DRM_IOR(DRM_COMMAND_BASE + \
118             DRM_VIGS_GET_PROTOCOL_VERSION, struct drm_vigs_get_protocol_version)
119 #define DRM_IOCTL_VIGS_CREATE_SURFACE DRM_IOWR(DRM_COMMAND_BASE + \
120             DRM_VIGS_CREATE_SURFACE, struct drm_vigs_create_surface)
121 #define DRM_IOCTL_VIGS_CREATE_EXECBUFFER DRM_IOWR(DRM_COMMAND_BASE + \
122             DRM_VIGS_CREATE_EXECBUFFER, struct drm_vigs_create_execbuffer)
123 #define DRM_IOCTL_VIGS_GEM_MAP DRM_IOWR(DRM_COMMAND_BASE + \
124             DRM_VIGS_GEM_MAP, struct drm_vigs_gem_map)
125 #define DRM_IOCTL_VIGS_SURFACE_INFO DRM_IOWR(DRM_COMMAND_BASE + \
126             DRM_VIGS_SURFACE_INFO, struct drm_vigs_surface_info)
127 #define DRM_IOCTL_VIGS_EXEC DRM_IOW(DRM_COMMAND_BASE + \
128             DRM_VIGS_EXEC, struct drm_vigs_exec)
129 #define DRM_IOCTL_VIGS_SURFACE_SET_GPU_DIRTY DRM_IOW(DRM_COMMAND_BASE + \
130             DRM_VIGS_SURFACE_SET_GPU_DIRTY, struct drm_vigs_surface_set_gpu_dirty)
131 #define DRM_IOCTL_VIGS_SURFACE_START_ACCESS DRM_IOW(DRM_COMMAND_BASE + \
132             DRM_VIGS_SURFACE_START_ACCESS, struct drm_vigs_surface_start_access)
133 #define DRM_IOCTL_VIGS_SURFACE_END_ACCESS DRM_IOW(DRM_COMMAND_BASE + \
134             DRM_VIGS_SURFACE_END_ACCESS, struct drm_vigs_surface_end_access)
135
136 #endif