[Mesa-dev] [PATCH 3/4] r600g, radeonsi: skip busy-checking for DISCARD_RANGE if it has been done already

Marek Olšák maraeo at gmail.com
Sat Feb 1 06:08:48 PST 2014


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeon/r600_buffer_common.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
index b8a96fe..b7921fa 100644
--- a/src/gallium/drivers/radeon/r600_buffer_common.c
+++ b/src/gallium/drivers/radeon/r600_buffer_common.c
@@ -250,8 +250,12 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
 				data += box->x % R600_MAP_BUFFER_ALIGNMENT;
 				return r600_buffer_get_transfer(ctx, resource, level, usage, box,
 								ptransfer, data, staging, offset);
+			} else {
+				return NULL; /* error, shouldn't occur though */
 			}
 		}
+		/* At this point, the buffer is always idle (we checked it above). */
+		usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
 	}
 
 	data = r600_buffer_map_sync_with_rings(rctx, rbuffer, usage);
-- 
1.8.3.2



More information about the mesa-dev mailing list