From 7c697b1670fe34b54a7b82d8ff0732845caa05a3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 17 Mar 2010 10:05:55 -0700 Subject: intel: Align untiled buffer pitch to 64B. This is the largest untiled pitch requirement from gen2 through gen4. It's only the case for gen3 rendering to color regions with depth, but it's rare for this to be a significant factor in memory usage -- for example, gen4 requires 1 or 2 times the element size, or up to 64 bytes depending on the size of the elements. This is easier than encoding all the various little quirks for untiled pitch alignment, since we rarely do untiled now. --- intel/intel_bufmgr_gem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'intel') diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index c3b5d6ae..8e46e374 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -257,8 +257,11 @@ drm_intel_gem_bo_tile_pitch(drm_intel_bufmgr_gem *bufmgr_gem, unsigned long tile_width; unsigned long i; + /* If untiled, then just align it so that we can do rendering + * to it with the 3D engine. + */ if (tiling_mode == I915_TILING_NONE) - return pitch; + return ALIGN(pitch, 64); if (tiling_mode == I915_TILING_X) tile_width = 512; -- cgit v1.2.3