From patchwork Fri Nov 22 13:52:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 3222581 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 40B02C045B for ; Fri, 22 Nov 2013 13:52:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6850C2079D for ; Fri, 22 Nov 2013 13:52:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 74D2C20795 for ; Fri, 22 Nov 2013 13:52:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D2006FAA49; Fri, 22 Nov 2013 05:52:37 -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 817CEFA550; Fri, 22 Nov 2013 05:52:35 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id 51FD91488009; Fri, 22 Nov 2013 05:52:35 -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 38c3aM330GxK; Fri, 22 Nov 2013 05:52:32 -0800 (PST) Received: by keithp.com (Postfix, from userid 1033) id E36AD1488005; Fri, 22 Nov 2013 05:52:31 -0800 (PST) Received: from miki.keithp.com (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id D50BC158044; Fri, 22 Nov 2013 05:52:31 -0800 (PST) Received: by miki.keithp.com (Postfix, from userid 1001) id 5488DABE; Fri, 22 Nov 2013 05:52:31 -0800 (PST) From: Keith Packard To: mesa-dev@lists.freedesktop.org Subject: [PATCH 2/2] i965: Set fast color clear mcs_state on newly allocated image miptrees Date: Fri, 22 Nov 2013 05:52:27 -0800 Message-Id: <1385128347-17777-3-git-send-email-keithp@keithp.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1385128347-17777-1-git-send-email-keithp@keithp.com> References: <1385128347-17777-1-git-send-email-keithp@keithp.com> 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@lists.freedesktop.org Errors-To: dri-devel-bounces@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 Just copying code from the dri2 path to set up the fast color clear state. This also removes a couple of bogus intel_region_reference calls. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 884ddef..ca78f32 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -762,7 +762,13 @@ intel_miptree_create_for_image_buffer(struct brw_context *intel, if (!singlesample_mt) return NULL; - intel_region_reference(&singlesample_mt->region, region); + /* If this miptree is capable of supporting fast color clears, set + * mcs_state appropriately to ensure that fast clears will occur. + * Allocation of the MCS miptree will be deferred until the first fast + * clear actually occurs. + */ + if (intel_is_non_msrt_mcs_buffer_supported(intel, singlesample_mt)) + singlesample_mt->mcs_state = INTEL_MCS_STATE_RESOLVED; if (num_samples == 0) return singlesample_mt; @@ -780,8 +786,6 @@ intel_miptree_create_for_image_buffer(struct brw_context *intel, multisample_mt->singlesample_mt = singlesample_mt; multisample_mt->need_downsample = false; - intel_region_reference(&multisample_mt->region, region); - if (intel->is_front_buffer_rendering && buffer_type == __DRI_IMAGE_BUFFER_FRONT) { intel_miptree_upsample(intel, multisample_mt); }