Mesa (master): i965: Add a comment about not needing VALGRIND_MALLOCLIKE_BLOCK.

Kenneth Graunke kwg at kemper.freedesktop.org
Fri Jun 30 22:55:23 UTC 2017


Module: Mesa
Branch: master
Commit: 58d81d9dc21b8fe719959d97890eb4fb2e390840
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=58d81d9dc21b8fe719959d97890eb4fb2e390840

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Jun 30 14:00:01 2017 -0700

i965: Add a comment about not needing VALGRIND_MALLOCLIKE_BLOCK.

At first glance this seems missing, since we handle it manually for CPU
and WC maps.  Although a bit inconsistent, it's actually not necessary.

Thanks to Chris Wilson for explaining this to me.

Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/mesa/drivers/dri/i965/brw_bufmgr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c b/src/mesa/drivers/dri/i965/brw_bufmgr.c
index 6cb91f9a23..abd0722ba6 100644
--- a/src/mesa/drivers/dri/i965/brw_bufmgr.c
+++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c
@@ -736,7 +736,9 @@ brw_bo_map_gtt(struct brw_context *brw, struct brw_bo *bo, unsigned flags)
          return NULL;
       }
 
-      /* and mmap it */
+      /* and mmap it.  We don't need to use VALGRIND_MALLOCLIKE_BLOCK
+       * because Valgrind will already intercept this mmap call.
+       */
       bo->map_gtt = drm_mmap(0, bo->size, PROT_READ | PROT_WRITE,
                              MAP_SHARED, bufmgr->fd, mmap_arg.offset);
       if (bo->map_gtt == MAP_FAILED) {




More information about the mesa-commit mailing list