aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-12-10 22:46:05 -0500
committerDave Airlie <airlied@redhat.com>2015-12-10 22:46:05 -0500
commit663a233eef643b38f36c05535cb5c9a4972edcc1 (patch)
treef919f05cefc2d4d3ef087c1ed226fbdf867e33b8
parente876b41ab074561d65f213bf5e0fc68cf5bc7380 (diff)
parentd7e12cd7b8c6d7426a401ec03ddcb88382180ced (diff)
Merge branch 'drm-header-fixes' of https://github.com/GabrielL/linux into drm-next
Fix all the problems with the header files and userspace builds off them. I really care so little about this, but hey who am I to stop progress. * 'drm-header-fixes' of https://github.com/GabrielL/linux: (30 commits) drm: fix inclusion of drm.h in via_drm.h drm: fix inclusion of drm.h in vmwgfx_drm.h drm: fix inclusion of drm.h in virtgpu_drm.h drm: fix inclusion of drm.h in tegra_drm.h drm: fix inclusion of drm.h in savage_drm.h drm: fix inclusion of drm.h in r128_drm.h drm: fix inclusion of drm.h in qxl_drm.h drm: fix inclusion of drm.h in omap_drm.h drm: fix inclusion of drm.h in msm_drm.h drm: fix inclusion of drm.h in mga_drm.h drm: fix inclusion of drm.h in exynos_sarea.h drm: fix inclusion of drm.h in i810_drm.h drm: fix inclusion of drm.h in exynos_sarea.h drm: fix inclusion of drm.h in drm_sarea.h drm: drm_mode.h fix includes drm: drm_fourcc.h fix includes drm: include drm.h in armada_drm.h include/uapi/drm/amdgpu_drm.h: use __u32 and __u64 from <linux/types.h> drm: Kbuild: add admgpu_drm.h to the installed headers drm: use __u{32,64} instead of uint{32,64}_t in virtgpu_drm.h ...
-rw-r--r--include/uapi/drm/Kbuild1
-rw-r--r--include/uapi/drm/amdgpu_drm.h290
-rw-r--r--include/uapi/drm/armada_drm.h2
-rw-r--r--include/uapi/drm/drm.h9
-rw-r--r--include/uapi/drm/drm_fourcc.h2
-rw-r--r--include/uapi/drm/drm_mode.h18
-rw-r--r--include/uapi/drm/drm_sarea.h2
-rw-r--r--include/uapi/drm/exynos_drm.h8
-rw-r--r--include/uapi/drm/i810_drm.h2
-rw-r--r--include/uapi/drm/i915_drm.h2
-rw-r--r--include/uapi/drm/mga_drm.h2
-rw-r--r--include/uapi/drm/msm_drm.h3
-rw-r--r--include/uapi/drm/nouveau_drm.h86
-rw-r--r--include/uapi/drm/omap_drm.h2
-rw-r--r--include/uapi/drm/qxl_drm.h77
-rw-r--r--include/uapi/drm/r128_drm.h2
-rw-r--r--include/uapi/drm/radeon_drm.h128
-rw-r--r--include/uapi/drm/savage_drm.h2
-rw-r--r--include/uapi/drm/tegra_drm.h2
-rw-r--r--include/uapi/drm/via_drm.h5
-rw-r--r--include/uapi/drm/virtgpu_drm.h101
-rw-r--r--include/uapi/drm/vmwgfx_drm.h268
-rw-r--r--include/uapi/linux/agpgart.h1
-rw-r--r--include/uapi/linux/virtio_gpu.h2
24 files changed, 508 insertions, 509 deletions
diff --git a/include/uapi/drm/Kbuild b/include/uapi/drm/Kbuild
index 38d437096c35..159551f49313 100644
--- a/include/uapi/drm/Kbuild
+++ b/include/uapi/drm/Kbuild
@@ -3,6 +3,7 @@ header-y += drm.h
3header-y += drm_fourcc.h 3header-y += drm_fourcc.h
4header-y += drm_mode.h 4header-y += drm_mode.h
5header-y += drm_sarea.h 5header-y += drm_sarea.h
6header-y += amdgpu_drm.h
6header-y += exynos_drm.h 7header-y += exynos_drm.h
7header-y += i810_drm.h 8header-y += i810_drm.h
8header-y += i915_drm.h 9header-y += i915_drm.h
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index e52933a73580..453a76af123c 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -76,19 +76,19 @@
76 76
77struct drm_amdgpu_gem_create_in { 77struct drm_amdgpu_gem_create_in {
78 /** the requested memory size */ 78 /** the requested memory size */
79 uint64_t bo_size; 79 __u64 bo_size;
80 /** physical start_addr alignment in bytes for some HW requirements */ 80 /** physical start_addr alignment in bytes for some HW requirements */
81 uint64_t alignment; 81 __u64 alignment;
82 /** the requested memory domains */ 82 /** the requested memory domains */
83 uint64_t domains; 83 __u64 domains;
84 /** allocation flags */ 84 /** allocation flags */
85 uint64_t domain_flags; 85 __u64 domain_flags;
86}; 86};
87 87
88struct drm_amdgpu_gem_create_out { 88struct drm_amdgpu_gem_create_out {
89 /** returned GEM object handle */ 89 /** returned GEM object handle */
90 uint32_t handle; 90 __u32 handle;
91 uint32_t _pad; 91 __u32 _pad;
92}; 92};
93 93
94union drm_amdgpu_gem_create { 94union drm_amdgpu_gem_create {
@@ -105,28 +105,28 @@ union drm_amdgpu_gem_create {
105 105
106struct drm_amdgpu_bo_list_in { 106struct drm_amdgpu_bo_list_in {
107 /** Type of operation */ 107 /** Type of operation */
108 uint32_t operation; 108 __u32 operation;
109 /** Handle of list or 0 if we want to create one */ 109 /** Handle of list or 0 if we want to create one */
110 uint32_t list_handle; 110 __u32 list_handle;
111 /** Number of BOs in list */ 111 /** Number of BOs in list */
112 uint32_t bo_number; 112 __u32 bo_number;
113 /** Size of each element describing BO */ 113 /** Size of each element describing BO */
114 uint32_t bo_info_size; 114 __u32 bo_info_size;
115 /** Pointer to array describing BOs */ 115 /** Pointer to array describing BOs */
116 uint64_t bo_info_ptr; 116 __u64 bo_info_ptr;
117}; 117};
118 118
119struct drm_amdgpu_bo_list_entry { 119struct drm_amdgpu_bo_list_entry {
120 /** Handle of BO */ 120 /** Handle of BO */
121 uint32_t bo_handle; 121 __u32 bo_handle;
122 /** New (if specified) BO priority to be used during migration */ 122 /** New (if specified) BO priority to be used during migration */
123 uint32_t bo_priority; 123 __u32 bo_priority;
124}; 124};
125 125
126struct drm_amdgpu_bo_list_out { 126struct drm_amdgpu_bo_list_out {
127 /** Handle of resource list */ 127 /** Handle of resource list */
128 uint32_t list_handle; 128 __u32 list_handle;
129 uint32_t _pad; 129 __u32 _pad;
130}; 130};
131 131
132union drm_amdgpu_bo_list { 132union drm_amdgpu_bo_list {
@@ -150,26 +150,26 @@ union drm_amdgpu_bo_list {
150 150
151struct drm_amdgpu_ctx_in { 151struct drm_amdgpu_ctx_in {
152 /** AMDGPU_CTX_OP_* */ 152 /** AMDGPU_CTX_OP_* */
153 uint32_t op; 153 __u32 op;
154 /** For future use, no flags defined so far */ 154 /** For future use, no flags defined so far */
155 uint32_t flags; 155 __u32 flags;
156 uint32_t ctx_id; 156 __u32 ctx_id;
157 uint32_t _pad; 157 __u32 _pad;
158}; 158};
159 159
160union drm_amdgpu_ctx_out { 160union drm_amdgpu_ctx_out {
161 struct { 161 struct {
162 uint32_t ctx_id; 162 __u32 ctx_id;
163 uint32_t _pad; 163 __u32 _pad;
164 } alloc; 164 } alloc;
165 165
166 struct { 166 struct {
167 /** For future use, no flags defined so far */ 167 /** For future use, no flags defined so far */
168 uint64_t flags; 168 __u64 flags;
169 /** Number of resets caused by this context so far. */ 169 /** Number of resets caused by this context so far. */
170 uint32_t hangs; 170 __u32 hangs;
171 /** Reset status since the last call of the ioctl. */ 171 /** Reset status since the last call of the ioctl. */
172 uint32_t reset_status; 172 __u32 reset_status;
173 } state; 173 } state;
174}; 174};
175 175
@@ -189,12 +189,12 @@ union drm_amdgpu_ctx {
189#define AMDGPU_GEM_USERPTR_REGISTER (1 << 3) 189#define AMDGPU_GEM_USERPTR_REGISTER (1 << 3)
190 190
191struct drm_amdgpu_gem_userptr { 191struct drm_amdgpu_gem_userptr {
192 uint64_t addr; 192 __u64 addr;
193 uint64_t size; 193 __u64 size;
194 /* AMDGPU_GEM_USERPTR_* */ 194 /* AMDGPU_GEM_USERPTR_* */
195 uint32_t flags; 195 __u32 flags;
196 /* Resulting GEM handle */ 196 /* Resulting GEM handle */
197 uint32_t handle; 197 __u32 handle;
198}; 198};
199 199
200/* same meaning as the GB_TILE_MODE and GL_MACRO_TILE_MODE fields */ 200/* same meaning as the GB_TILE_MODE and GL_MACRO_TILE_MODE fields */
@@ -226,28 +226,28 @@ struct drm_amdgpu_gem_userptr {
226/** The same structure is shared for input/output */ 226/** The same structure is shared for input/output */
227struct drm_amdgpu_gem_metadata { 227struct drm_amdgpu_gem_metadata {
228 /** GEM Object handle */ 228 /** GEM Object handle */
229 uint32_t handle; 229 __u32 handle;
230 /** Do we want get or set metadata */ 230 /** Do we want get or set metadata */
231 uint32_t op; 231 __u32 op;
232 struct { 232 struct {
233 /** For future use, no flags defined so far */ 233 /** For future use, no flags defined so far */
234 uint64_t flags; 234 __u64 flags;
235 /** family specific tiling info */ 235 /** family specific tiling info */
236 uint64_t tiling_info; 236 __u64 tiling_info;
237 uint32_t data_size_bytes; 237 __u32 data_size_bytes;
238 uint32_t data[64]; 238 __u32 data[64];
239 } data; 239 } data;
240}; 240};
241 241
242struct drm_amdgpu_gem_mmap_in { 242struct drm_amdgpu_gem_mmap_in {
243 /** the GEM object handle */ 243 /** the GEM object handle */
244 uint32_t handle; 244 __u32 handle;
245 uint32_t _pad; 245 __u32 _pad;
246}; 246};
247 247
248struct drm_amdgpu_gem_mmap_out { 248struct drm_amdgpu_gem_mmap_out {
249 /** mmap offset from the vma offset manager */ 249 /** mmap offset from the vma offset manager */
250 uint64_t addr_ptr; 250 __u64 addr_ptr;
251}; 251};
252 252
253union drm_amdgpu_gem_mmap { 253union drm_amdgpu_gem_mmap {
@@ -257,18 +257,18 @@ union drm_amdgpu_gem_mmap {
257 257
258struct drm_amdgpu_gem_wait_idle_in { 258struct drm_amdgpu_gem_wait_idle_in {
259 /** GEM object handle */ 259 /** GEM object handle */
260 uint32_t handle; 260 __u32 handle;
261 /** For future use, no flags defined so far */ 261 /** For future use, no flags defined so far */
262 uint32_t flags; 262 __u32 flags;
263 /** Absolute timeout to wait */ 263 /** Absolute timeout to wait */
264 uint64_t timeout; 264 __u64 timeout;
265}; 265};
266 266
267struct drm_amdgpu_gem_wait_idle_out { 267struct drm_amdgpu_gem_wait_idle_out {
268 /** BO status: 0 - BO is idle, 1 - BO is busy */ 268 /** BO status: 0 - BO is idle, 1 - BO is busy */
269 uint32_t status; 269 __u32 status;
270 /** Returned current memory domain */ 270 /** Returned current memory domain */
271 uint32_t domain; 271 __u32 domain;
272}; 272};
273 273
274union drm_amdgpu_gem_wait_idle { 274union drm_amdgpu_gem_wait_idle {
@@ -278,18 +278,18 @@ union drm_amdgpu_gem_wait_idle {
278 278
279struct drm_amdgpu_wait_cs_in { 279struct drm_amdgpu_wait_cs_in {
280 /** Command submission handle */ 280 /** Command submission handle */
281 uint64_t handle; 281 __u64 handle;
282 /** Absolute timeout to wait */ 282 /** Absolute timeout to wait */
283 uint64_t timeout; 283 __u64 timeout;
284 uint32_t ip_type; 284 __u32 ip_type;
285 uint32_t ip_instance; 285 __u32 ip_instance;
286 uint32_t ring; 286 __u32 ring;
287 uint32_t ctx_id; 287 __u32 ctx_id;
288}; 288};
289 289
290struct drm_amdgpu_wait_cs_out { 290struct drm_amdgpu_wait_cs_out {
291 /** CS status: 0 - CS completed, 1 - CS still busy */ 291 /** CS status: 0 - CS completed, 1 - CS still busy */
292 uint64_t status; 292 __u64 status;
293}; 293};
294 294
295union drm_amdgpu_wait_cs { 295union drm_amdgpu_wait_cs {
@@ -303,11 +303,11 @@ union drm_amdgpu_wait_cs {
303/* Sets or returns a value associated with a buffer. */ 303/* Sets or returns a value associated with a buffer. */
304struct drm_amdgpu_gem_op { 304struct drm_amdgpu_gem_op {
305 /** GEM object handle */ 305 /** GEM object handle */
306 uint32_t handle; 306 __u32 handle;
307 /** AMDGPU_GEM_OP_* */ 307 /** AMDGPU_GEM_OP_* */
308 uint32_t op; 308 __u32 op;
309 /** Input or return value */ 309 /** Input or return value */
310 uint64_t value; 310 __u64 value;
311}; 311};
312 312
313#define AMDGPU_VA_OP_MAP 1 313#define AMDGPU_VA_OP_MAP 1
@@ -326,18 +326,18 @@ struct drm_amdgpu_gem_op {
326 326
327struct drm_amdgpu_gem_va { 327struct drm_amdgpu_gem_va {
328 /** GEM object handle */ 328 /** GEM object handle */
329 uint32_t handle; 329 __u32 handle;
330 uint32_t _pad; 330 __u32 _pad;
331 /** AMDGPU_VA_OP_* */ 331 /** AMDGPU_VA_OP_* */
332 uint32_t operation; 332 __u32 operation;
333 /** AMDGPU_VM_PAGE_* */ 333 /** AMDGPU_VM_PAGE_* */
334 uint32_t flags; 334 __u32 flags;
335 /** va address to assign . Must be correctly aligned.*/ 335 /** va address to assign . Must be correctly aligned.*/
336 uint64_t va_address; 336 __u64 va_address;
337 /** Specify offset inside of BO to assign. Must be correctly aligned.*/ 337 /** Specify offset inside of BO to assign. Must be correctly aligned.*/
338 uint64_t offset_in_bo; 338 __u64 offset_in_bo;
339 /** Specify mapping size. Must be correctly aligned. */ 339 /** Specify mapping size. Must be correctly aligned. */
340 uint64_t map_size; 340 __u64 map_size;
341}; 341};
342 342
343#define AMDGPU_HW_IP_GFX 0 343#define AMDGPU_HW_IP_GFX 0
@@ -354,24 +354,24 @@ struct drm_amdgpu_gem_va {
354#define AMDGPU_CHUNK_ID_DEPENDENCIES 0x03 354#define AMDGPU_CHUNK_ID_DEPENDENCIES 0x03
355 355
356struct drm_amdgpu_cs_chunk { 356struct drm_amdgpu_cs_chunk {
357 uint32_t chunk_id; 357 __u32 chunk_id;
358 uint32_t length_dw; 358 __u32 length_dw;
359 uint64_t chunk_data; 359 __u64 chunk_data;
360}; 360};
361 361
362struct drm_amdgpu_cs_in { 362struct drm_amdgpu_cs_in {
363 /** Rendering context id */ 363 /** Rendering context id */
364 uint32_t ctx_id; 364 __u32 ctx_id;
365 /** Handle of resource list associated with CS */ 365 /** Handle of resource list associated with CS */
366 uint32_t bo_list_handle; 366 __u32 bo_list_handle;
367 uint32_t num_chunks; 367 __u32 num_chunks;
368 uint32_t _pad; 368 __u32 _pad;
369 /** this points to uint64_t * which point to cs chunks */ 369 /** this points to __u64 * which point to cs chunks */
370 uint64_t chunks; 370 __u64 chunks;
371}; 371};
372 372
373struct drm_amdgpu_cs_out { 373struct drm_amdgpu_cs_out {
374 uint64_t handle; 374 __u64 handle;
375}; 375};
376 376
377union drm_amdgpu_cs { 377union drm_amdgpu_cs {
@@ -388,32 +388,32 @@ union drm_amdgpu_cs {
388#define AMDGPU_IB_FLAG_PREAMBLE (1<<1) 388#define AMDGPU_IB_FLAG_PREAMBLE (1<<1)
389 389
390struct drm_amdgpu_cs_chunk_ib { 390struct drm_amdgpu_cs_chunk_ib {
391 uint32_t _pad; 391 __u32 _pad;
392 /** AMDGPU_IB_FLAG_* */ 392 /** AMDGPU_IB_FLAG_* */
393 uint32_t flags; 393 __u32 flags;
394 /** Virtual address to begin IB execution */ 394 /** Virtual address to begin IB execution */
395 uint64_t va_start; 395 __u64 va_start;
396 /** Size of submission */ 396 /** Size of submission */
397 uint32_t ib_bytes; 397 __u32 ib_bytes;
398 /** HW IP to submit to */ 398 /** HW IP to submit to */
399 uint32_t ip_type; 399 __u32 ip_type;
400 /** HW IP index of the same type to submit to */ 400 /** HW IP index of the same type to submit to */
401 uint32_t ip_instance; 401 __u32 ip_instance;
402 /** Ring index to submit to */ 402 /** Ring index to submit to */
403 uint32_t ring; 403 __u32 ring;
404}; 404};
405 405
406struct drm_amdgpu_cs_chunk_dep { 406struct drm_amdgpu_cs_chunk_dep {
407 uint32_t ip_type; 407 __u32 ip_type;
408 uint32_t ip_instance; 408 __u32 ip_instance;
409 uint32_t ring; 409 __u32 ring;
410 uint32_t ctx_id; 410 __u32 ctx_id;
411 uint64_t handle; 411 __u64 handle;
412}; 412};
413 413
414struct drm_amdgpu_cs_chunk_fence { 414struct drm_amdgpu_cs_chunk_fence {
415 uint32_t handle; 415 __u32 handle;
416 uint32_t offset; 416 __u32 offset;
417}; 417};
418 418
419struct drm_amdgpu_cs_chunk_data { 419struct drm_amdgpu_cs_chunk_data {
@@ -486,83 +486,83 @@ struct drm_amdgpu_cs_chunk_data {
486/* Input structure for the INFO ioctl */ 486/* Input structure for the INFO ioctl */
487struct drm_amdgpu_info { 487struct drm_amdgpu_info {
488 /* Where the return value will be stored */ 488 /* Where the return value will be stored */
489 uint64_t return_pointer; 489 __u64 return_pointer;
490 /* The size of the return value. Just like "size" in "snprintf", 490 /* The size of the return value. Just like "size" in "snprintf",
491 * it limits how many bytes the kernel can write. */ 491 * it limits how many bytes the kernel can write. */
492 uint32_t return_size; 492 __u32 return_size;
493 /* The query request id. */ 493 /* The query request id. */
494 uint32_t query; 494 __u32 query;
495 495
496 union { 496 union {
497 struct { 497 struct {
498 uint32_t id; 498 __u32 id;
499 uint32_t _pad; 499 __u32 _pad;
500 } mode_crtc; 500 } mode_crtc;
501 501
502 struct { 502 struct {
503 /** AMDGPU_HW_IP_* */ 503 /** AMDGPU_HW_IP_* */
504 uint32_t type; 504 __u32 type;
505 /** 505 /**
506 * Index of the IP if there are more IPs of the same 506 * Index of the IP if there are more IPs of the same
507 * type. Ignored by AMDGPU_INFO_HW_IP_COUNT. 507 * type. Ignored by AMDGPU_INFO_HW_IP_COUNT.
508 */ 508 */
509 uint32_t ip_instance; 509 __u32 ip_instance;
510 } query_hw_ip; 510 } query_hw_ip;
511 511
512 struct { 512 struct {
513 uint32_t dword_offset; 513 __u32 dword_offset;
514 /** number of registers to read */ 514 /** number of registers to read */
515 uint32_t count; 515 __u32 count;
516 uint32_t instance; 516 __u32 instance;
517 /** For future use, no flags defined so far */ 517 /** For future use, no flags defined so far */
518 uint32_t flags; 518 __u32 flags;
519 } read_mmr_reg; 519 } read_mmr_reg;
520 520
521 struct { 521 struct {
522 /** AMDGPU_INFO_FW_* */ 522 /** AMDGPU_INFO_FW_* */
523 uint32_t fw_type; 523 __u32 fw_type;
524 /** 524 /**
525 * Index of the IP if there are more IPs of 525 * Index of the IP if there are more IPs of
526 * the same type. 526 * the same type.
527 */ 527 */
528 uint32_t ip_instance; 528 __u32 ip_instance;
529 /** 529 /**
530 * Index of the engine. Whether this is used depends 530 * Index of the engine. Whether this is used depends
531 * on the firmware type. (e.g. MEC, SDMA) 531 * on the firmware type. (e.g. MEC, SDMA)
532 */ 532 */
533 uint32_t index; 533 __u32 index;
534 uint32_t _pad; 534 __u32 _pad;
535 } query_fw; 535 } query_fw;
536 }; 536 };
537}; 537};
538 538
539struct drm_amdgpu_info_gds { 539struct drm_amdgpu_info_gds {
540 /** GDS GFX partition size */ 540 /** GDS GFX partition size */
541 uint32_t gds_gfx_partition_size; 541 __u32 gds_gfx_partition_size;
542 /** GDS compute partition size */ 542 /** GDS compute partition size */
543 uint32_t compute_partition_size; 543 __u32 compute_partition_size;
544 /** total GDS memory size */ 544 /** total GDS memory size */
545 uint32_t gds_total_size; 545 __u32 gds_total_size;
546 /** GWS size per GFX partition */ 546 /** GWS size per GFX partition */
547 uint32_t gws_per_gfx_partition; 547 __u32 gws_per_gfx_partition;
548 /** GSW size per compute partition */ 548 /** GSW size per compute partition */
549 uint32_t gws_per_compute_partition; 549 __u32 gws_per_compute_partition;
550 /** OA size per GFX partition */ 550 /** OA size per GFX partition */
551 uint32_t oa_per_gfx_partition; 551 __u32 oa_per_gfx_partition;
552 /** OA size per compute partition */ 552 /** OA size per compute partition */
553 uint32_t oa_per_compute_partition; 553 __u32 oa_per_compute_partition;
554 uint32_t _pad; 554 __u32 _pad;
555}; 555};
556 556
557struct drm_amdgpu_info_vram_gtt { 557struct drm_amdgpu_info_vram_gtt {
558 uint64_t vram_size; 558 __u64 vram_size;
559 uint64_t vram_cpu_accessible_size; 559 __u64 vram_cpu_accessible_size;
560 uint64_t gtt_size; 560 __u64 gtt_size;
561}; 561};
562 562
563struct drm_amdgpu_info_firmware { 563struct drm_amdgpu_info_firmware {
564 uint32_t ver; 564 __u32 ver;
565 uint32_t feature; 565 __u32 feature;
566}; 566};
567 567
568#define AMDGPU_VRAM_TYPE_UNKNOWN 0 568#define AMDGPU_VRAM_TYPE_UNKNOWN 0
@@ -576,61 +576,61 @@ struct drm_amdgpu_info_firmware {
576 576
577struct drm_amdgpu_info_device { 577struct drm_amdgpu_info_device {
578 /** PCI Device ID */ 578 /** PCI Device ID */
579 uint32_t device_id; 579 __u32 device_id;
580 /** Internal chip revision: A0, A1, etc.) */ 580 /** Internal chip revision: A0, A1, etc.) */
581 uint32_t chip_rev; 581 __u32 chip_rev;
582 uint32_t external_rev; 582 __u32 external_rev;
583 /** Revision id in PCI Config space */ 583 /** Revision id in PCI Config space */
584 uint32_t pci_rev; 584 __u32 pci_rev;
585 uint32_t family; 585 __u32 family;
586 uint32_t num_shader_engines; 586 __u32 num_shader_engines;
587 uint32_t num_shader_arrays_per_engine; 587 __u32 num_shader_arrays_per_engine;
588 /* in KHz */ 588 /* in KHz */
589 uint32_t gpu_counter_freq; 589 __u32 gpu_counter_freq;
590 uint64_t max_engine_clock; 590 __u64 max_engine_clock;
591 uint64_t max_memory_clock; 591 __u64 max_memory_clock;
592 /* cu information */ 592 /* cu information */
593 uint32_t cu_active_number; 593 __u32 cu_active_number;
594 uint32_t cu_ao_mask; 594 __u32 cu_ao_mask;
595 uint32_t cu_bitmap[4][4]; 595 __u32 cu_bitmap[4][4];
596 /** Render backend pipe mask. One render backend is CB+DB. */ 596 /** Render backend pipe mask. One render backend is CB+DB. */
597 uint32_t enabled_rb_pipes_mask; 597 __u32 enabled_rb_pipes_mask;
598 uint32_t num_rb_pipes; 598 __u32 num_rb_pipes;
599 uint32_t num_hw_gfx_contexts; 599 __u32 num_hw_gfx_contexts;
600 uint32_t _pad; 600 __u32 _pad;
601 uint64_t ids_flags; 601 __u64 ids_flags;
602 /** Starting virtual address for UMDs. */ 602 /** Starting virtual address for UMDs. */
603 uint64_t virtual_address_offset; 603 __u64 virtual_address_offset;
604 /** The maximum virtual address */ 604 /** The maximum virtual address */
605 uint64_t virtual_address_max; 605 __u64 virtual_address_max;
606 /** Required alignment of virtual addresses. */ 606 /** Required alignment of virtual addresses. */
607 uint32_t virtual_address_alignment; 607 __u32 virtual_address_alignment;
608 /** Page table entry - fragment size */ 608 /** Page table entry - fragment size */
609 uint32_t pte_fragment_size; 609 __u32 pte_fragment_size;
610 uint32_t gart_page_size; 610 __u32 gart_page_size;
611 /** constant engine ram size*/ 611 /** constant engine ram size*/
612 uint32_t ce_ram_size; 612 __u32 ce_ram_size;
613 /** video memory type info*/ 613 /** video memory type info*/
614 uint32_t vram_type; 614 __u32 vram_type;
615 /** video memory bit width*/ 615 /** video memory bit width*/
616 uint32_t vram_bit_width; 616 __u32 vram_bit_width;
617 /* vce harvesting instance */ 617 /* vce harvesting instance */
618 uint32_t vce_harvest_config; 618 __u32 vce_harvest_config;
619}; 619};
620 620
621struct drm_amdgpu_info_hw_ip { 621struct drm_amdgpu_info_hw_ip {
622 /** Version of h/w IP */ 622 /** Version of h/w IP */
623 uint32_t hw_ip_version_major; 623 __u32 hw_ip_version_major;
624 uint32_t hw_ip_version_minor; 624 __u32 hw_ip_version_minor;
625 /** Capabilities */ 625 /** Capabilities */
626 uint64_t capabilities_flags; 626 __u64 capabilities_flags;
627 /** command buffer address start alignment*/ 627 /** command buffer address start alignment*/
628 uint32_t ib_start_alignment; 628 __u32 ib_start_alignment;
629 /** command buffer size alignment*/ 629 /** command buffer size alignment*/
630 uint32_t ib_size_alignment; 630 __u32 ib_size_alignment;
631 /** Bitmask of available rings. Bit 0 means ring 0, etc. */ 631 /** Bitmask of available rings. Bit 0 means ring 0, etc. */
632 uint32_t available_rings; 632 __u32 available_rings;
633 uint32_t _pad; 633 __u32 _pad;
634}; 634};
635 635
636/* 636/*
diff --git a/include/uapi/drm/armada_drm.h b/include/uapi/drm/armada_drm.h
index 8dec3fdc99c7..6de7f0196ca0 100644
--- a/include/uapi/drm/armada_drm.h
+++ b/include/uapi/drm/armada_drm.h
@@ -9,6 +9,8 @@
9#ifndef DRM_ARMADA_IOCTL_H 9#ifndef DRM_ARMADA_IOCTL_H
10#define DRM_ARMADA_IOCTL_H 10#define DRM_ARMADA_IOCTL_H
11 11
12#include "drm.h"
13
12#define DRM_ARMADA_GEM_CREATE 0x00 14#define DRM_ARMADA_GEM_CREATE 0x00
13#define DRM_ARMADA_GEM_MMAP 0x02 15#define DRM_ARMADA_GEM_MMAP 0x02
14#define DRM_ARMADA_GEM_PWRITE 0x03 16#define DRM_ARMADA_GEM_PWRITE 0x03
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 3801584a0c53..b4e92eb12044 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -54,6 +54,7 @@ typedef int32_t __s32;
54typedef uint32_t __u32; 54typedef uint32_t __u32;
55typedef int64_t __s64; 55typedef int64_t __s64;
56typedef uint64_t __u64; 56typedef uint64_t __u64;
57typedef size_t __kernel_size_t;
57typedef unsigned long drm_handle_t; 58typedef unsigned long drm_handle_t;
58 59
59#endif 60#endif
@@ -129,11 +130,11 @@ struct drm_version {
129 int version_major; /**< Major version */ 130 int version_major; /**< Major version */
130 int version_minor; /**< Minor version */ 131 int version_minor; /**< Minor version */
131 int version_patchlevel; /**< Patch level */ 132 int version_patchlevel; /**< Patch level */
132 size_t name_len; /**< Length of name buffer */ 133 __kernel_size_t name_len; /**< Length of name buffer */
133 char __user *name; /**< Name of driver */ 134 char __user *name; /**< Name of driver */
134 size_t date_len; /**< Length of date buffer */ 135 __kernel_size_t date_len; /**< Length of date buffer */
135 char __user *date; /**< User-space buffer to hold date */ 136 char __user *date; /**< User-space buffer to hold date */
136 size_t desc_len; /**< Length of desc buffer */ 137 __kernel_size_t desc_len; /**< Length of desc buffer */
137 char __user *desc; /**< User-space buffer to hold desc */ 138 char __user *desc; /**< User-space buffer to hold desc */
138}; 139};
139 140
@@ -143,7 +144,7 @@ struct drm_version {
143 * \sa drmGetBusid() and drmSetBusId(). 144 * \sa drmGetBusid() and drmSetBusId().
144 */ 145 */
145struct drm_unique { 146struct drm_unique {
146 size_t unique_len; /**< Length of unique */ 147 __kernel_size_t unique_len; /**< Length of unique */
147 char __user *unique; /**< Unique name for driver instantiation */ 148 char __user *unique; /**< Unique name for driver instantiation */
148}; 149};
149 150
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index 0b69a7753558..998bd253faad 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -24,7 +24,7 @@
24#ifndef DRM_FOURCC_H 24#ifndef DRM_FOURCC_H
25#define DRM_FOURCC_H 25#define DRM_FOURCC_H
26 26
27#include <linux/types.h> 27#include "drm.h"
28 28
29#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \ 29#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \
30 ((__u32)(c) << 16) | ((__u32)(d) << 24)) 30 ((__u32)(c) << 16) | ((__u32)(d) << 24))
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 6c11ca401de8..50adb46204c2 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -27,7 +27,7 @@
27#ifndef _DRM_MODE_H 27#ifndef _DRM_MODE_H
28#define _DRM_MODE_H 28#define _DRM_MODE_H
29 29
30#include <linux/types.h> 30#include "drm.h"
31 31
32#define DRM_DISPLAY_INFO_LEN 32 32#define DRM_DISPLAY_INFO_LEN 32
33#define DRM_CONNECTOR_NAME_LEN 32 33#define DRM_CONNECTOR_NAME_LEN 32
@@ -526,14 +526,14 @@ struct drm_mode_crtc_page_flip {
526 526
527/* create a dumb scanout buffer */ 527/* create a dumb scanout buffer */
528struct drm_mode_create_dumb { 528struct drm_mode_create_dumb {
529 uint32_t height; 529 __u32 height;
530 uint32_t width; 530 __u32 width;
531 uint32_t bpp; 531 __u32 bpp;
532 uint32_t flags; 532 __u32 flags;
533 /* handle, pitch, size will be returned */ 533 /* handle, pitch, size will be returned */
534 uint32_t handle; 534 __u32 handle;
535 uint32_t pitch; 535 __u32 pitch;
536 uint64_t size; 536 __u64 size;
537}; 537};
538 538
539/* set up for mmap of a dumb scanout buffer */ 539/* set up for mmap of a dumb scanout buffer */
@@ -550,7 +550,7 @@ struct drm_mode_map_dumb {
550}; 550};
551 551
552struct drm_mode_destroy_dumb { 552struct drm_mode_destroy_dumb {
553 uint32_t handle; 553 __u32 handle;
554}; 554};
555 555
556/* page-flip flags are valid, plus: */ 556/* page-flip flags are valid, plus: */
diff --git a/include/uapi/drm/drm_sarea.h b/include/uapi/drm/drm_sarea.h
index 413a5642d49f..1d1a858a203d 100644
--- a/include/uapi/drm/drm_sarea.h
+++ b/include/uapi/drm/drm_sarea.h
@@ -32,7 +32,7 @@
32#ifndef _DRM_SAREA_H_ 32#ifndef _DRM_SAREA_H_
33#define _DRM_SAREA_H_ 33#define _DRM_SAREA_H_
34 34
35#include <drm/drm.h> 35#include "drm.h"
36 36
37/* SAREA area needs to be at least a page */ 37/* SAREA area needs to be at least a page */
38#if defined(__alpha__) 38#if defined(__alpha__)
diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h
index 5575ed1598bd..312c67d744ae 100644
--- a/include/uapi/drm/exynos_drm.h
+++ b/include/uapi/drm/exynos_drm.h
@@ -15,7 +15,7 @@
15#ifndef _UAPI_EXYNOS_DRM_H_ 15#ifndef _UAPI_EXYNOS_DRM_H_
16#define _UAPI_EXYNOS_DRM_H_ 16#define _UAPI_EXYNOS_DRM_H_
17 17
18#include <drm/drm.h> 18#include "drm.h"
19 19
20/** 20/**
21 * User-desired buffer creation information structure. 21 * User-desired buffer creation information structure.
@@ -27,7 +27,7 @@
27 * - this handle will be set by gem module of kernel side. 27 * - this handle will be set by gem module of kernel side.
28 */ 28 */
29struct drm_exynos_gem_create { 29struct drm_exynos_gem_create {
30 uint64_t size; 30 __u64 size;
31 unsigned int flags; 31 unsigned int flags;
32 unsigned int handle; 32 unsigned int handle;
33}; 33};
@@ -44,7 +44,7 @@ struct drm_exynos_gem_create {
44struct drm_exynos_gem_info { 44struct drm_exynos_gem_info {
45 unsigned int handle; 45 unsigned int handle;
46 unsigned int flags; 46 unsigned int flags;
47 uint64_t size; 47 __u64 size;
48}; 48};
49 49
50/** 50/**
@@ -58,7 +58,7 @@ struct drm_exynos_gem_info {
58struct drm_exynos_vidi_connection { 58struct drm_exynos_vidi_connection {
59 unsigned int connection; 59 unsigned int connection;
60 unsigned int extensions; 60 unsigned int extensions;
61 uint64_t edid; 61 __u64 edid;
62}; 62};
63 63
64/* memory type definitions. */ 64/* memory type definitions. */
diff --git a/include/uapi/drm/i810_drm.h b/include/uapi/drm/i810_drm.h
index 34736efd5824..bdb028723ded 100644
--- a/include/uapi/drm/i810_drm.h
+++ b/include/uapi/drm/i810_drm.h
@@ -1,7 +1,7 @@
1#ifndef _I810_DRM_H_ 1#ifndef _I810_DRM_H_
2#define _I810_DRM_H_ 2#define _I810_DRM_H_
3 3
4#include <drm/drm.h> 4#include "drm.h"
5 5
6/* WARNING: These defines must be the same as what the Xserver uses. 6/* WARNING: These defines must be the same as what the Xserver uses.
7 * if you change them, you must change the defines in the Xserver. 7 * if you change them, you must change the defines in the Xserver.
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 67ef73a5d6eb..c937a3628190 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -27,7 +27,7 @@
27#ifndef _UAPI_I915_DRM_H_ 27#ifndef _UAPI_I915_DRM_H_
28#define _UAPI_I915_DRM_H_ 28#define _UAPI_I915_DRM_H_
29 29
30#include <drm/drm.h> 30#include "drm.h"
31 31
32/* Please note that modifications to all structs defined here are 32/* Please note that modifications to all structs defined here are
33 * subject to backwards-compatibility constraints. 33 * subject to backwards-compatibility constraints.
diff --git a/include/uapi/drm/mga_drm.h b/include/uapi/drm/mga_drm.h
index 2375bfd6e5e9..fca817009e13 100644
--- a/include/uapi/drm/mga_drm.h
+++ b/include/uapi/drm/mga_drm.h
@@ -35,7 +35,7 @@
35#ifndef __MGA_DRM_H__ 35#ifndef __MGA_DRM_H__
36#define __MGA_DRM_H__ 36#define __MGA_DRM_H__
37 37
38#include <drm/drm.h> 38#include "drm.h"
39 39
40/* WARNING: If you change any of these defines, make sure to change the 40/* WARNING: If you change any of these defines, make sure to change the
41 * defines in the Xserver file (mga_sarea.h) 41 * defines in the Xserver file (mga_sarea.h)
diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h
index 75a232b9a970..e995ffbcf86a 100644
--- a/include/uapi/drm/msm_drm.h
+++ b/include/uapi/drm/msm_drm.h
@@ -18,8 +18,7 @@
18#ifndef __MSM_DRM_H__ 18#ifndef __MSM_DRM_H__
19#define __MSM_DRM_H__ 19#define __MSM_DRM_H__
20 20
21#include <stddef.h> 21#include "drm.h"
22#include <drm/drm.h>
23 22
24/* Please note that modifications to all structs defined here are 23/* Please note that modifications to all structs defined here are
25 * subject to backwards-compatibility constraints: 24 * subject to backwards-compatibility constraints:
diff --git a/include/uapi/drm/nouveau_drm.h b/include/uapi/drm/nouveau_drm.h
index fd594cc73cc0..500d82aecbe4 100644
--- a/include/uapi/drm/nouveau_drm.h
+++ b/include/uapi/drm/nouveau_drm.h
@@ -27,6 +27,8 @@
27 27
28#define DRM_NOUVEAU_EVENT_NVIF 0x80000000 28#define DRM_NOUVEAU_EVENT_NVIF 0x80000000
29 29
30#include <drm/drm.h>
31
30#define NOUVEAU_GEM_DOMAIN_CPU (1 << 0) 32#define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
31#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1) 33#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
32#define NOUVEAU_GEM_DOMAIN_GART (1 << 2) 34#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
@@ -41,34 +43,34 @@
41#define NOUVEAU_GEM_TILE_NONCONTIG 0x00000008 43#define NOUVEAU_GEM_TILE_NONCONTIG 0x00000008
42 44
43struct drm_nouveau_gem_info { 45struct drm_nouveau_gem_info {
44 uint32_t handle; 46 __u32 handle;
45 uint32_t domain; 47 __u32 domain;
46 uint64_t size; 48 __u64 size;
47 uint64_t offset; 49 __u64 offset;
48 uint64_t map_handle; 50 __u64 map_handle;
49 uint32_t tile_mode; 51 __u32 tile_mode;
50 uint32_t tile_flags; 52 __u32 tile_flags;
51}; 53};
52 54
53struct drm_nouveau_gem_new { 55struct drm_nouveau_gem_new {
54 struct drm_nouveau_gem_info info; 56 struct drm_nouveau_gem_info info;
55 uint32_t channel_hint; 57 __u32 channel_hint;
56 uint32_t align; 58 __u32 align;
57}; 59};
58 60
59#define NOUVEAU_GEM_MAX_BUFFERS 1024 61#define NOUVEAU_GEM_MAX_BUFFERS 1024
60struct drm_nouveau_gem_pushbuf_bo_presumed { 62struct drm_nouveau_gem_pushbuf_bo_presumed {
61 uint32_t valid; 63 __u32 valid;
62 uint32_t domain; 64 __u32 domain;
63 uint64_t offset; 65 __u64 offset;
64}; 66};
65 67
66struct drm_nouveau_gem_pushbuf_bo { 68struct drm_nouveau_gem_pushbuf_bo {
67 uint64_t user_priv; 69 __u64 user_priv;
68 uint32_t handle; 70 __u32 handle;
69 uint32_t read_domains; 71 __u32 read_domains;
70 uint32_t write_domains; 72 __u32 write_domains;
71 uint32_t valid_domains; 73 __u32 valid_domains;
72 struct drm_nouveau_gem_pushbuf_bo_presumed presumed; 74 struct drm_nouveau_gem_pushbuf_bo_presumed presumed;
73}; 75};
74 76
@@ -77,46 +79,46 @@ struct drm_nouveau_gem_pushbuf_bo {
77#define NOUVEAU_GEM_RELOC_OR (1 << 2) 79#define NOUVEAU_GEM_RELOC_OR (1 << 2)
78#define NOUVEAU_GEM_MAX_RELOCS 1024 80#define NOUVEAU_GEM_MAX_RELOCS 1024
79struct drm_nouveau_gem_pushbuf_reloc { 81struct drm_nouveau_gem_pushbuf_reloc {
80 uint32_t reloc_bo_index; 82 __u32 reloc_bo_index;
81 uint32_t reloc_bo_offset; 83 __u32 reloc_bo_offset;
82 uint32_t bo_index; 84 __u32 bo_index;
83 uint32_t flags; 85 __u32 flags;
84 uint32_t data; 86 __u32 data;
85 uint32_t vor; 87 __u32 vor;
86 uint32_t tor; 88 __u32 tor;
87}; 89};
88 90
89#define NOUVEAU_GEM_MAX_PUSH 512 91#define NOUVEAU_GEM_MAX_PUSH 512
90struct drm_nouveau_gem_pushbuf_push { 92struct drm_nouveau_gem_pushbuf_push {
91 uint32_t bo_index; 93 __u32 bo_index;
92 uint32_t pad; 94 __u32 pad;
93 uint64_t offset; 95 __u64 offset;
94 uint64_t length; 96 __u64 length;
95}; 97};
96 98
97struct drm_nouveau_gem_pushbuf { 99struct drm_nouveau_gem_pushbuf {
98 uint32_t channel; 100 __u32 channel;
99 uint32_t nr_buffers; 101 __u32 nr_buffers;
100 uint64_t buffers; 102 __u64 buffers;
101 uint32_t nr_relocs; 103 __u32 nr_relocs;
102 uint32_t nr_push; 104 __u32 nr_push;
103 uint64_t relocs; 105 __u64 relocs;
104 uint64_t push; 106 __u64 push;
105 uint32_t suffix0; 107 __u32 suffix0;
106 uint32_t suffix1; 108 __u32 suffix1;
107 uint64_t vram_available; 109 __u64 vram_available;
108 uint64_t gart_available; 110 __u64 gart_available;
109}; 111};
110 112
111#define NOUVEAU_GEM_CPU_PREP_NOWAIT 0x00000001 113#define NOUVEAU_GEM_CPU_PREP_NOWAIT 0x00000001
112#define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004 114#define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004
113struct drm_nouveau_gem_cpu_prep { 115struct drm_nouveau_gem_cpu_prep {
114 uint32_t handle; 116 __u32 handle;
115 uint32_t flags; 117 __u32 flags;
116}; 118};
117 119
118struct drm_nouveau_gem_cpu_fini { 120struct drm_nouveau_gem_cpu_fini {
119 uint32_t handle; 121 __u32 handle;
120}; 122};
121 123
122#define DRM_NOUVEAU_GETPARAM 0x00 /* deprecated */ 124#define DRM_NOUVEAU_GETPARAM 0x00 /* deprecated */
diff --git a/include/uapi/drm/omap_drm.h b/include/uapi/drm/omap_drm.h
index 1d0b1172664e..0750c01bb480 100644
--- a/include/uapi/drm/omap_drm.h
+++ b/include/uapi/drm/omap_drm.h
@@ -20,7 +20,7 @@
20#ifndef __OMAP_DRM_H__ 20#ifndef __OMAP_DRM_H__
21#define __OMAP_DRM_H__ 21#define __OMAP_DRM_H__
22 22
23#include <drm/drm.h> 23#include "drm.h"
24 24
25/* Please note that modifications to all structs defined here are 25/* Please note that modifications to all structs defined here are
26 * subject to backwards-compatibility constraints. 26 * subject to backwards-compatibility constraints.
diff --git a/include/uapi/drm/qxl_drm.h b/include/uapi/drm/qxl_drm.h
index ebebd36c4117..4d1e32640463 100644
--- a/include/uapi/drm/qxl_drm.h
+++ b/include/uapi/drm/qxl_drm.h
@@ -24,13 +24,12 @@
24#ifndef QXL_DRM_H 24#ifndef QXL_DRM_H
25#define QXL_DRM_H 25#define QXL_DRM_H
26 26
27#include <stddef.h> 27#include "drm.h"
28#include "drm/drm.h"
29 28
30/* Please note that modifications to all structs defined here are 29/* Please note that modifications to all structs defined here are
31 * subject to backwards-compatibility constraints. 30 * subject to backwards-compatibility constraints.
32 * 31 *
33 * Do not use pointers, use uint64_t instead for 32 bit / 64 bit user/kernel 32 * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
34 * compatibility Keep fields aligned to their size 33 * compatibility Keep fields aligned to their size
35 */ 34 */
36 35
@@ -48,14 +47,14 @@
48#define DRM_QXL_ALLOC_SURF 0x06 47#define DRM_QXL_ALLOC_SURF 0x06
49 48
50struct drm_qxl_alloc { 49struct drm_qxl_alloc {
51 uint32_t size; 50 __u32 size;
52 uint32_t handle; /* 0 is an invalid handle */ 51 __u32 handle; /* 0 is an invalid handle */
53}; 52};
54 53
55struct drm_qxl_map { 54struct drm_qxl_map {
56 uint64_t offset; /* use for mmap system call */ 55 __u64 offset; /* use for mmap system call */
57 uint32_t handle; 56 __u32 handle;
58 uint32_t pad; 57 __u32 pad;
59}; 58};
60 59
61/* 60/*
@@ -68,59 +67,59 @@ struct drm_qxl_map {
68#define QXL_RELOC_TYPE_SURF 2 67#define QXL_RELOC_TYPE_SURF 2
69 68
70struct drm_qxl_reloc { 69struct drm_qxl_reloc {
71 uint64_t src_offset; /* offset into src_handle or src buffer */ 70 __u64 src_offset; /* offset into src_handle or src buffer */
72 uint64_t dst_offset; /* offset in dest handle */ 71 __u64 dst_offset; /* offset in dest handle */
73 uint32_t src_handle; /* dest handle to compute address from */ 72 __u32 src_handle; /* dest handle to compute address from */
74 uint32_t dst_handle; /* 0 if to command buffer */ 73 __u32 dst_handle; /* 0 if to command buffer */
75 uint32_t reloc_type; 74 __u32 reloc_type;
76 uint32_t pad; 75 __u32 pad;
77}; 76};
78 77
79struct drm_qxl_command { 78struct drm_qxl_command {
80 uint64_t __user command; /* void* */ 79 __u64 __user command; /* void* */
81 uint64_t __user relocs; /* struct drm_qxl_reloc* */ 80 __u64 __user relocs; /* struct drm_qxl_reloc* */
82 uint32_t type; 81 __u32 type;
83 uint32_t command_size; 82 __u32 command_size;
84 uint32_t relocs_num; 83 __u32 relocs_num;
85 uint32_t pad; 84 __u32 pad;
86}; 85};
87 86
88/* XXX: call it drm_qxl_commands? */ 87/* XXX: call it drm_qxl_commands? */
89struct drm_qxl_execbuffer { 88struct drm_qxl_execbuffer {
90 uint32_t flags; /* for future use */ 89 __u32 flags; /* for future use */
91 uint32_t commands_num; 90 __u32 commands_num;
92 uint64_t __user commands; /* struct drm_qxl_command* */ 91 __u64 __user commands; /* struct drm_qxl_command* */
93}; 92};
94 93
95struct drm_qxl_update_area { 94struct drm_qxl_update_area {
96 uint32_t handle; 95 __u32 handle;
97 uint32_t top; 96 __u32 top;
98 uint32_t left; 97 __u32 left;
99 uint32_t bottom; 98 __u32 bottom;
100 uint32_t right; 99 __u32 right;
101 uint32_t pad; 100 __u32 pad;
102}; 101};
103 102
104#define QXL_PARAM_NUM_SURFACES 1 /* rom->n_surfaces */ 103#define QXL_PARAM_NUM_SURFACES 1 /* rom->n_surfaces */
105#define QXL_PARAM_MAX_RELOCS 2 104#define QXL_PARAM_MAX_RELOCS 2
106struct drm_qxl_getparam { 105struct drm_qxl_getparam {
107 uint64_t param; 106 __u64 param;
108 uint64_t value; 107 __u64 value;
109}; 108};
110 109
111/* these are one bit values */ 110/* these are one bit values */
112struct drm_qxl_clientcap { 111struct drm_qxl_clientcap {
113 uint32_t index; 112 __u32 index;
114 uint32_t pad; 113 __u32 pad;
115}; 114};
116 115
117struct drm_qxl_alloc_surf { 116struct drm_qxl_alloc_surf {
118 uint32_t format; 117 __u32 format;
119 uint32_t width; 118 __u32 width;
120 uint32_t height; 119 __u32 height;
121 int32_t stride; 120 __s32 stride;
122 uint32_t handle; 121 __u32 handle;
123 uint32_t pad; 122 __u32 pad;
124}; 123};
125 124
126#define DRM_IOCTL_QXL_ALLOC \ 125#define DRM_IOCTL_QXL_ALLOC \
diff --git a/include/uapi/drm/r128_drm.h b/include/uapi/drm/r128_drm.h
index 76b0aa3e8210..7a44c6500a7e 100644
--- a/include/uapi/drm/r128_drm.h
+++ b/include/uapi/drm/r128_drm.h
@@ -33,7 +33,7 @@
33#ifndef __R128_DRM_H__ 33#ifndef __R128_DRM_H__
34#define __R128_DRM_H__ 34#define __R128_DRM_H__
35 35
36#include <drm/drm.h> 36#include "drm.h"
37 37
38/* WARNING: If you change any of these defines, make sure to change the 38/* WARNING: If you change any of these defines, make sure to change the
39 * defines in the X server file (r128_sarea.h) 39 * defines in the X server file (r128_sarea.h)
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
index 01aa2a8e3f8d..ccb9bcd82685 100644
--- a/include/uapi/drm/radeon_drm.h
+++ b/include/uapi/drm/radeon_drm.h
@@ -793,9 +793,9 @@ typedef struct drm_radeon_surface_free {
793#define RADEON_GEM_DOMAIN_VRAM 0x4 793#define RADEON_GEM_DOMAIN_VRAM 0x4
794 794
795struct drm_radeon_gem_info { 795struct drm_radeon_gem_info {
796 uint64_t gart_size; 796 __u64 gart_size;
797 uint64_t vram_size; 797 __u64 vram_size;
798 uint64_t vram_visible; 798 __u64 vram_visible;
799}; 799};
800 800
801#define RADEON_GEM_NO_BACKING_STORE (1 << 0) 801#define RADEON_GEM_NO_BACKING_STORE (1 << 0)
@@ -807,11 +807,11 @@ struct drm_radeon_gem_info {
807#define RADEON_GEM_NO_CPU_ACCESS (1 << 4) 807#define RADEON_GEM_NO_CPU_ACCESS (1 << 4)
808 808
809struct drm_radeon_gem_create { 809struct drm_radeon_gem_create {
810 uint64_t size; 810 __u64 size;
811 uint64_t alignment; 811 __u64 alignment;
812 uint32_t handle; 812 __u32 handle;
813 uint32_t initial_domain; 813 __u32 initial_domain;
814 uint32_t flags; 814 __u32 flags;
815}; 815};
816 816
817/* 817/*
@@ -825,10 +825,10 @@ struct drm_radeon_gem_create {
825#define RADEON_GEM_USERPTR_REGISTER (1 << 3) 825#define RADEON_GEM_USERPTR_REGISTER (1 << 3)
826 826
827struct drm_radeon_gem_userptr { 827struct drm_radeon_gem_userptr {
828 uint64_t addr; 828 __u64 addr;
829 uint64_t size; 829 __u64 size;
830 uint32_t flags; 830 __u32 flags;
831 uint32_t handle; 831 __u32 handle;
832}; 832};
833 833
834#define RADEON_TILING_MACRO 0x1 834#define RADEON_TILING_MACRO 0x1
@@ -850,72 +850,72 @@ struct drm_radeon_gem_userptr {
850#define RADEON_TILING_EG_STENCIL_TILE_SPLIT_MASK 0xf 850#define RADEON_TILING_EG_STENCIL_TILE_SPLIT_MASK 0xf
851 851
852struct drm_radeon_gem_set_tiling { 852struct drm_radeon_gem_set_tiling {
853 uint32_t handle; 853 __u32 handle;
854 uint32_t tiling_flags; 854 __u32 tiling_flags;
855 uint32_t pitch; 855 __u32 pitch;
856}; 856};
857 857
858struct drm_radeon_gem_get_tiling { 858struct drm_radeon_gem_get_tiling {
859 uint32_t handle; 859 __u32 handle;
860 uint32_t tiling_flags; 860 __u32 tiling_flags;
861 uint32_t pitch; 861 __u32 pitch;
862}; 862};
863 863
864struct drm_radeon_gem_mmap { 864struct drm_radeon_gem_mmap {
865 uint32_t handle; 865 __u32 handle;
866 uint32_t pad; 866 __u32 pad;
867 uint64_t offset; 867 __u64 offset;
868 uint64_t size; 868 __u64 size;
869 uint64_t addr_ptr; 869 __u64 addr_ptr;
870}; 870};
871 871
872struct drm_radeon_gem_set_domain { 872struct drm_radeon_gem_set_domain {
873 uint32_t handle; 873 __u32 handle;
874 uint32_t read_domains; 874 __u32 read_domains;
875 uint32_t write_domain; 875 __u32 write_domain;
876}; 876};
877 877
878struct drm_radeon_gem_wait_idle { 878struct drm_radeon_gem_wait_idle {
879 uint32_t handle; 879 __u32 handle;
880 uint32_t pad; 880 __u32 pad;
881}; 881};
882 882
883struct drm_radeon_gem_busy { 883struct drm_radeon_gem_busy {
884 uint32_t handle; 884 __u32 handle;
885 uint32_t domain; 885 __u32 domain;
886}; 886};
887 887
888struct drm_radeon_gem_pread { 888struct drm_radeon_gem_pread {
889 /** Handle for the object being read. */ 889 /** Handle for the object being read. */
890 uint32_t handle; 890 __u32 handle;
891 uint32_t pad; 891 __u32 pad;
892 /** Offset into the object to read from */ 892 /** Offset into the object to read from */
893 uint64_t offset; 893 __u64 offset;
894 /** Length of data to read */ 894 /** Length of data to read */
895 uint64_t size; 895 __u64 size;
896 /** Pointer to write the data into. */ 896 /** Pointer to write the data into. */
897 /* void *, but pointers are not 32/64 compatible */ 897 /* void *, but pointers are not 32/64 compatible */
898 uint64_t data_ptr; 898 __u64 data_ptr;
899}; 899};
900 900
901struct drm_radeon_gem_pwrite { 901struct drm_radeon_gem_pwrite {
902 /** Handle for the object being written to. */ 902 /** Handle for the object being written to. */
903 uint32_t handle; 903 __u32 handle;
904 uint32_t pad; 904 __u32 pad;
905 /** Offset into the object to write to */ 905 /** Offset into the object to write to */
906 uint64_t offset; 906 __u64 offset;
907 /** Length of data to write */ 907 /** Length of data to write */
908 uint64_t size; 908 __u64 size;
909 /** Pointer to read the data from. */ 909 /** Pointer to read the data from. */
910 /* void *, but pointers are not 32/64 compatible */ 910 /* void *, but pointers are not 32/64 compatible */
911 uint64_t data_ptr; 911 __u64 data_ptr;
912}; 912};
913 913
914/* Sets or returns a value associated with a buffer. */ 914/* Sets or returns a value associated with a buffer. */
915struct drm_radeon_gem_op { 915struct drm_radeon_gem_op {
916 uint32_t handle; /* buffer */ 916 __u32 handle; /* buffer */
917 uint32_t op; /* RADEON_GEM_OP_* */ 917 __u32 op; /* RADEON_GEM_OP_* */
918 uint64_t value; /* input or return value */ 918 __u64 value; /* input or return value */
919}; 919};
920 920
921#define RADEON_GEM_OP_GET_INITIAL_DOMAIN 0 921#define RADEON_GEM_OP_GET_INITIAL_DOMAIN 0
@@ -935,11 +935,11 @@ struct drm_radeon_gem_op {
935#define RADEON_VM_PAGE_SNOOPED (1 << 4) 935#define RADEON_VM_PAGE_SNOOPED (1 << 4)
936 936
937struct drm_radeon_gem_va { 937struct drm_radeon_gem_va {
938 uint32_t handle; 938 __u32 handle;
939 uint32_t operation; 939 __u32 operation;
940 uint32_t vm_id; 940 __u32 vm_id;
941 uint32_t flags; 941 __u32 flags;
942 uint64_t offset; 942 __u64 offset;
943}; 943};
944 944
945#define RADEON_CHUNK_ID_RELOCS 0x01 945#define RADEON_CHUNK_ID_RELOCS 0x01
@@ -961,29 +961,29 @@ struct drm_radeon_gem_va {
961/* 0 = normal, + = higher priority, - = lower priority */ 961/* 0 = normal, + = higher priority, - = lower priority */
962 962
963struct drm_radeon_cs_chunk { 963struct drm_radeon_cs_chunk {
964 uint32_t chunk_id; 964 __u32 chunk_id;
965 uint32_t length_dw; 965 __u32 length_dw;
966 uint64_t chunk_data; 966 __u64 chunk_data;
967}; 967};
968 968
969/* drm_radeon_cs_reloc.flags */ 969/* drm_radeon_cs_reloc.flags */
970#define RADEON_RELOC_PRIO_MASK (0xf << 0) 970#define RADEON_RELOC_PRIO_MASK (0xf << 0)
971 971
972struct drm_radeon_cs_reloc { 972struct drm_radeon_cs_reloc {
973 uint32_t handle; 973 __u32 handle;
974 uint32_t read_domains; 974 __u32 read_domains;
975 uint32_t write_domain; 975 __u32 write_domain;
976 uint32_t flags; 976 __u32 flags;
977}; 977};
978 978
979struct drm_radeon_cs { 979struct drm_radeon_cs {
980 uint32_t num_chunks; 980 __u32 num_chunks;
981 uint32_t cs_id; 981 __u32 cs_id;
982 /* this points to uint64_t * which point to cs chunks */ 982 /* this points to __u64 * which point to cs chunks */
983 uint64_t chunks; 983 __u64 chunks;
984 /* updates to the limits after this CS ioctl */ 984 /* updates to the limits after this CS ioctl */
985 uint64_t gart_limit; 985 __u64 gart_limit;
986 uint64_t vram_limit; 986 __u64 vram_limit;
987}; 987};
988 988
989#define RADEON_INFO_DEVICE_ID 0x00 989#define RADEON_INFO_DEVICE_ID 0x00
@@ -1042,9 +1042,9 @@ struct drm_radeon_cs {
1042#define RADEON_INFO_GPU_RESET_COUNTER 0x26 1042#define RADEON_INFO_GPU_RESET_COUNTER 0x26
1043 1043
1044struct drm_radeon_info { 1044struct drm_radeon_info {
1045 uint32_t request; 1045 __u32 request;
1046 uint32_t pad; 1046 __u32 pad;
1047 uint64_t value; 1047 __u64 value;
1048}; 1048};
1049 1049
1050/* Those correspond to the tile index to use, this is to explicitly state 1050/* Those correspond to the tile index to use, this is to explicitly state
diff --git a/include/uapi/drm/savage_drm.h b/include/uapi/drm/savage_drm.h
index 9dc9dc1a7753..574147489c60 100644
--- a/include/uapi/drm/savage_drm.h
+++ b/include/uapi/drm/savage_drm.h
@@ -26,7 +26,7 @@
26#ifndef __SAVAGE_DRM_H__ 26#ifndef __SAVAGE_DRM_H__
27#define __SAVAGE_DRM_H__ 27#define __SAVAGE_DRM_H__
28 28
29#include <drm/drm.h> 29#include "drm.h"
30 30
31#ifndef __SAVAGE_SAREA_DEFINES__ 31#ifndef __SAVAGE_SAREA_DEFINES__
32#define __SAVAGE_SAREA_DEFINES__ 32#define __SAVAGE_SAREA_DEFINES__
diff --git a/include/uapi/drm/tegra_drm.h b/include/uapi/drm/tegra_drm.h
index 5391780c2b05..27d0b054aed0 100644
--- a/include/uapi/drm/tegra_drm.h
+++ b/include/uapi/drm/tegra_drm.h
@@ -23,7 +23,7 @@
23#ifndef _UAPI_TEGRA_DRM_H_ 23#ifndef _UAPI_TEGRA_DRM_H_
24#define _UAPI_TEGRA_DRM_H_ 24#define _UAPI_TEGRA_DRM_H_
25 25
26#include <drm/drm.h> 26#include "drm.h"
27 27
28#define DRM_TEGRA_GEM_CREATE_TILED (1 << 0) 28#define DRM_TEGRA_GEM_CREATE_TILED (1 << 0)
29#define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1) 29#define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1)
diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index 45bc80c3714b..fa21ed185520 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -24,7 +24,7 @@
24#ifndef _VIA_DRM_H_ 24#ifndef _VIA_DRM_H_
25#define _VIA_DRM_H_ 25#define _VIA_DRM_H_
26 26
27#include <drm/drm.h> 27#include "drm.h"
28 28
29/* WARNING: These defines must be the same as what the Xserver uses. 29/* WARNING: These defines must be the same as what the Xserver uses.
30 * if you change them, you must change the defines in the Xserver. 30 * if you change them, you must change the defines in the Xserver.
@@ -33,9 +33,6 @@
33#ifndef _VIA_DEFINES_ 33#ifndef _VIA_DEFINES_
34#define _VIA_DEFINES_ 34#define _VIA_DEFINES_
35 35
36#ifndef __KERNEL__
37#include "via_drmclient.h"
38#endif
39 36
40#define VIA_NR_SAREA_CLIPRECTS 8 37#define VIA_NR_SAREA_CLIPRECTS 8
41#define VIA_NR_XVMC_PORTS 10 38#define VIA_NR_XVMC_PORTS 10
diff --git a/include/uapi/drm/virtgpu_drm.h b/include/uapi/drm/virtgpu_drm.h
index fc9e2d6e5e2f..c74f1f90cb37 100644
--- a/include/uapi/drm/virtgpu_drm.h
+++ b/include/uapi/drm/virtgpu_drm.h
@@ -24,13 +24,12 @@
24#ifndef VIRTGPU_DRM_H 24#ifndef VIRTGPU_DRM_H
25#define VIRTGPU_DRM_H 25#define VIRTGPU_DRM_H
26 26
27#include <stddef.h> 27#include "drm.h"
28#include "drm/drm.h"
29 28
30/* Please note that modifications to all structs defined here are 29/* Please note that modifications to all structs defined here are
31 * subject to backwards-compatibility constraints. 30 * subject to backwards-compatibility constraints.
32 * 31 *
33 * Do not use pointers, use uint64_t instead for 32 bit / 64 bit user/kernel 32 * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
34 * compatibility Keep fields aligned to their size 33 * compatibility Keep fields aligned to their size
35 */ 34 */
36 35
@@ -45,88 +44,88 @@
45#define DRM_VIRTGPU_GET_CAPS 0x09 44#define DRM_VIRTGPU_GET_CAPS 0x09
46 45
47struct drm_virtgpu_map { 46struct drm_virtgpu_map {
48 uint64_t offset; /* use for mmap system call */ 47 __u64 offset; /* use for mmap system call */
49 uint32_t handle; 48 __u32 handle;
50 uint32_t pad; 49 __u32 pad;
51}; 50};
52 51
53struct drm_virtgpu_execbuffer { 52struct drm_virtgpu_execbuffer {
54 uint32_t flags; /* for future use */ 53 __u32 flags; /* for future use */
55 uint32_t size; 54 __u32 size;
56 uint64_t command; /* void* */ 55 __u64 command; /* void* */
57 uint64_t bo_handles; 56 __u64 bo_handles;
58 uint32_t num_bo_handles; 57 __u32 num_bo_handles;
59 uint32_t pad; 58 __u32 pad;
60}; 59};
61 60
62#define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */ 61#define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */
63 62
64struct drm_virtgpu_getparam { 63struct drm_virtgpu_getparam {
65 uint64_t param; 64 __u64 param;
66 uint64_t value; 65 __u64 value;
67}; 66};
68 67
69/* NO_BO flags? NO resource flag? */ 68/* NO_BO flags? NO resource flag? */
70/* resource flag for y_0_top */ 69/* resource flag for y_0_top */
71struct drm_virtgpu_resource_create { 70struct drm_virtgpu_resource_create {
72 uint32_t target; 71 __u32 target;
73 uint32_t format; 72 __u32 format;
74 uint32_t bind; 73 __u32 bind;
75 uint32_t width; 74 __u32 width;
76 uint32_t height; 75 __u32 height;
77 uint32_t depth; 76 __u32 depth;
78 uint32_t array_size; 77 __u32 array_size;
79 uint32_t last_level; 78 __u32 last_level;
80 uint32_t nr_samples; 79 __u32 nr_samples;
81 uint32_t flags; 80 __u32 flags;
82 uint32_t bo_handle; /* if this is set - recreate a new resource attached to this bo ? */ 81 __u32 bo_handle; /* if this is set - recreate a new resource attached to this bo ? */
83 uint32_t res_handle; /* returned by kernel */ 82 __u32 res_handle; /* returned by kernel */
84 uint32_t size; /* validate transfer in the host */ 83 __u32 size; /* validate transfer in the host */
85 uint32_t stride; /* validate transfer in the host */ 84 __u32 stride; /* validate transfer in the host */
86}; 85};
87 86
88struct drm_virtgpu_resource_info { 87struct drm_virtgpu_resource_info {
89 uint32_t bo_handle; 88 __u32 bo_handle;
90 uint32_t res_handle; 89 __u32 res_handle;
91 uint32_t size; 90 __u32 size;
92 uint32_t stride; 91 __u32 stride;
93}; 92};
94 93
95struct drm_virtgpu_3d_box { 94struct drm_virtgpu_3d_box {
96 uint32_t x; 95 __u32 x;
97 uint32_t y; 96 __u32 y;
98 uint32_t z; 97 __u32 z;
99 uint32_t w; 98 __u32 w;
100 uint32_t h; 99 __u32 h;
101 uint32_t d; 100 __u32 d;
102}; 101};
103 102
104struct drm_virtgpu_3d_transfer_to_host { 103struct drm_virtgpu_3d_transfer_to_host {
105 uint32_t bo_handle; 104 __u32 bo_handle;
106 struct drm_virtgpu_3d_box box; 105 struct drm_virtgpu_3d_box box;
107 uint32_t level; 106 __u32 level;
108 uint32_t offset; 107 __u32 offset;
109}; 108};
110 109
111struct drm_virtgpu_3d_transfer_from_host { 110struct drm_virtgpu_3d_transfer_from_host {
112 uint32_t bo_handle; 111 __u32 bo_handle;
113 struct drm_virtgpu_3d_box box; 112 struct drm_virtgpu_3d_box box;
114 uint32_t level; 113 __u32 level;
115 uint32_t offset; 114 __u32 offset;
116}; 115};
117 116
118#define VIRTGPU_WAIT_NOWAIT 1 /* like it */ 117#define VIRTGPU_WAIT_NOWAIT 1 /* like it */
119struct drm_virtgpu_3d_wait { 118struct drm_virtgpu_3d_wait {
120 uint32_t handle; /* 0 is an invalid handle */ 119 __u32 handle; /* 0 is an invalid handle */
121 uint32_t flags; 120 __u32 flags;
122}; 121};
123 122
124struct drm_virtgpu_get_caps { 123struct drm_virtgpu_get_caps {
125 uint32_t cap_set_id; 124 __u32 cap_set_id;
126 uint32_t cap_set_ver; 125 __u32 cap_set_ver;
127 uint64_t addr; 126 __u64 addr;
128 uint32_t size; 127 __u32 size;
129 uint32_t pad; 128 __u32 pad;
130}; 129};
131 130
132#define DRM_IOCTL_VIRTGPU_MAP \ 131#define DRM_IOCTL_VIRTGPU_MAP \
diff --git a/include/uapi/drm/vmwgfx_drm.h b/include/uapi/drm/vmwgfx_drm.h
index 05b204954d16..5b68b4d10884 100644
--- a/include/uapi/drm/vmwgfx_drm.h
+++ b/include/uapi/drm/vmwgfx_drm.h
@@ -28,9 +28,7 @@
28#ifndef __VMWGFX_DRM_H__ 28#ifndef __VMWGFX_DRM_H__
29#define __VMWGFX_DRM_H__ 29#define __VMWGFX_DRM_H__
30 30
31#ifndef __KERNEL__ 31#include "drm.h"
32#include <drm/drm.h>
33#endif
34 32
35#define DRM_VMW_MAX_SURFACE_FACES 6 33#define DRM_VMW_MAX_SURFACE_FACES 6
36#define DRM_VMW_MAX_MIP_LEVELS 24 34#define DRM_VMW_MAX_MIP_LEVELS 24
@@ -111,9 +109,9 @@ enum drm_vmw_handle_type {
111 */ 109 */
112 110
113struct drm_vmw_getparam_arg { 111struct drm_vmw_getparam_arg {
114 uint64_t value; 112 __u64 value;
115 uint32_t param; 113 __u32 param;
116 uint32_t pad64; 114 __u32 pad64;
117}; 115};
118 116
119/*************************************************************************/ 117/*************************************************************************/
@@ -134,8 +132,8 @@ struct drm_vmw_getparam_arg {
134 */ 132 */
135 133
136struct drm_vmw_context_arg { 134struct drm_vmw_context_arg {
137 int32_t cid; 135 __s32 cid;
138 uint32_t pad64; 136 __u32 pad64;
139}; 137};
140 138
141/*************************************************************************/ 139/*************************************************************************/
@@ -165,7 +163,7 @@ struct drm_vmw_context_arg {
165 * @mip_levels: Number of mip levels for each face. 163 * @mip_levels: Number of mip levels for each face.
166 * An unused face should have 0 encoded. 164 * An unused face should have 0 encoded.
167 * @size_addr: Address of a user-space array of sruct drm_vmw_size 165 * @size_addr: Address of a user-space array of sruct drm_vmw_size
168 * cast to an uint64_t for 32-64 bit compatibility. 166 * cast to an __u64 for 32-64 bit compatibility.
169 * The size of the array should equal the total number of mipmap levels. 167 * The size of the array should equal the total number of mipmap levels.
170 * @shareable: Boolean whether other clients (as identified by file descriptors) 168 * @shareable: Boolean whether other clients (as identified by file descriptors)
171 * may reference this surface. 169 * may reference this surface.
@@ -177,12 +175,12 @@ struct drm_vmw_context_arg {
177 */ 175 */
178 176
179struct drm_vmw_surface_create_req { 177struct drm_vmw_surface_create_req {
180 uint32_t flags; 178 __u32 flags;
181 uint32_t format; 179 __u32 format;
182 uint32_t mip_levels[DRM_VMW_MAX_SURFACE_FACES]; 180 __u32 mip_levels[DRM_VMW_MAX_SURFACE_FACES];
183 uint64_t size_addr; 181 __u64 size_addr;
184 int32_t shareable; 182 __s32 shareable;
185 int32_t scanout; 183 __s32 scanout;
186}; 184};
187 185
188/** 186/**
@@ -197,7 +195,7 @@ struct drm_vmw_surface_create_req {
197 */ 195 */
198 196
199struct drm_vmw_surface_arg { 197struct drm_vmw_surface_arg {
200 int32_t sid; 198 __s32 sid;
201 enum drm_vmw_handle_type handle_type; 199 enum drm_vmw_handle_type handle_type;
202}; 200};
203 201
@@ -213,10 +211,10 @@ struct drm_vmw_surface_arg {
213 */ 211 */
214 212
215struct drm_vmw_size { 213struct drm_vmw_size {
216 uint32_t width; 214 __u32 width;
217 uint32_t height; 215 __u32 height;
218 uint32_t depth; 216 __u32 depth;
219 uint32_t pad64; 217 __u32 pad64;
220}; 218};
221 219
222/** 220/**
@@ -284,13 +282,13 @@ union drm_vmw_surface_reference_arg {
284/** 282/**
285 * struct drm_vmw_execbuf_arg 283 * struct drm_vmw_execbuf_arg
286 * 284 *
287 * @commands: User-space address of a command buffer cast to an uint64_t. 285 * @commands: User-space address of a command buffer cast to an __u64.
288 * @command-size: Size in bytes of the command buffer. 286 * @command-size: Size in bytes of the command buffer.
289 * @throttle-us: Sleep until software is less than @throttle_us 287 * @throttle-us: Sleep until software is less than @throttle_us
290 * microseconds ahead of hardware. The driver may round this value 288 * microseconds ahead of hardware. The driver may round this value
291 * to the nearest kernel tick. 289 * to the nearest kernel tick.
292 * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an 290 * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an
293 * uint64_t. 291 * __u64.
294 * @version: Allows expanding the execbuf ioctl parameters without breaking 292 * @version: Allows expanding the execbuf ioctl parameters without breaking
295 * backwards compatibility, since user-space will always tell the kernel 293 * backwards compatibility, since user-space will always tell the kernel
296 * which version it uses. 294 * which version it uses.
@@ -302,14 +300,14 @@ union drm_vmw_surface_reference_arg {
302#define DRM_VMW_EXECBUF_VERSION 2 300#define DRM_VMW_EXECBUF_VERSION 2
303 301
304struct drm_vmw_execbuf_arg { 302struct drm_vmw_execbuf_arg {
305 uint64_t commands; 303 __u64 commands;
306 uint32_t command_size; 304 __u32 command_size;
307 uint32_t throttle_us; 305 __u32 throttle_us;
308 uint64_t fence_rep; 306 __u64 fence_rep;
309 uint32_t version; 307 __u32 version;
310 uint32_t flags; 308 __u32 flags;
311 uint32_t context_handle; 309 __u32 context_handle;
312 uint32_t pad64; 310 __u32 pad64;
313}; 311};
314 312
315/** 313/**
@@ -338,12 +336,12 @@ struct drm_vmw_execbuf_arg {
338 */ 336 */
339 337
340struct drm_vmw_fence_rep { 338struct drm_vmw_fence_rep {
341 uint32_t handle; 339 __u32 handle;
342 uint32_t mask; 340 __u32 mask;
343 uint32_t seqno; 341 __u32 seqno;
344 uint32_t passed_seqno; 342 __u32 passed_seqno;
345 uint32_t pad64; 343 __u32 pad64;
346 int32_t error; 344 __s32 error;
347}; 345};
348 346
349/*************************************************************************/ 347/*************************************************************************/
@@ -373,8 +371,8 @@ struct drm_vmw_fence_rep {
373 */ 371 */
374 372
375struct drm_vmw_alloc_dmabuf_req { 373struct drm_vmw_alloc_dmabuf_req {
376 uint32_t size; 374 __u32 size;
377 uint32_t pad64; 375 __u32 pad64;
378}; 376};
379 377
380/** 378/**
@@ -391,11 +389,11 @@ struct drm_vmw_alloc_dmabuf_req {
391 */ 389 */
392 390
393struct drm_vmw_dmabuf_rep { 391struct drm_vmw_dmabuf_rep {
394 uint64_t map_handle; 392 __u64 map_handle;
395 uint32_t handle; 393 __u32 handle;
396 uint32_t cur_gmr_id; 394 __u32 cur_gmr_id;
397 uint32_t cur_gmr_offset; 395 __u32 cur_gmr_offset;
398 uint32_t pad64; 396 __u32 pad64;
399}; 397};
400 398
401/** 399/**
@@ -428,8 +426,8 @@ union drm_vmw_alloc_dmabuf_arg {
428 */ 426 */
429 427
430struct drm_vmw_unref_dmabuf_arg { 428struct drm_vmw_unref_dmabuf_arg {
431 uint32_t handle; 429 __u32 handle;
432 uint32_t pad64; 430 __u32 pad64;
433}; 431};
434 432
435/*************************************************************************/ 433/*************************************************************************/
@@ -452,10 +450,10 @@ struct drm_vmw_unref_dmabuf_arg {
452 */ 450 */
453 451
454struct drm_vmw_rect { 452struct drm_vmw_rect {
455 int32_t x; 453 __s32 x;
456 int32_t y; 454 __s32 y;
457 uint32_t w; 455 __u32 w;
458 uint32_t h; 456 __u32 h;
459}; 457};
460 458
461/** 459/**
@@ -477,21 +475,21 @@ struct drm_vmw_rect {
477 */ 475 */
478 476
479struct drm_vmw_control_stream_arg { 477struct drm_vmw_control_stream_arg {
480 uint32_t stream_id; 478 __u32 stream_id;
481 uint32_t enabled; 479 __u32 enabled;
482 480
483 uint32_t flags; 481 __u32 flags;
484 uint32_t color_key; 482 __u32 color_key;
485 483
486 uint32_t handle; 484 __u32 handle;
487 uint32_t offset; 485 __u32 offset;
488 int32_t format; 486 __s32 format;
489 uint32_t size; 487 __u32 size;
490 uint32_t width; 488 __u32 width;
491 uint32_t height; 489 __u32 height;
492 uint32_t pitch[3]; 490 __u32 pitch[3];
493 491
494 uint32_t pad64; 492 __u32 pad64;
495 struct drm_vmw_rect src; 493 struct drm_vmw_rect src;
496 struct drm_vmw_rect dst; 494 struct drm_vmw_rect dst;
497}; 495};
@@ -519,12 +517,12 @@ struct drm_vmw_control_stream_arg {
519 */ 517 */
520 518
521struct drm_vmw_cursor_bypass_arg { 519struct drm_vmw_cursor_bypass_arg {
522 uint32_t flags; 520 __u32 flags;
523 uint32_t crtc_id; 521 __u32 crtc_id;
524 int32_t xpos; 522 __s32 xpos;
525 int32_t ypos; 523 __s32 ypos;
526 int32_t xhot; 524 __s32 xhot;
527 int32_t yhot; 525 __s32 yhot;
528}; 526};
529 527
530/*************************************************************************/ 528/*************************************************************************/
@@ -542,8 +540,8 @@ struct drm_vmw_cursor_bypass_arg {
542 */ 540 */
543 541
544struct drm_vmw_stream_arg { 542struct drm_vmw_stream_arg {
545 uint32_t stream_id; 543 __u32 stream_id;
546 uint32_t pad64; 544 __u32 pad64;
547}; 545};
548 546
549/*************************************************************************/ 547/*************************************************************************/
@@ -565,7 +563,7 @@ struct drm_vmw_stream_arg {
565/** 563/**
566 * struct drm_vmw_get_3d_cap_arg 564 * struct drm_vmw_get_3d_cap_arg
567 * 565 *
568 * @buffer: Pointer to a buffer for capability data, cast to an uint64_t 566 * @buffer: Pointer to a buffer for capability data, cast to an __u64
569 * @size: Max size to copy 567 * @size: Max size to copy
570 * 568 *
571 * Input argument to the DRM_VMW_GET_3D_CAP_IOCTL 569 * Input argument to the DRM_VMW_GET_3D_CAP_IOCTL
@@ -573,9 +571,9 @@ struct drm_vmw_stream_arg {
573 */ 571 */
574 572
575struct drm_vmw_get_3d_cap_arg { 573struct drm_vmw_get_3d_cap_arg {
576 uint64_t buffer; 574 __u64 buffer;
577 uint32_t max_size; 575 __u32 max_size;
578 uint32_t pad64; 576 __u32 pad64;
579}; 577};
580 578
581/*************************************************************************/ 579/*************************************************************************/
@@ -624,14 +622,14 @@ struct drm_vmw_get_3d_cap_arg {
624 */ 622 */
625 623
626struct drm_vmw_fence_wait_arg { 624struct drm_vmw_fence_wait_arg {
627 uint32_t handle; 625 __u32 handle;
628 int32_t cookie_valid; 626 __s32 cookie_valid;
629 uint64_t kernel_cookie; 627 __u64 kernel_cookie;
630 uint64_t timeout_us; 628 __u64 timeout_us;
631 int32_t lazy; 629 __s32 lazy;
632 int32_t flags; 630 __s32 flags;
633 int32_t wait_options; 631 __s32 wait_options;
634 int32_t pad64; 632 __s32 pad64;
635}; 633};
636 634
637/*************************************************************************/ 635/*************************************************************************/
@@ -655,12 +653,12 @@ struct drm_vmw_fence_wait_arg {
655 */ 653 */
656 654
657struct drm_vmw_fence_signaled_arg { 655struct drm_vmw_fence_signaled_arg {
658 uint32_t handle; 656 __u32 handle;
659 uint32_t flags; 657 __u32 flags;
660 int32_t signaled; 658 __s32 signaled;
661 uint32_t passed_seqno; 659 __u32 passed_seqno;
662 uint32_t signaled_flags; 660 __u32 signaled_flags;
663 uint32_t pad64; 661 __u32 pad64;
664}; 662};
665 663
666/*************************************************************************/ 664/*************************************************************************/
@@ -681,8 +679,8 @@ struct drm_vmw_fence_signaled_arg {
681 */ 679 */
682 680
683struct drm_vmw_fence_arg { 681struct drm_vmw_fence_arg {
684 uint32_t handle; 682 __u32 handle;
685 uint32_t pad64; 683 __u32 pad64;
686}; 684};
687 685
688 686
@@ -703,9 +701,9 @@ struct drm_vmw_fence_arg {
703 701
704struct drm_vmw_event_fence { 702struct drm_vmw_event_fence {
705 struct drm_event base; 703 struct drm_event base;
706 uint64_t user_data; 704 __u64 user_data;
707 uint32_t tv_sec; 705 __u32 tv_sec;
708 uint32_t tv_usec; 706 __u32 tv_usec;
709}; 707};
710 708
711/* 709/*
@@ -717,17 +715,17 @@ struct drm_vmw_event_fence {
717/** 715/**
718 * struct drm_vmw_fence_event_arg 716 * struct drm_vmw_fence_event_arg
719 * 717 *
720 * @fence_rep: Pointer to fence_rep structure cast to uint64_t or 0 if 718 * @fence_rep: Pointer to fence_rep structure cast to __u64 or 0 if
721 * the fence is not supposed to be referenced by user-space. 719 * the fence is not supposed to be referenced by user-space.
722 * @user_info: Info to be delivered with the event. 720 * @user_info: Info to be delivered with the event.
723 * @handle: Attach the event to this fence only. 721 * @handle: Attach the event to this fence only.
724 * @flags: A set of flags as defined above. 722 * @flags: A set of flags as defined above.
725 */ 723 */
726struct drm_vmw_fence_event_arg { 724struct drm_vmw_fence_event_arg {
727 uint64_t fence_rep; 725 __u64 fence_rep;
728 uint64_t user_data; 726 __u64 user_data;
729 uint32_t handle; 727 __u32 handle;
730 uint32_t flags; 728 __u32 flags;
731}; 729};
732 730
733 731
@@ -747,7 +745,7 @@ struct drm_vmw_fence_event_arg {
747 * @sid: Surface id to present from. 745 * @sid: Surface id to present from.
748 * @dest_x: X placement coordinate for surface. 746 * @dest_x: X placement coordinate for surface.
749 * @dest_y: Y placement coordinate for surface. 747 * @dest_y: Y placement coordinate for surface.
750 * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t. 748 * @clips_ptr: Pointer to an array of clip rects cast to an __u64.
751 * @num_clips: Number of cliprects given relative to the framebuffer origin, 749 * @num_clips: Number of cliprects given relative to the framebuffer origin,
752 * in the same coordinate space as the frame buffer. 750 * in the same coordinate space as the frame buffer.
753 * @pad64: Unused 64-bit padding. 751 * @pad64: Unused 64-bit padding.
@@ -756,13 +754,13 @@ struct drm_vmw_fence_event_arg {
756 */ 754 */
757 755
758struct drm_vmw_present_arg { 756struct drm_vmw_present_arg {
759 uint32_t fb_id; 757 __u32 fb_id;
760 uint32_t sid; 758 __u32 sid;
761 int32_t dest_x; 759 __s32 dest_x;
762 int32_t dest_y; 760 __s32 dest_y;
763 uint64_t clips_ptr; 761 __u64 clips_ptr;
764 uint32_t num_clips; 762 __u32 num_clips;
765 uint32_t pad64; 763 __u32 pad64;
766}; 764};
767 765
768 766
@@ -780,16 +778,16 @@ struct drm_vmw_present_arg {
780 * struct drm_vmw_present_arg 778 * struct drm_vmw_present_arg
781 * @fb_id: fb_id to present / read back from. 779 * @fb_id: fb_id to present / read back from.
782 * @num_clips: Number of cliprects. 780 * @num_clips: Number of cliprects.
783 * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t. 781 * @clips_ptr: Pointer to an array of clip rects cast to an __u64.
784 * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an uint64_t. 782 * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an __u64.
785 * If this member is NULL, then the ioctl should not return a fence. 783 * If this member is NULL, then the ioctl should not return a fence.
786 */ 784 */
787 785
788struct drm_vmw_present_readback_arg { 786struct drm_vmw_present_readback_arg {
789 uint32_t fb_id; 787 __u32 fb_id;
790 uint32_t num_clips; 788 __u32 num_clips;
791 uint64_t clips_ptr; 789 __u64 clips_ptr;
792 uint64_t fence_rep; 790 __u64 fence_rep;
793}; 791};
794 792
795/*************************************************************************/ 793/*************************************************************************/
@@ -805,14 +803,14 @@ struct drm_vmw_present_readback_arg {
805 * struct drm_vmw_update_layout_arg 803 * struct drm_vmw_update_layout_arg
806 * 804 *
807 * @num_outputs: number of active connectors 805 * @num_outputs: number of active connectors
808 * @rects: pointer to array of drm_vmw_rect cast to an uint64_t 806 * @rects: pointer to array of drm_vmw_rect cast to an __u64
809 * 807 *
810 * Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl. 808 * Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl.
811 */ 809 */
812struct drm_vmw_update_layout_arg { 810struct drm_vmw_update_layout_arg {
813 uint32_t num_outputs; 811 __u32 num_outputs;
814 uint32_t pad64; 812 __u32 pad64;
815 uint64_t rects; 813 __u64 rects;
816}; 814};
817 815
818 816
@@ -849,10 +847,10 @@ enum drm_vmw_shader_type {
849 */ 847 */
850struct drm_vmw_shader_create_arg { 848struct drm_vmw_shader_create_arg {
851 enum drm_vmw_shader_type shader_type; 849 enum drm_vmw_shader_type shader_type;
852 uint32_t size; 850 __u32 size;
853 uint32_t buffer_handle; 851 __u32 buffer_handle;
854 uint32_t shader_handle; 852 __u32 shader_handle;
855 uint64_t offset; 853 __u64 offset;
856}; 854};
857 855
858/*************************************************************************/ 856/*************************************************************************/
@@ -871,8 +869,8 @@ struct drm_vmw_shader_create_arg {
871 * Input argument to the DRM_VMW_UNREF_SHADER ioctl. 869 * Input argument to the DRM_VMW_UNREF_SHADER ioctl.
872 */ 870 */
873struct drm_vmw_shader_arg { 871struct drm_vmw_shader_arg {
874 uint32_t handle; 872 __u32 handle;
875 uint32_t pad64; 873 __u32 pad64;
876}; 874};
877 875
878/*************************************************************************/ 876/*************************************************************************/
@@ -918,14 +916,14 @@ enum drm_vmw_surface_flags {
918 * Part of output argument for the DRM_VMW_GB_SURFACE_REF Ioctl. 916 * Part of output argument for the DRM_VMW_GB_SURFACE_REF Ioctl.
919 */ 917 */
920struct drm_vmw_gb_surface_create_req { 918struct drm_vmw_gb_surface_create_req {
921 uint32_t svga3d_flags; 919 __u32 svga3d_flags;
922 uint32_t format; 920 __u32 format;
923 uint32_t mip_levels; 921 __u32 mip_levels;
924 enum drm_vmw_surface_flags drm_surface_flags; 922 enum drm_vmw_surface_flags drm_surface_flags;
925 uint32_t multisample_count; 923 __u32 multisample_count;
926 uint32_t autogen_filter; 924 __u32 autogen_filter;
927 uint32_t buffer_handle; 925 __u32 buffer_handle;
928 uint32_t array_size; 926 __u32 array_size;
929 struct drm_vmw_size base_size; 927 struct drm_vmw_size base_size;
930}; 928};
931 929
@@ -944,11 +942,11 @@ struct drm_vmw_gb_surface_create_req {
944 * Output argument for the DRM_VMW_GB_SURFACE_CREATE ioctl. 942 * Output argument for the DRM_VMW_GB_SURFACE_CREATE ioctl.
945 */ 943 */
946struct drm_vmw_gb_surface_create_rep { 944struct drm_vmw_gb_surface_create_rep {
947 uint32_t handle; 945 __u32 handle;
948 uint32_t backup_size; 946 __u32 backup_size;
949 uint32_t buffer_handle; 947 __u32 buffer_handle;
950 uint32_t buffer_size; 948 __u32 buffer_size;
951 uint64_t buffer_map_handle; 949 __u64 buffer_map_handle;
952}; 950};
953 951
954/** 952/**
@@ -1061,8 +1059,8 @@ enum drm_vmw_synccpu_op {
1061struct drm_vmw_synccpu_arg { 1059struct drm_vmw_synccpu_arg {
1062 enum drm_vmw_synccpu_op op; 1060 enum drm_vmw_synccpu_op op;
1063 enum drm_vmw_synccpu_flags flags; 1061 enum drm_vmw_synccpu_flags flags;
1064 uint32_t handle; 1062 __u32 handle;
1065 uint32_t pad64; 1063 __u32 pad64;
1066}; 1064};
1067 1065
1068/*************************************************************************/ 1066/*************************************************************************/
diff --git a/include/uapi/linux/agpgart.h b/include/uapi/linux/agpgart.h
index 4e828cf487bc..f5251045181a 100644
--- a/include/uapi/linux/agpgart.h
+++ b/include/uapi/linux/agpgart.h
@@ -52,6 +52,7 @@
52 52
53#ifndef __KERNEL__ 53#ifndef __KERNEL__
54#include <linux/types.h> 54#include <linux/types.h>
55#include <stdlib.h>
55 56
56struct agp_version { 57struct agp_version {
57 __u16 major; 58 __u16 major;
diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux/virtio_gpu.h
index 7a63faa9065c..4b04ead26cd9 100644
--- a/include/uapi/linux/virtio_gpu.h
+++ b/include/uapi/linux/virtio_gpu.h
@@ -287,7 +287,7 @@ struct virtio_gpu_get_capset {
287/* VIRTIO_GPU_RESP_OK_CAPSET */ 287/* VIRTIO_GPU_RESP_OK_CAPSET */
288struct virtio_gpu_resp_capset { 288struct virtio_gpu_resp_capset {
289 struct virtio_gpu_ctrl_hdr hdr; 289 struct virtio_gpu_ctrl_hdr hdr;
290 uint8_t capset_data[]; 290 __u8 capset_data[];
291}; 291};
292 292
293#define VIRTIO_GPU_EVENT_DISPLAY (1 << 0) 293#define VIRTIO_GPU_EVENT_DISPLAY (1 << 0)