Mesa (master): i965: Remove brw_bo_map_unsynchronized()

Matt Turner mattst88 at kemper.freedesktop.org
Tue Jun 6 18:48:00 UTC 2017


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

Author: Matt Turner <mattst88 at gmail.com>
Date:   Wed May 31 21:18:38 2017 -0700

i965: Remove brw_bo_map_unsynchronized()

Call brw_bo_map() directly.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_bufmgr.c        | 20 --------------------
 src/mesa/drivers/dri/i965/brw_bufmgr.h        |  1 -
 src/mesa/drivers/dri/i965/brw_program_cache.c |  4 ++--
 3 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c b/src/mesa/drivers/dri/i965/brw_bufmgr.c
index 15610dba5b..9475d2b30a 100644
--- a/src/mesa/drivers/dri/i965/brw_bufmgr.c
+++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c
@@ -755,26 +755,6 @@ brw_bo_map_gtt(struct brw_context *brw, struct brw_bo *bo, unsigned flags)
    return bo->map_gtt;
 }
 
-/**
- * Performs a mapping of the buffer object like the normal GTT
- * mapping, but avoids waiting for the GPU to be done reading from or
- * rendering to the buffer.
- *
- * This is used in the implementation of GL_ARB_map_buffer_range: The
- * user asks to create a buffer, then does a mapping, fills some
- * space, runs a drawing command, then asks to map it again without
- * synchronizing because it guarantees that it won't write over the
- * data that the GPU is busy using (or, more specifically, that if it
- * does write over the data, it acknowledges that rendering is
- * undefined).
- */
-
-void *
-brw_bo_map_unsynchronized(struct brw_context *brw, struct brw_bo *bo)
-{
-   return brw_bo_map_gtt(brw, bo, MAP_READ | MAP_WRITE | MAP_ASYNC);
-}
-
 static bool
 can_map_cpu(struct brw_bo *bo, unsigned flags)
 {
diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.h b/src/mesa/drivers/dri/i965/brw_bufmgr.h
index 099afcf4c5..a11599ff79 100644
--- a/src/mesa/drivers/dri/i965/brw_bufmgr.h
+++ b/src/mesa/drivers/dri/i965/brw_bufmgr.h
@@ -262,7 +262,6 @@ struct brw_bo *brw_bo_gem_create_from_name(struct brw_bufmgr *bufmgr,
                                            const char *name,
                                            unsigned int handle);
 void brw_bufmgr_enable_reuse(struct brw_bufmgr *bufmgr);
-MUST_CHECK void *brw_bo_map_unsynchronized(struct brw_context *brw, struct brw_bo *bo);
 
 int brw_bo_wait(struct brw_bo *bo, int64_t timeout_ns);
 
diff --git a/src/mesa/drivers/dri/i965/brw_program_cache.c b/src/mesa/drivers/dri/i965/brw_program_cache.c
index ab03969db9..2fd989a41c 100644
--- a/src/mesa/drivers/dri/i965/brw_program_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_program_cache.c
@@ -220,7 +220,7 @@ brw_cache_new_bo(struct brw_cache *cache, uint32_t new_size)
    if (can_do_exec_capture(brw->screen))
       new_bo->kflags = EXEC_OBJECT_CAPTURE;
    if (brw->has_llc)
-      llc_map = brw_bo_map_unsynchronized(brw, new_bo);
+      llc_map = brw_bo_map(brw, new_bo, MAP_READ | MAP_ASYNC);
 
    /* Copy any existing data that needs to be saved. */
    if (cache->next_offset != 0) {
@@ -417,7 +417,7 @@ brw_init_caches(struct brw_context *brw)
    if (can_do_exec_capture(brw->screen))
       cache->bo->kflags = EXEC_OBJECT_CAPTURE;
    if (brw->has_llc)
-      cache->map = brw_bo_map_unsynchronized(brw, cache->bo);
+      cache->map = brw_bo_map(brw, cache->bo, MAP_READ | MAP_WRITE | MAP_ASYNC);
 }
 
 static void




More information about the mesa-commit mailing list