Mesa (7.11): intel: GetBuffer fix

Ian Romanick idr at kemper.freedesktop.org
Tue Oct 25 18:42:10 PDT 2011


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

Author: Ben Widawsky <ben at bwidawsk.net>
Date:   Sun Aug  7 17:04:04 2011 -0700

intel: GetBuffer fix

After copy buffer on preGEN6, it is necessary to wait for the blit to
complete before returning data to the user.

This should fix the piglit test: copy_buffer_coherency (pre-GEN6).

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit fa351bd2e0aecccd5ed6ef8744d5ba4a6dbf5d2c)

---

 src/mesa/drivers/dri/intel/intel_buffer_objects.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
index 439d6fc..703300b 100644
--- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
@@ -282,12 +282,17 @@ intel_bufferobj_get_subdata(struct gl_context * ctx,
                             GLvoid * data, struct gl_buffer_object *obj)
 {
    struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+   struct intel_context *intel = intel_context(ctx);
 
    assert(intel_obj);
    if (intel_obj->sys_buffer)
       memcpy(data, (char *)intel_obj->sys_buffer + offset, size);
-   else
+   else {
+      if (drm_intel_bo_references(intel->batch.bo, intel_obj->buffer)) {
+	 intel_batchbuffer_flush(intel);
+      }
       drm_intel_bo_get_subdata(intel_obj->buffer, offset, size, data);
+   }
 }
 
 



More information about the mesa-commit mailing list