[Mesa-dev] [PATCH 2/2] r600: Handle failures in compute_memory_pool_finalize

Jan Vesely jan.vesely at rutgers.edu
Thu Jun 19 07:21:33 PDT 2014


Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
CC: Bruno Jimenez <brunojimen at gmail.com>
---

The failure now hits assertion compute_memory_pool.c:408, instead of
u_inlines.h:275:pipe_buffer_map_range: Assertion `offset < buffer->width0'

 src/gallium/drivers/r600/evergreen_compute.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
index a2abf15..bd6e720 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -659,7 +659,10 @@ static void evergreen_set_global_binding(
 		return;
 	}
 
-	compute_memory_finalize_pending(pool, ctx_);
+	if (compute_memory_finalize_pending(pool, ctx_) == -1) {
+		/* XXX: Unset */
+		return;
+	}
 
 	for (int i = 0; i < n; i++)
 	{
@@ -967,7 +970,9 @@ void *r600_compute_global_transfer_map(
 		"%u (box.x)\n", buffer->chunk->id, box->x);
 
 
-	compute_memory_finalize_pending(pool, ctx_);
+	if (compute_memory_finalize_pending(pool, ctx_) == -1) {
+		return NULL;
+	}
 
 	assert(resource->target == PIPE_BUFFER);
 	assert(resource->bind & PIPE_BIND_GLOBAL);
-- 
1.9.3



More information about the mesa-dev mailing list