aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/gpu/drm/drm_crtc.c21
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c2
-rw-r--r--drivers/gpu/drm/drm_drv.c20
-rw-r--r--include/drm/drm_crtc.h3
-rw-r--r--include/drm/drm_mode.h205
5 files changed, 113 insertions, 138 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 2e880240477e..ece947d3b25b 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -804,7 +804,6 @@ void drm_mode_config_init(struct drm_device *dev)
804 dev->mode_config.num_connector = 0; 804 dev->mode_config.num_connector = 0;
805 dev->mode_config.num_crtc = 0; 805 dev->mode_config.num_crtc = 0;
806 dev->mode_config.num_encoder = 0; 806 dev->mode_config.num_encoder = 0;
807 dev->mode_config.hotplug_counter = 0;
808} 807}
809EXPORT_SYMBOL(drm_mode_config_init); 808EXPORT_SYMBOL(drm_mode_config_init);
810 809
@@ -900,16 +899,6 @@ void drm_mode_config_cleanup(struct drm_device *dev)
900} 899}
901EXPORT_SYMBOL(drm_mode_config_cleanup); 900EXPORT_SYMBOL(drm_mode_config_cleanup);
902 901
903int drm_mode_hotplug_ioctl(struct drm_device *dev,
904 void *data, struct drm_file *file_priv)
905{
906 struct drm_mode_hotplug *arg = data;
907
908 arg->counter = dev->mode_config.hotplug_counter;
909
910 return 0;
911}
912
913/** 902/**
914 * drm_crtc_convert_to_umode - convert a drm_display_mode into a modeinfo 903 * drm_crtc_convert_to_umode - convert a drm_display_mode into a modeinfo
915 * @out: drm_mode_modeinfo struct to return to the user 904 * @out: drm_mode_modeinfo struct to return to the user
@@ -1543,9 +1532,9 @@ int drm_mode_cursor_ioctl(struct drm_device *dev,
1543 } 1532 }
1544 1533
1545 mutex_lock(&dev->mode_config.mutex); 1534 mutex_lock(&dev->mode_config.mutex);
1546 obj = drm_mode_object_find(dev, req->crtc, DRM_MODE_OBJECT_CRTC); 1535 obj = drm_mode_object_find(dev, req->crtc_id, DRM_MODE_OBJECT_CRTC);
1547 if (!obj) { 1536 if (!obj) {
1548 DRM_DEBUG("Unknown CRTC ID %d\n", req->crtc); 1537 DRM_DEBUG("Unknown CRTC ID %d\n", req->crtc_id);
1549 ret = -EINVAL; 1538 ret = -EINVAL;
1550 goto out; 1539 goto out;
1551 } 1540 }
@@ -1622,7 +1611,7 @@ int drm_mode_addfb(struct drm_device *dev,
1622 goto out; 1611 goto out;
1623 } 1612 }
1624 1613
1625 r->buffer_id = fb->base.id; 1614 r->fb_id = fb->base.id;
1626 list_add(&fb->filp_head, &file_priv->fbs); 1615 list_add(&fb->filp_head, &file_priv->fbs);
1627 1616
1628out: 1617out:
@@ -1714,7 +1703,7 @@ int drm_mode_getfb(struct drm_device *dev,
1714 int ret = 0; 1703 int ret = 0;
1715 1704
1716 mutex_lock(&dev->mode_config.mutex); 1705 mutex_lock(&dev->mode_config.mutex);
1717 obj = drm_mode_object_find(dev, r->buffer_id, DRM_MODE_OBJECT_FB); 1706 obj = drm_mode_object_find(dev, r->fb_id, DRM_MODE_OBJECT_FB);
1718 if (!obj) { 1707 if (!obj) {
1719 DRM_ERROR("invalid framebuffer id\n"); 1708 DRM_ERROR("invalid framebuffer id\n");
1720 ret = -EINVAL; 1709 ret = -EINVAL;
@@ -2326,7 +2315,7 @@ int drm_mode_replacefb(struct drm_device *dev,
2326 2315
2327 /* right replace the current bo attached to this fb with a new bo */ 2316 /* right replace the current bo attached to this fb with a new bo */
2328 mutex_lock(&dev->mode_config.mutex); 2317 mutex_lock(&dev->mode_config.mutex);
2329 obj = drm_mode_object_find(dev, r->buffer_id, DRM_MODE_OBJECT_FB); 2318 obj = drm_mode_object_find(dev, r->fb_id, DRM_MODE_OBJECT_FB);
2330 if (!obj) { 2319 if (!obj) {
2331 ret = -EINVAL; 2320 ret = -EINVAL;
2332 goto out; 2321 goto out;
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index f914044ad971..58e335967617 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -780,8 +780,6 @@ EXPORT_SYMBOL(drm_helper_initial_config);
780 */ 780 */
781int drm_helper_hotplug_stage_two(struct drm_device *dev) 781int drm_helper_hotplug_stage_two(struct drm_device *dev)
782{ 782{
783 dev->mode_config.hotplug_counter++;
784
785 drm_helper_plugged_event(dev); 783 drm_helper_plugged_event(dev);
786 784
787 return 0; 785 return 0;
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index c6e338282588..7eb0e09fc73b 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -129,23 +129,21 @@ static struct drm_ioctl_desc drm_ioctls[] = {
129 129
130 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETRESOURCES, drm_mode_getresources, DRM_MASTER|DRM_CONTROL_ALLOW), 130 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETRESOURCES, drm_mode_getresources, DRM_MASTER|DRM_CONTROL_ALLOW),
131 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETCRTC, drm_mode_getcrtc, DRM_MASTER|DRM_CONTROL_ALLOW), 131 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETCRTC, drm_mode_getcrtc, DRM_MASTER|DRM_CONTROL_ALLOW),
132 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETCONNECTOR, drm_mode_getconnector, DRM_MASTER|DRM_CONTROL_ALLOW),
133 DRM_IOCTL_DEF(DRM_IOCTL_MODE_SETCRTC, drm_mode_setcrtc, DRM_MASTER|DRM_CONTROL_ALLOW), 132 DRM_IOCTL_DEF(DRM_IOCTL_MODE_SETCRTC, drm_mode_setcrtc, DRM_MASTER|DRM_CONTROL_ALLOW),
134 DRM_IOCTL_DEF(DRM_IOCTL_MODE_CURSOR, drm_mode_cursor_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW), 133 DRM_IOCTL_DEF(DRM_IOCTL_MODE_CURSOR, drm_mode_cursor_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW),
135 DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB, drm_mode_addfb, DRM_MASTER|DRM_CONTROL_ALLOW), 134 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETGAMMA, drm_mode_gamma_get_ioctl, DRM_MASTER),
136 DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb, DRM_MASTER|DRM_CONTROL_ALLOW), 135 DRM_IOCTL_DEF(DRM_IOCTL_MODE_SETGAMMA, drm_mode_gamma_set_ioctl, DRM_MASTER),
137 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETFB, drm_mode_getfb, DRM_MASTER|DRM_CONTROL_ALLOW), 136 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETENCODER, drm_mode_getencoder, DRM_MASTER|DRM_CONTROL_ALLOW),
138 137 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETCONNECTOR, drm_mode_getconnector, DRM_MASTER|DRM_CONTROL_ALLOW),
139 DRM_IOCTL_DEF(DRM_IOCTL_MODE_SETPROPERTY, drm_mode_connector_property_set_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW),
140 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETPROPBLOB, drm_mode_getblob_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW),
141 DRM_IOCTL_DEF(DRM_IOCTL_MODE_ATTACHMODE, drm_mode_attachmode_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW), 138 DRM_IOCTL_DEF(DRM_IOCTL_MODE_ATTACHMODE, drm_mode_attachmode_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW),
142 DRM_IOCTL_DEF(DRM_IOCTL_MODE_DETACHMODE, drm_mode_detachmode_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW), 139 DRM_IOCTL_DEF(DRM_IOCTL_MODE_DETACHMODE, drm_mode_detachmode_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW),
143 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETPROPERTY, drm_mode_getproperty_ioctl, DRM_MASTER | DRM_CONTROL_ALLOW), 140 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETPROPERTY, drm_mode_getproperty_ioctl, DRM_MASTER | DRM_CONTROL_ALLOW),
144 141 DRM_IOCTL_DEF(DRM_IOCTL_MODE_SETPROPERTY, drm_mode_connector_property_set_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW),
142 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETPROPBLOB, drm_mode_getblob_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW),
143 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETFB, drm_mode_getfb, DRM_MASTER|DRM_CONTROL_ALLOW),
144 DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB, drm_mode_addfb, DRM_MASTER|DRM_CONTROL_ALLOW),
145 DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb, DRM_MASTER|DRM_CONTROL_ALLOW),
145 DRM_IOCTL_DEF(DRM_IOCTL_MODE_REPLACEFB, drm_mode_replacefb, DRM_MASTER|DRM_ROOT_ONLY|DRM_CONTROL_ALLOW), 146 DRM_IOCTL_DEF(DRM_IOCTL_MODE_REPLACEFB, drm_mode_replacefb, DRM_MASTER|DRM_ROOT_ONLY|DRM_CONTROL_ALLOW),
146 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETENCODER, drm_mode_getencoder, DRM_MASTER|DRM_CONTROL_ALLOW),
147 DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETGAMMA, drm_mode_gamma_get_ioctl, DRM_MASTER),
148 DRM_IOCTL_DEF(DRM_IOCTL_MODE_SETGAMMA, drm_mode_gamma_set_ioctl, DRM_MASTER),
149}; 147};
150 148
151#define DRM_CORE_IOCTL_COUNT ARRAY_SIZE( drm_ioctls ) 149#define DRM_CORE_IOCTL_COUNT ARRAY_SIZE( drm_ioctls )
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 08a884bea446..395c6139c893 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 d2e791920aba..601d2bd839f6 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