From patchwork Tue Mar 23 17:51:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 87714 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 o2NHpjX2001371 for ; Tue, 23 Mar 2010 17:52:20 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F0FBC9F51A; Tue, 23 Mar 2010 10:51:43 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from orsmga101.jf.intel.com (mga06.intel.com [134.134.136.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D8C69E890 for ; Tue, 23 Mar 2010 10:51:40 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 23 Mar 2010 10:47:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.51,296,1267430400"; d="scan'208";a="606947560" Received: from unknown (HELO localhost.localdomain) ([10.255.17.202]) by orsmga001.jf.intel.com with ESMTP; 23 Mar 2010 10:51:04 -0700 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Tue, 23 Mar 2010 17:51:23 +0000 Message-Id: <1269366683-17546-2-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 1.7.0.3 In-Reply-To: <1269366683-17546-1-git-send-email-chris@chris-wilson.co.uk> References: <1269366683-17546-1-git-send-email-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH] uxa: Default to using TILING_X for pixmaps. 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, 23 Mar 2010 17:52:20 +0000 (UTC) diff --git a/src/i830_uxa.c b/src/i830_uxa.c index fec5378..ded931d 100644 --- a/src/i830_uxa.c +++ b/src/i830_uxa.c @@ -135,8 +135,16 @@ i830_uxa_pixmap_compute_size(PixmapPtr pixmap, pitch_align = intel->accel_pixmap_pitch_alignment; size = ROUND_TO((w * pixmap->drawable.bitsPerPixel + 7) / 8, pitch_align) * ALIGN (h, 2); - if (size < 4096) + if (size <= 4096) { *tiling = I915_TILING_NONE; + } else if (!IS_I965G(intel)) { + /* Older hardware requires massive fences to be pot + * size aligned with a minimum of 1 MiB, so + * causes massive overallocation for small textures. + */ + if (size <= 1024*1024/2) + *tiling = I915_TILING_NONE; + } } repeat: @@ -863,12 +871,13 @@ i830_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth, return NullPixmap; } - if (usage == INTEL_CREATE_PIXMAP_TILING_X) - priv->tiling = I915_TILING_X; - else if (usage == INTEL_CREATE_PIXMAP_TILING_Y) + /* Always attempt to tile, compute_size() will remove the + * tiling for pixmaps that are either too large or too small + * to be effectively tiled. + */ + priv->tiling = I915_TILING_X; + if (usage == INTEL_CREATE_PIXMAP_TILING_Y) priv->tiling = I915_TILING_Y; - else - priv->tiling = I915_TILING_NONE; size = i830_uxa_pixmap_compute_size(pixmap, w, h, &priv->tiling, &stride);