aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2009-12-02 12:13:48 -0500
committerDave Airlie <airlied@redhat.com>2009-12-03 17:59:28 -0500
commit1a95916f5465ad6c91398f17924949db7e0b5c36 (patch)
treee9293ebb277e8cb39dcd57d9c1c07c68a0c8d803 /include/drm
parent862302ffe422378a5213f558fc5cdf62c37050a9 (diff)
drm: Add compatibility #ifdefs for *BSD
This let's use use the linux drm headers as the canonical source for libdrm on all platforms. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm.h29
-rw-r--r--include/drm/drmP.h3
-rw-r--r--include/drm/drm_mode.h3
-rw-r--r--include/drm/i915_drm.h4
-rw-r--r--include/drm/mga_drm.h2
-rw-r--r--include/drm/radeon_drm.h2
-rw-r--r--include/drm/via_drm.h2
7 files changed, 27 insertions, 18 deletions
diff --git a/include/drm/drm.h b/include/drm/drm.h
index 3919a4f792ae..0114ac94f969 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -36,17 +36,27 @@
36#ifndef _DRM_H_ 36#ifndef _DRM_H_
37#define _DRM_H_ 37#define _DRM_H_
38 38
39#if defined(__linux__)
40
39#include <linux/types.h> 41#include <linux/types.h>
40#include <asm/ioctl.h> /* For _IO* macros */ 42#include <asm/ioctl.h>
41#define DRM_IOCTL_NR(n) _IOC_NR(n) 43typedef unsigned int drm_handle_t;
42#define DRM_IOC_VOID _IOC_NONE 44
43#define DRM_IOC_READ _IOC_READ 45#else /* One of the BSDs */
44#define DRM_IOC_WRITE _IOC_WRITE
45#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE
46#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
47 46
48#define DRM_MAJOR 226 47#include <sys/ioccom.h>
49#define DRM_MAX_MINOR 15 48#include <sys/types.h>
49typedef int8_t __s8;
50typedef uint8_t __u8;
51typedef int16_t __s16;
52typedef uint16_t __u16;
53typedef int32_t __s32;
54typedef uint32_t __u32;
55typedef int64_t __s64;
56typedef uint64_t __u64;
57typedef unsigned long drm_handle_t;
58
59#endif
50 60
51#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ 61#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */
52#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ 62#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */
@@ -59,7 +69,6 @@
59#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) 69#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT)
60#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) 70#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT))
61 71
62typedef unsigned int drm_handle_t;
63typedef unsigned int drm_context_t; 72typedef unsigned int drm_context_t;
64typedef unsigned int drm_drawable_t; 73typedef unsigned int drm_drawable_t;
65typedef unsigned int drm_magic_t; 74typedef unsigned int drm_magic_t;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 770772c014aa..db56a6add5de 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -289,6 +289,9 @@ typedef int drm_ioctl_t(struct drm_device *dev, void *data,
289typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, 289typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,
290 unsigned long arg); 290 unsigned long arg);
291 291
292#define DRM_IOCTL_NR(n) _IOC_NR(n)
293#define DRM_MAJOR 226
294
292#define DRM_AUTH 0x1 295#define DRM_AUTH 0x1
293#define DRM_MASTER 0x2 296#define DRM_MASTER 0x2
294#define DRM_ROOT_ONLY 0x4 297#define DRM_ROOT_ONLY 0x4
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
index 68ddc6175ae7..09ca6adf4dd5 100644
--- a/include/drm/drm_mode.h
+++ b/include/drm/drm_mode.h
@@ -27,9 +27,6 @@
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/kernel.h>
31#include <linux/types.h>
32
33#define DRM_DISPLAY_INFO_LEN 32 30#define DRM_DISPLAY_INFO_LEN 32
34#define DRM_CONNECTOR_NAME_LEN 32 31#define DRM_CONNECTOR_NAME_LEN 32
35#define DRM_DISPLAY_MODE_LEN 32 32#define DRM_DISPLAY_MODE_LEN 32
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 7e0cb1da92e6..a04c3ab1d726 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -27,11 +27,11 @@
27#ifndef _I915_DRM_H_ 27#ifndef _I915_DRM_H_
28#define _I915_DRM_H_ 28#define _I915_DRM_H_
29 29
30#include "drm.h"
31
30/* Please note that modifications to all structs defined here are 32/* Please note that modifications to all structs defined here are
31 * subject to backwards-compatibility constraints. 33 * subject to backwards-compatibility constraints.
32 */ 34 */
33#include <linux/types.h>
34#include "drm.h"
35 35
36/* Each region is a minimum of 16k, and there are at most 255 of them. 36/* Each region is a minimum of 16k, and there are at most 255 of them.
37 */ 37 */
diff --git a/include/drm/mga_drm.h b/include/drm/mga_drm.h
index 325fd6fb4a42..3ffbc4798afa 100644
--- a/include/drm/mga_drm.h
+++ b/include/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 <linux/types.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/drm/radeon_drm.h b/include/drm/radeon_drm.h
index 3b9932ab1756..39537f3cf98a 100644
--- a/include/drm/radeon_drm.h
+++ b/include/drm/radeon_drm.h
@@ -33,7 +33,7 @@
33#ifndef __RADEON_DRM_H__ 33#ifndef __RADEON_DRM_H__
34#define __RADEON_DRM_H__ 34#define __RADEON_DRM_H__
35 35
36#include <linux/types.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 (radeon_sarea.h) 39 * defines in the X server file (radeon_sarea.h)
diff --git a/include/drm/via_drm.h b/include/drm/via_drm.h
index 170786e5c2ff..fd11a5bd892d 100644
--- a/include/drm/via_drm.h
+++ b/include/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 <linux/types.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.