From patchwork Mon Aug 8 06:51:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 1043052 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p786qbsf010700 for ; Mon, 8 Aug 2011 06:52:57 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B1F39E811 for ; Sun, 7 Aug 2011 23:52:37 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F5559E778; Sun, 7 Aug 2011 23:51:09 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by cloud01.chad-versace.us (Postfix) with ESMTP id D87E51D41E0; Mon, 8 Aug 2011 06:53:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at static.cloud-ips.com X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-100 required=3 tests=[ALL_TRUSTED=-1] autolearn=ham Received: from cloud01.chad-versace.us ([127.0.0.1]) by localhost (cloud01.static.cloud-ips.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xcii-+GeeRpQ; Mon, 8 Aug 2011 06:53:54 +0000 (UTC) Received: from localhost.localdomain (unknown [64.114.255.126]) by cloud01.chad-versace.us (Postfix) with ESMTPSA id 34A671D408E; Mon, 8 Aug 2011 06:53:54 +0000 (UTC) From: Ben Widawsky To: mesa-dev@lists.freedesktop.org Date: Sun, 7 Aug 2011 23:51:19 -0700 Message-Id: <1312786279-14090-1-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1312786158-13816-1-git-send-email-ben@bwidawsk.net> References: <1312786158-13816-1-git-send-email-ben@bwidawsk.net> Cc: piglit@lists.freedesktop.org, Ben Widawsky , intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [PATCH] intel: GetBuffer fix X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 08 Aug 2011 06:52:57 +0000 (UTC) After copy buffer on preGEN6, it is necessary to wait for the blit to complete before returning data to the user. This fixes the piglit test: copy_buffer_coherency. Signed-off-by: Ben Widawsky --- 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); + } }