From patchwork Fri Nov 22 04:20:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 3221271 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B8441C045B for ; Fri, 22 Nov 2013 04:20:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3EFE20780 for ; Fri, 22 Nov 2013 04:20:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id ED3792074B for ; Fri, 22 Nov 2013 04:20:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A3484FAE31 for ; Thu, 21 Nov 2013 20:20:46 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id E3BD0FADF8; Thu, 21 Nov 2013 20:20:24 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id C26E11488005; Thu, 21 Nov 2013 20:20:24 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from keithp.com ([127.0.0.1]) by localhost (keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9hcrWa_yr8Hf; Thu, 21 Nov 2013 20:20:21 -0800 (PST) Received: by keithp.com (Postfix, from userid 1033) id 4029D1488002; Thu, 21 Nov 2013 20:20:20 -0800 (PST) Received: from miki.keithp.com (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id 9250215803D; Thu, 21 Nov 2013 20:20:20 -0800 (PST) Received: by miki.keithp.com (Postfix, from userid 1001) id 38C6EB0C; Thu, 21 Nov 2013 20:20:20 -0800 (PST) From: Keith Packard To: mesa-dev@lists.freedesktop.org Subject: [PATCH] gallium: Use base.stamp for all drawable invalidation checks. Date: Thu, 21 Nov 2013 20:20:18 -0800 Message-Id: <1385094018-22536-1-git-send-email-keithp@keithp.com> X-Mailer: git-send-email 1.8.4.2 Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Upper levels of the stack use base.stamp to tell when a drawable needs to be revalidated, but the dri state tracker was using dPriv->lastStamp. Those two, along with dri2.stamp, all get simultaneously incremented when a dri2 invalidate event was delivered, and so end up containing precisely the same value. This patch doesn't change the fact that there are three variables, rather it switches all of the tests to use only base.stamp, which is functionally equivalent to the previous code. Then, it passes base.stamp to the image loader getBuffers function so that the one which is checked will get updated by the XCB special event queue used by DRI3. Signed-off-by: Keith Packard Reviewed-by: Marek Olšák --- This patch makes sure that drawables get invalidated when the window changes size or when SwapBuffers is called; dri3 has only a single location to smite when things change, so we need to make sure the upper levels all share that location. This should permit the elimination of the dri2.stamp and lastStamp variables, which would be a nice further cleanup. src/gallium/state_trackers/dri/common/dri_drawable.c | 4 ++-- src/gallium/state_trackers/dri/drm/dri2.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.c b/src/gallium/state_trackers/dri/common/dri_drawable.c index f255108..734bca2 100644 --- a/src/gallium/state_trackers/dri/common/dri_drawable.c +++ b/src/gallium/state_trackers/dri/common/dri_drawable.c @@ -73,7 +73,7 @@ dri_st_framebuffer_validate(struct st_context_iface *stctx, * checked. */ do { - lastStamp = drawable->dPriv->lastStamp; + lastStamp = drawable->base.stamp; new_stamp = (drawable->texture_stamp != lastStamp); if (new_stamp || new_mask || screen->broken_invalidate) { @@ -91,7 +91,7 @@ dri_st_framebuffer_validate(struct st_context_iface *stctx, drawable->texture_stamp = lastStamp; drawable->texture_mask = statt_mask; } - } while (lastStamp != drawable->dPriv->lastStamp); + } while (lastStamp != drawable->base.stamp); if (!out) return TRUE; diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c index 6a56cd4..c7e4151 100644 --- a/src/gallium/state_trackers/dri/drm/dri2.c +++ b/src/gallium/state_trackers/dri/drm/dri2.c @@ -545,7 +545,7 @@ dri_image_allocate_textures(struct dri_context *ctx, (*sPriv->image.loader->getBuffers) (dPriv, image_format, - &dPriv->dri2.stamp, + (uint32_t *) &drawable->base.stamp, dPriv->loaderPrivate, buffer_mask, &images);