From 6ea2bda5f5ec8f27359760ce580fdad3df0464df Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 22 Jun 2010 13:03:52 +0100 Subject: intel: Only adjust the local stride used for SET_TILING in tiled alloc Mesa uses the returned pitch from alloc_tiled, so make sure that we set it correctly before modifying the stride used for the SET_TILING call. Signed-off-by: Chris Wilson --- intel/intel_bufmgr_gem.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'intel/intel_bufmgr_gem.c') diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 79a61244..a1a0806e 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -710,7 +710,6 @@ drm_intel_gem_bo_alloc_tiled(drm_intel_bufmgr *bufmgr, const char *name, unsigned long *pitch, unsigned long flags) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; - drm_intel_bo *bo; unsigned long size, stride; uint32_t tiling; @@ -743,17 +742,13 @@ drm_intel_gem_bo_alloc_tiled(drm_intel_bufmgr *bufmgr, const char *name, size = stride * aligned_y; size = drm_intel_gem_bo_tile_size(bufmgr_gem, size, tiling_mode); } while (*tiling_mode != tiling); + *pitch = stride; - if (*tiling_mode == I915_TILING_NONE) + if (tiling == I915_TILING_NONE) stride = 0; - bo = drm_intel_gem_bo_alloc_internal(bufmgr, name, size, flags, - *tiling_mode, stride); - if (!bo) - return NULL; - - *pitch = stride; - return bo; + return drm_intel_gem_bo_alloc_internal(bufmgr, name, size, flags, + tiling, stride); } /** -- cgit v1.2.3