[Mesa-dev] [PATCH 57/70] i965: Stage blitted buffer uploads through the common upload bo

Chris Wilson chris at chris-wilson.co.uk
Fri Aug 7 13:14:01 PDT 2015


Reuse the common upload bo for the temporary blitter storage to try and
minimise resource usage.

Caveats: this may impose a read-read relationship on the buffer between
the blitter and render engines, and may add stalls on old kernels.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 src/mesa/drivers/dri/i965/intel_buffer_objects.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_buffer_objects.c b/src/mesa/drivers/dri/i965/intel_buffer_objects.c
index 32df381..2b18e2c 100644
--- a/src/mesa/drivers/dri/i965/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/i965/intel_buffer_objects.c
@@ -235,17 +235,13 @@ brw_buffer_subdata(struct gl_context *ctx,
                     (long)offset, (long)offset + size, (long)(size/1024),
                     intel_obj->gpu_active_start,
                     intel_obj->gpu_active_end);
-         brw_bo *temp_bo =
-            brw_bo_create(&brw->batch, "subdata temp", size, 64, 0);
-
-         brw_bo_write(temp_bo, 0, data, size, 0,
-                      PERF_DEBUG(brw, "BufferSubData"));
-
+         uint32_t upload;
+         brw_bo *temp_bo = NULL;
+         intel_upload_data(brw, data, size, 64, &temp_bo, &upload);
          intel_emit_linear_blit(brw,
                                 intel_obj->buffer, offset,
-                                temp_bo, 0,
+                                temp_bo, upload,
                                 size);
-
          brw_bo_put(temp_bo);
          return;
       } else {
-- 
2.5.0



More information about the mesa-dev mailing list