[Intel-gfx] [PATCH] intel: Make sure munmap is called when we have a virtual address

Keith Packard keithp at keithp.com
Tue Dec 16 00:08:14 CET 2008


bo_gem->mapped says whether user space knows about our mapping, not whether
we've created one. bo_gem->virtual tracks whether we have made a mapping, so
use that to determine when to call munmap at bo_free time.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 libdrm/intel/intel_bufmgr_gem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libdrm/intel/intel_bufmgr_gem.c b/libdrm/intel/intel_bufmgr_gem.c
index 9f6ef68..9ba377b 100644
--- a/libdrm/intel/intel_bufmgr_gem.c
+++ b/libdrm/intel/intel_bufmgr_gem.c
@@ -480,7 +480,7 @@ drm_intel_gem_bo_free(drm_intel_bo *bo)
     struct drm_gem_close close;
     int ret;
 
-    if (bo_gem->mapped)
+    if (bo_gem->virtual)
 	munmap (bo_gem->virtual, bo_gem->bo.size);
 
     /* Close this object */
-- 
1.5.6.5




More information about the Intel-gfx mailing list