From patchwork Tue Apr 20 20:08:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Anholt X-Patchwork-Id: 93719 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3KK8Ffa023149 for ; Tue, 20 Apr 2010 20:08:50 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7E7C9E810; Tue, 20 Apr 2010 13:08:14 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from annarchy.freedesktop.org (annarchy.freedesktop.org [131.252.210.176]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C6D79E732; Tue, 20 Apr 2010 13:08:12 -0700 (PDT) Received: from pollan.anholt.net (annarchy.freedesktop.org [127.0.0.1]) by annarchy.freedesktop.org (Postfix) with ESMTP id 26FE7130011; Tue, 20 Apr 2010 13:08:12 -0700 (PDT) Received: by pollan.anholt.net (Postfix, from userid 1000) id A4B6732C065; Tue, 20 Apr 2010 13:08:10 -0700 (PDT) From: Eric Anholt To: intel-gfx@lists.freedesktop.org Date: Tue, 20 Apr 2010 13:08:09 -0700 Message-Id: <1271794089-9152-1-git-send-email-eric@anholt.net> X-Mailer: git-send-email 1.7.0.4 Subject: [Intel-gfx] [PATCH 1/3] Submit any existing batchbuffer before potentially handing off a BO to TFP. 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@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 20 Apr 2010 20:08:50 +0000 (UTC) diff --git a/src/i830_dri.c b/src/i830_dri.c index 321faf6..f30142c 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -79,6 +79,21 @@ typedef struct { unsigned int attachment; } I830DRI2BufferPrivateRec, *I830DRI2BufferPrivatePtr; +/* If the drawable is one that might have GLX_texture_from_pixmap done + * to it, flush rendering before handing a reference to it back to + * GLX. + */ +static void +do_tfp_flush(DrawablePtr drawable) +{ + if (drawable->type == DRAWABLE_PIXMAP) { + ScreenPtr screen = drawable->pScreen; + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + + intel_batch_submit(scrn); + } +} + #ifndef USE_DRI2_1_1_0 static DRI2BufferPtr I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments, @@ -105,6 +120,7 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments, pDepthPixmap = NULL; for (i = 0; i < count; i++) { if (attachments[i] == DRI2BufferFrontLeft) { + do_tfp_flush(drawable); pixmap = get_drawable_pixmap(drawable); pixmap->refcnt++; } else if (attachments[i] == DRI2BufferStencil && pDepthPixmap) { @@ -184,6 +200,7 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment, } if (attachment == DRI2BufferFrontLeft) { + do_tfp_flush(drawable); pixmap = get_drawable_pixmap(drawable); pixmap->refcnt++; } else {