Skip to contentSkip to conversation

Fix mmap handle

PATCH New Robert Noland 1 participant 1 message Mar 15, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix mmap handle

From 340b563375e001e87a504973581ab48d399ff64b Mon Sep 17 00:00:00 2001
From: Robert Noland <[email protected]>
Date: Sun, 15 Mar 2009 13:52:58 -0500
Subject: [PATCH] libdrm_nouveau: The handle that is passed to mmap needs to be drm_handle_t

drm_handle_t is defined to be a u32 on linux and a u64 on everything else. This addresses an issue on FreeBSD amd64 where the map offsets may be greater than 32bits. When the handle is cast to 32bit, mmap cannot match the requested map and causes X to crash.

This should be a NOOP on linux since drm_handle_t is always 32bit.

---
 libdrm/nouveau/nouveau_private.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
libdrm/nouveau/nouveau_private.h +1 -1
index 9dc1b44..32a9052 100644
@@ -173,7 +173,7 @@ struct nouveau_bo_priv {
 
 	/* Kernel object */
 	uint32_t global_handle;
-	unsigned handle;
+	drm_handle_t handle;
 	void *map;
 
 	/* Last known information from kernel on buffer status */
Signature · 6 lines
1.6.1.3


-- 
Robert Noland <[email protected]>
2 Hip Networks

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau