aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@tungstengraphics.com>2008-12-18 23:50:50 -0500
committerDave Airlie <airlied@linux.ie>2008-12-29 02:47:25 -0500
commite0c8463a8b00b467611607df0ff369d062528875 (patch)
treeaad7aa34fc650d4ef6ae4268397d7fc2740d50e1 /include/drm
parentdf989374a9f5356ee815baa1ba6916671a701da2 (diff)
drm: sanitise drm modesetting API + remove unused hotplug
The initially merged modesetting API has some uglies in it, this cleans up the struct members and ioctl ordering for initial submission. It also removes the unneeded hotplug infrastructure. airlied:- I've pulled this patch in from git modesetting-gem tree. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_crtc.h3
-rw-r--r--include/drm/drm_mode.h205
2 files changed, 99 insertions, 109 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 08a884bea44..395c6139c89 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -573,9 +573,6 @@ struct drm_mode_config {
573 /* Optional properties */ 573 /* Optional properties */
574 struct drm_property *scaling_mode_property; 574 struct drm_property *scaling_mode_property;
575 struct drm_property *dithering_mode_property; 575 struct drm_property *dithering_mode_property;
576
577 /* hotplug */
578 uint32_t hotplug_counter;
579}; 576};
580 577
581#define obj_to_crtc(x) container_of(x, struct drm_crtc, base) 578#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
index d2e791920ab..601d2bd839f 100644
--- a/include/drm/drm_mode.h
+++ b/include/drm/drm_mode.h
@@ -33,10 +33,10 @@
33#include <linux/kernel.h> 33#include <linux/kernel.h>
34#endif 34#endif
35 35
36#define DRM_DISPLAY_INFO_LEN 32 36#define DRM_DISPLAY_INFO_LEN 32
37#define DRM_CONNECTOR_NAME_LEN 32 37#define DRM_CONNECTOR_NAME_LEN 32
38#define DRM_DISPLAY_MODE_LEN 32 38#define DRM_DISPLAY_MODE_LEN 32
39#define DRM_PROP_NAME_LEN 32 39#define DRM_PROP_NAME_LEN 32
40 40
41#define DRM_MODE_TYPE_BUILTIN (1<<0) 41#define DRM_MODE_TYPE_BUILTIN (1<<0)
42#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) 42#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN)
@@ -65,30 +65,30 @@
65 65
66/* DPMS flags */ 66/* DPMS flags */
67/* bit compatible with the xorg definitions. */ 67/* bit compatible with the xorg definitions. */
68#define DRM_MODE_DPMS_ON 0 68#define DRM_MODE_DPMS_ON 0
69#define DRM_MODE_DPMS_STANDBY 1 69#define DRM_MODE_DPMS_STANDBY 1
70#define DRM_MODE_DPMS_SUSPEND 2 70#define DRM_MODE_DPMS_SUSPEND 2
71#define DRM_MODE_DPMS_OFF 3 71#define DRM_MODE_DPMS_OFF 3
72 72
73/* Scaling mode options */ 73/* Scaling mode options */
74#define DRM_MODE_SCALE_NON_GPU 0 74#define DRM_MODE_SCALE_NON_GPU 0
75#define DRM_MODE_SCALE_FULLSCREEN 1 75#define DRM_MODE_SCALE_FULLSCREEN 1
76#define DRM_MODE_SCALE_NO_SCALE 2 76#define DRM_MODE_SCALE_NO_SCALE 2
77#define DRM_MODE_SCALE_ASPECT 3 77#define DRM_MODE_SCALE_ASPECT 3
78 78
79/* Dithering mode options */ 79/* Dithering mode options */
80#define DRM_MODE_DITHERING_OFF 0 80#define DRM_MODE_DITHERING_OFF 0
81#define DRM_MODE_DITHERING_ON 1 81#define DRM_MODE_DITHERING_ON 1
82 82
83struct drm_mode_modeinfo { 83struct drm_mode_modeinfo {
84 unsigned int clock; 84 uint32_t clock;
85 unsigned short hdisplay, hsync_start, hsync_end, htotal, hskew; 85 uint16_t hdisplay, hsync_start, hsync_end, htotal, hskew;
86 unsigned short vdisplay, vsync_start, vsync_end, vtotal, vscan; 86 uint16_t vdisplay, vsync_start, vsync_end, vtotal, vscan;
87 87
88 unsigned int vrefresh; /* vertical refresh * 1000 */ 88 uint32_t vrefresh; /* vertical refresh * 1000 */
89 89
90 unsigned int flags; 90 uint32_t flags;
91 unsigned int type; 91 uint32_t type;
92 char name[DRM_DISPLAY_MODE_LEN]; 92 char name[DRM_DISPLAY_MODE_LEN];
93}; 93};
94 94
@@ -97,39 +97,39 @@ struct drm_mode_card_res {
97 uint64_t crtc_id_ptr; 97 uint64_t crtc_id_ptr;
98 uint64_t connector_id_ptr; 98 uint64_t connector_id_ptr;
99 uint64_t encoder_id_ptr; 99 uint64_t encoder_id_ptr;
100 int count_fbs; 100 uint32_t count_fbs;
101 int count_crtcs; 101 uint32_t count_crtcs;
102 int count_connectors; 102 uint32_t count_connectors;
103 int count_encoders; 103 uint32_t count_encoders;
104 int min_width, max_width; 104 uint32_t min_width, max_width;
105 int min_height, max_height; 105 uint32_t min_height, max_height;
106}; 106};
107 107
108struct drm_mode_crtc { 108struct drm_mode_crtc {
109 uint64_t set_connectors_ptr; 109 uint64_t set_connectors_ptr;
110 int count_connectors; 110 uint32_t count_connectors;
111 111
112 unsigned int crtc_id; /**< Id */ 112 uint32_t crtc_id; /**< Id */
113 unsigned int fb_id; /**< Id of framebuffer */ 113 uint32_t fb_id; /**< Id of framebuffer */
114 114
115 int x, y; /**< Position on the frameuffer */ 115 uint32_t x, y; /**< Position on the frameuffer */
116 116
117 uint32_t gamma_size; 117 uint32_t gamma_size;
118 int mode_valid; 118 uint32_t mode_valid;
119 struct drm_mode_modeinfo mode; 119 struct drm_mode_modeinfo mode;
120}; 120};
121 121
122#define DRM_MODE_ENCODER_NONE 0 122#define DRM_MODE_ENCODER_NONE 0
123#define DRM_MODE_ENCODER_DAC 1 123#define DRM_MODE_ENCODER_DAC 1
124#define DRM_MODE_ENCODER_TMDS 2 124#define DRM_MODE_ENCODER_TMDS 2
125#define DRM_MODE_ENCODER_LVDS 3 125#define DRM_MODE_ENCODER_LVDS 3
126#define DRM_MODE_ENCODER_TVDAC 4 126#define DRM_MODE_ENCODER_TVDAC 4
127 127
128struct drm_mode_get_encoder { 128struct drm_mode_get_encoder {
129 unsigned int encoder_id; 129 uint32_t encoder_id;
130 unsigned int encoder_type; 130 uint32_t encoder_type;
131 131
132 unsigned int crtc_id; /**< Id of crtc */ 132 uint32_t crtc_id; /**< Id of crtc */
133 133
134 uint32_t possible_crtcs; 134 uint32_t possible_crtcs;
135 uint32_t possible_clones; 135 uint32_t possible_clones;
@@ -137,27 +137,27 @@ struct drm_mode_get_encoder {
137 137
138/* This is for connectors with multiple signal types. */ 138/* This is for connectors with multiple signal types. */
139/* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */ 139/* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */
140#define DRM_MODE_SUBCONNECTOR_Automatic 0 140#define DRM_MODE_SUBCONNECTOR_Automatic 0
141#define DRM_MODE_SUBCONNECTOR_Unknown 0 141#define DRM_MODE_SUBCONNECTOR_Unknown 0
142#define DRM_MODE_SUBCONNECTOR_DVID 3 142#define DRM_MODE_SUBCONNECTOR_DVID 3
143#define DRM_MODE_SUBCONNECTOR_DVIA 4 143#define DRM_MODE_SUBCONNECTOR_DVIA 4
144#define DRM_MODE_SUBCONNECTOR_Composite 5 144#define DRM_MODE_SUBCONNECTOR_Composite 5
145#define DRM_MODE_SUBCONNECTOR_SVIDEO 6 145#define DRM_MODE_SUBCONNECTOR_SVIDEO 6
146#define DRM_MODE_SUBCONNECTOR_Component 8 146#define DRM_MODE_SUBCONNECTOR_Component 8
147 147
148#define DRM_MODE_CONNECTOR_Unknown 0 148#define DRM_MODE_CONNECTOR_Unknown 0
149#define DRM_MODE_CONNECTOR_VGA 1 149#define DRM_MODE_CONNECTOR_VGA 1
150#define DRM_MODE_CONNECTOR_DVII 2 150#define DRM_MODE_CONNECTOR_DVII 2
151#define DRM_MODE_CONNECTOR_DVID 3 151#define DRM_MODE_CONNECTOR_DVID 3
152#define DRM_MODE_CONNECTOR_DVIA 4 152#define DRM_MODE_CONNECTOR_DVIA 4
153#define DRM_MODE_CONNECTOR_Composite 5 153#define DRM_MODE_CONNECTOR_Composite 5
154#define DRM_MODE_CONNECTOR_SVIDEO 6 154#define DRM_MODE_CONNECTOR_SVIDEO 6
155#define DRM_MODE_CONNECTOR_LVDS 7 155#define DRM_MODE_CONNECTOR_LVDS 7
156#define DRM_MODE_CONNECTOR_Component 8 156#define DRM_MODE_CONNECTOR_Component 8
157#define DRM_MODE_CONNECTOR_9PinDIN 9 157#define DRM_MODE_CONNECTOR_9PinDIN 9
158#define DRM_MODE_CONNECTOR_DisplayPort 10 158#define DRM_MODE_CONNECTOR_DisplayPort 10
159#define DRM_MODE_CONNECTOR_HDMIA 11 159#define DRM_MODE_CONNECTOR_HDMIA 11
160#define DRM_MODE_CONNECTOR_HDMIB 12 160#define DRM_MODE_CONNECTOR_HDMIB 12
161 161
162struct drm_mode_get_connector { 162struct drm_mode_get_connector {
163 163
@@ -166,47 +166,47 @@ struct drm_mode_get_connector {
166 uint64_t props_ptr; 166 uint64_t props_ptr;
167 uint64_t prop_values_ptr; 167 uint64_t prop_values_ptr;
168 168
169 int count_modes; 169 uint32_t count_modes;
170 int count_props; 170 uint32_t count_props;
171 int count_encoders; 171 uint32_t count_encoders;
172 172
173 unsigned int encoder_id; /**< Current Encoder */ 173 uint32_t encoder_id; /**< Current Encoder */
174 unsigned int connector_id; /**< Id */ 174 uint32_t connector_id; /**< Id */
175 unsigned int connector_type; 175 uint32_t connector_type;
176 unsigned int connector_type_id; 176 uint32_t connector_type_id;
177 177
178 unsigned int connection; 178 uint32_t connection;
179 unsigned int mm_width, mm_height; /**< HxW in millimeters */ 179 uint32_t mm_width, mm_height; /**< HxW in millimeters */
180 unsigned int subpixel; 180 uint32_t subpixel;
181}; 181};
182 182
183#define DRM_MODE_PROP_PENDING (1<<0) 183#define DRM_MODE_PROP_PENDING (1<<0)
184#define DRM_MODE_PROP_RANGE (1<<1) 184#define DRM_MODE_PROP_RANGE (1<<1)
185#define DRM_MODE_PROP_IMMUTABLE (1<<2) 185#define DRM_MODE_PROP_IMMUTABLE (1<<2)
186#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ 186#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */
187#define DRM_MODE_PROP_BLOB (1<<4) 187#define DRM_MODE_PROP_BLOB (1<<4)
188 188
189struct drm_mode_property_enum { 189struct drm_mode_property_enum {
190 uint64_t value; 190 uint64_t value;
191 unsigned char name[DRM_PROP_NAME_LEN]; 191 char name[DRM_PROP_NAME_LEN];
192}; 192};
193 193
194struct drm_mode_get_property { 194struct drm_mode_get_property {
195 uint64_t values_ptr; /* values and blob lengths */ 195 uint64_t values_ptr; /* values and blob lengths */
196 uint64_t enum_blob_ptr; /* enum and blob id ptrs */ 196 uint64_t enum_blob_ptr; /* enum and blob id ptrs */
197 197
198 unsigned int prop_id; 198 uint32_t prop_id;
199 unsigned int flags; 199 uint32_t flags;
200 unsigned char name[DRM_PROP_NAME_LEN]; 200 char name[DRM_PROP_NAME_LEN];
201 201
202 int count_values; 202 uint32_t count_values;
203 int count_enum_blobs; 203 uint32_t count_enum_blobs;
204}; 204};
205 205
206struct drm_mode_connector_set_property { 206struct drm_mode_connector_set_property {
207 uint64_t value; 207 uint64_t value;
208 unsigned int prop_id; 208 uint32_t prop_id;
209 unsigned int connector_id; 209 uint32_t connector_id;
210}; 210};
211 211
212struct drm_mode_get_blob { 212struct drm_mode_get_blob {
@@ -216,22 +216,22 @@ struct drm_mode_get_blob {
216}; 216};
217 217
218struct drm_mode_fb_cmd { 218struct drm_mode_fb_cmd {
219 unsigned int buffer_id; 219 uint32_t fb_id;
220 unsigned int width, height; 220 uint32_t width, height;
221 unsigned int pitch; 221 uint32_t pitch;
222 unsigned int bpp; 222 uint32_t bpp;
223 unsigned int depth; 223 uint32_t depth;
224 224 /* driver specific handle */
225 unsigned int handle; 225 uint32_t handle;
226}; 226};
227 227
228struct drm_mode_mode_cmd { 228struct drm_mode_mode_cmd {
229 unsigned int connector_id; 229 uint32_t connector_id;
230 struct drm_mode_modeinfo mode; 230 struct drm_mode_modeinfo mode;
231}; 231};
232 232
233#define DRM_MODE_CURSOR_BO 0x01 233#define DRM_MODE_CURSOR_BO (1<<0)
234#define DRM_MODE_CURSOR_MOVE 0x02 234#define DRM_MODE_CURSOR_MOVE (1<<1)
235 235
236/* 236/*
237 * depending on the value in flags diffrent members are used. 237 * depending on the value in flags diffrent members are used.
@@ -248,24 +248,17 @@ struct drm_mode_mode_cmd {
248 * y 248 * y
249 */ 249 */
250struct drm_mode_cursor { 250struct drm_mode_cursor {
251 unsigned int flags; 251 uint32_t flags;
252 unsigned int crtc; 252 uint32_t crtc_id;
253 int x; 253 int32_t x;
254 int y; 254 int32_t y;
255 uint32_t width; 255 uint32_t width;
256 uint32_t height; 256 uint32_t height;
257 unsigned int handle; 257 /* driver specific handle */
258}; 258 uint32_t handle;
259
260/*
261 * oh so ugly hotplug
262 */
263struct drm_mode_hotplug {
264 uint32_t counter;
265}; 259};
266 260
267struct drm_mode_crtc_lut { 261struct drm_mode_crtc_lut {
268
269 uint32_t crtc_id; 262 uint32_t crtc_id;
270 uint32_t gamma_size; 263 uint32_t gamma_size;
271 264