diff options
author | Chia-I Wu <[email protected]> | 2011-08-21 20:37:47 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2011-08-24 10:57:12 +0800 |
commit | 1284d5b25507a56634519ac385cbc00a00b94417 (patch) | |
tree | 36f93b6d711f0aa9d6ee0f11fd253e60eaa55557 /src/gallium/winsys | |
parent | 70b1837dfb1b282ad9efcaeec4f9c8da5f9a74d8 (diff) |
winsys/svga: use os_mmap() for memory mapping
os_mmap() guarantees large file support across OSes.
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/svga/drm/vmw_screen_ioctl.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c index d92ba389d35..afdbd44458d 100644 --- a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c +++ b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c @@ -42,7 +42,8 @@ #include "xf86drm.h" #include "vmwgfx_drm.h" -#include <sys/mman.h> +#include "os/os_mman.h" + #include <errno.h> #include <unistd.h> @@ -94,7 +95,7 @@ static void vmw_ioctl_fifo_unmap(struct vmw_winsys_screen *vws, void *mapping) { VMW_FUNC; - (void)munmap(mapping, getpagesize()); + (void)os_munmap(mapping, getpagesize()); } @@ -106,7 +107,7 @@ vmw_ioctl_fifo_map(struct vmw_winsys_screen *vws, VMW_FUNC; - map = mmap(NULL, getpagesize(), PROT_READ, MAP_SHARED, + map = os_mmap(NULL, getpagesize(), PROT_READ, MAP_SHARED, vws->ioctl.drm_fd, fifo_offset); if (map == MAP_FAILED) { @@ -362,7 +363,7 @@ vmw_ioctl_region_destroy(struct vmw_region *region) region->ptr.gmrId, region->ptr.offset); if (region->data) { - munmap(region->data, region->size); + os_munmap(region->data, region->size); region->data = NULL; } @@ -388,7 +389,7 @@ vmw_ioctl_region_map(struct vmw_region *region) region->ptr.gmrId, region->ptr.offset); if (region->data == NULL) { - map = mmap(NULL, region->size, PROT_READ | PROT_WRITE, MAP_SHARED, + map = os_mmap(NULL, region->size, PROT_READ | PROT_WRITE, MAP_SHARED, region->drm_fd, region->map_handle); if (map == MAP_FAILED) { debug_printf("%s: Map failed.\n", __FUNCTION__); |