diff mbox

drm_handle_t type

Message ID 1270778721.20809.31.camel@ibis.bells (mailing list archive)
State New, archived
Headers show

Commit Message

Matthew W. S. Bell April 9, 2010, 2:05 a.m. UTC
None
diff mbox

Patch

diff --git a/include/drm/drm.h b/include/drm/drm.h
index 4822159..e74d6d6 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -216,6 +216,8 @@  struct drm_map {
 	enum drm_map_flags flags;	 /**< Flags */
 	void *handle;		 /**< User-space: "Handle" to pass to mmap() */
 				 /**< Kernel-space: kernel-virtual address */
+				 /**  The value herein shall be the size of */
+				 /**  drm_handle_t despite the size of void *. */
 	int mtrr;		 /**< MTRR slot used */
 	/*   Private data */
 };
diff --git a/xf86drm.c b/xf86drm.c
index 220aaa1..012408a 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -959,7 +959,7 @@  int drmAddMap(int fd, drm_handle_t offset, drmSize size, drmMapType type,
     if (drmIoctl(fd, DRM_IOCTL_ADD_MAP, &map))
 	return -errno;
     if (handle)
-	*handle = (drm_handle_t)map.handle;
+	*handle = (uintptr_t)map.handle;
     return 0;
 }
 
@@ -2138,7 +2138,7 @@  int drmGetMap(int fd, int idx, drm_handle_t *offset, drmSize *size,
     *size   = map.size;
     *type   = map.type;
     *flags  = map.flags;
-    *handle = (unsigned long)map.handle;
+    *handle = (uintptr_t)map.handle;
     *mtrr   = map.mtrr;
     return 0;
 }