Add freeglut3 and libdrm
authorrmh <rmh@thorin.(none)>
Mon, 19 Jan 2009 23:17:14 +0000 (00:17 +0100)
committerrmh <rmh@thorin.(none)>
Mon, 19 Jan 2009 23:17:14 +0000 (00:17 +0100)
freeglut3.diff [new file with mode: 0644]
libdrm.diff [new file with mode: 0644]

diff --git a/freeglut3.diff b/freeglut3.diff
new file mode 100644 (file)
index 0000000..7693652
--- /dev/null
@@ -0,0 +1,10 @@
+--- src/freeglut_joystick.c~   2009-01-19 23:52:08.000000000 +0100
++++ src/freeglut_joystick.c    2009-01-19 23:58:36.740364942 +0100
+@@ -1038,6 +1038,7 @@
+ static void fghJoystickOpen( SFG_Joystick* joy )
+ {
+     int i;
++    (void) i;
+ #if TARGET_HOST_MACINTOSH
+     OSStatus err;
+ #endif
diff --git a/libdrm.diff b/libdrm.diff
new file mode 100644 (file)
index 0000000..c40a3ca
--- /dev/null
@@ -0,0 +1,74 @@
+
+Based on patches from:
+
+  http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg35327.html
+
+diff -ur libdrm-2.3.1/libdrm/xf86drm.c libdrm-2.3.1.new/libdrm/xf86drm.c
+--- libdrm-2.3.1/libdrm/xf86drm.c      2008-07-01 09:51:40.000000000 +0200
++++ libdrm-2.3.1.new/libdrm/xf86drm.c  2009-01-19 22:00:30.245462504 +0100
+@@ -894,7 +894,11 @@
+ {
+     drm_map_t map;
++#if defined(__sun) || defined(__OpenSolaris_kernel__)
++    map.handle = handle;
++#else
+     map.handle = (void *)handle;
++#endif
+     if(ioctl(fd, DRM_IOCTL_RM_MAP, &map))
+       return -errno;
+@@ -1132,6 +1136,9 @@
+     bufs.count = 0;
+     bufs.list  = NULL;
+     bufs.virtual = NULL;
++#if defined(__sun) || defined(__OpenSolaris_kernel__)
++    bufs.fd = fd;
++#endif
+     if (ioctl(fd, DRM_IOCTL_MAP_BUFS, &bufs))
+       return NULL;
+diff -ur libdrm-2.3.1/shared-core/drm.h libdrm-2.3.1.new/shared-core/drm.h
+--- libdrm-2.3.1/shared-core/drm.h     2008-07-01 09:55:17.000000000 +0200
++++ libdrm-2.3.1.new/shared-core/drm.h 2009-01-19 21:59:20.233644179 +0100
+@@ -79,7 +79,7 @@
+ #define DRM_IOC_WRITE         _IOC_WRITE
+ #define DRM_IOC_READWRITE     _IOC_READ|_IOC_WRITE
+ #define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
+-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__OpenSolaris_kernel__)
+ #include <sys/ioccom.h>
+ #define DRM_IOCTL_NR(n)               ((n) & 0xff)
+ #define DRM_IOC_VOID          IOC_VOID
+@@ -112,7 +112,7 @@
+ typedef unsigned int drm_handle_t;
+ #else
+ #include <sys/types.h>
+-typedef unsigned long drm_handle_t;   /**< To mapped regions */
++typedef unsigned long long drm_handle_t;      /**< To mapped regions */
+ #endif
+ typedef unsigned int drm_context_t;   /**< GLXContext handle */
+ typedef unsigned int drm_drawable_t;
+@@ -264,12 +264,11 @@
+  * \sa drmAddMap().
+  */
+ struct drm_map {
+-      unsigned long offset;    /**< Requested physical address (0 for SAREA)*/
++      unsigned long long offset;       /**< Requested physical address (0 for SAREA)*/
++      unsigned long long handle;
+       unsigned long size;      /**< Requested physical size (bytes) */
+       enum drm_map_type type;  /**< Type of memory to map */
+       enum drm_map_flags flags;        /**< Flags */
+-      void *handle;            /**< User-space: "Handle" to pass to mmap() */
+-                               /**< Kernel-space: kernel-virtual address */
+       int mtrr;                /**< MTRR slot used */
+       /*   Private data */
+ };
+@@ -433,6 +432,7 @@
+       void __user *virtual;           /**< Mmap'd area in user-virtual */
+ #endif
+       struct drm_buf_pub __user *list;        /**< Buffer information */
++      int fd;
+ };
+ /**