From 2186cc5946085c4f6cf5c1191abf7518cbf5b1bb Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 17 Jun 2008 15:47:23 -0700 Subject: [PATCH:libdrm 1/2] Make data passed to ioctl's on Solaris match the Solaris kernel DRI implementation --- include/drm/drm.h | 13 +++++++++++++ xf86drm.c | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/include/drm/drm.h b/include/drm/drm.h index 229a29f..ec96620 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h @@ -210,12 +210,22 @@ struct drm_ctx_priv_map { * \sa drmAddMap(). */ struct drm_map { +#ifdef __sun + unsigned long long offset; + /**< Requested physical address (0 for SAREA)*/ + unsigned long long handle; + /**< User-space: "Handle" to pass to mmap() */ + /**< Kernel-space: kernel-virtual address */ +#else unsigned long offset; /**< Requested physical address (0 for SAREA)*/ +#endif unsigned long size; /**< Requested physical size (bytes) */ enum drm_map_type type; /**< Type of memory to map */ enum drm_map_flags flags; /**< Flags */ +#ifndef __sun void *handle; /**< User-space: "Handle" to pass to mmap() */ /**< Kernel-space: kernel-virtual address */ +#endif int mtrr; /**< MTRR slot used */ /* Private data */ }; @@ -379,6 +389,9 @@ struct drm_buf_map { void *virtual; /**< Mmap'd area in user-virtual */ #endif struct drm_buf_pub *list; /**< Buffer information */ +#ifdef __sun + int fd; +#endif }; /** diff --git a/xf86drm.c b/xf86drm.c index e73cddd..fc2c956 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -1096,7 +1096,11 @@ int drmRmMap(int fd, drm_handle_t handle) drm_map_t map; memclear(map); +#ifdef __sun + map.handle = handle; +#else map.handle = (void *)(uintptr_t)handle; +#endif if(drmIoctl(fd, DRM_IOCTL_RM_MAP, &map)) return -errno; @@ -1330,6 +1334,9 @@ drmBufMapPtr drmMapBufs(int fd) int i; memclear(bufs); +#ifdef __sun + bufs.fd = fd; +#endif if (drmIoctl(fd, DRM_IOCTL_MAP_BUFS, &bufs)) return NULL; -- 1.7.9.2