From dcb03bf18d3995949ee9e7a0e350f161b24e183f Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 18 May 2017 11:29:00 -0700 Subject: [PATCH] i965: Drop MAP_READ from some write-only mappings Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_performance_query.c | 2 +- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 2 +- src/mesa/drivers/dri/i965/intel_screen.c | 2 +- src/mesa/drivers/dri/i965/intel_tex_subimage.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c index 4cbd60e..2ec070b 100644 --- a/src/mesa/drivers/dri/i965/brw_performance_query.c +++ b/src/mesa/drivers/dri/i965/brw_performance_query.c @@ -992,7 +992,7 @@ brw_begin_perf_query(struct gl_context *ctx, MI_RPC_BO_SIZE, 64); #ifdef DEBUG /* Pre-filling the BO helps debug whether writes landed. */ - void *map = brw_bo_map_cpu(brw, obj->oa.bo, MAP_READ | MAP_WRITE); + void *map = brw_bo_map_cpu(brw, obj->oa.bo, MAP_WRITE); memset(map, 0x80, MI_RPC_BO_SIZE); brw_bo_unmap(obj->oa.bo); #endif diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index a60fac5..f81e087 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -1386,7 +1386,7 @@ intel_miptree_init_mcs(struct brw_context *brw, * * Note: the clear value for MCS buffers is all 1's, so we memset to 0xff. */ - void *map = brw_bo_map_gtt(brw, mt->mcs_buf->bo, MAP_READ | MAP_WRITE); + void *map = brw_bo_map_gtt(brw, mt->mcs_buf->bo, MAP_WRITE); if (unlikely(map == NULL)) { fprintf(stderr, "Failed to map mcs buffer into GTT\n"); brw_bo_unreference(mt->mcs_buf->bo); diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 44600f2..90832ae 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -1420,7 +1420,7 @@ intel_detect_pipelined_register(struct intel_screen *screen, if (bo == NULL) goto err_results; - map = brw_bo_map_cpu(NULL, bo, MAP_READ | MAP_WRITE); + map = brw_bo_map_cpu(NULL, bo, MAP_WRITE); if (!map) goto err_batch; diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c b/src/mesa/drivers/dri/i965/intel_tex_subimage.c index 0f75bdf..b0b1a0f 100644 --- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c @@ -146,7 +146,7 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx, intel_batchbuffer_flush(brw); } - void *map = brw_bo_map_cpu(brw, bo, MAP_READ | MAP_WRITE); + void *map = brw_bo_map_cpu(brw, bo, MAP_WRITE); if (map == NULL) { DBG("%s: failed to map bo\n", __func__); return false; -- 2.7.4