diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-22 13:03:52 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-22 13:03:52 +0100 |
commit | 6ea2bda5f5ec8f27359760ce580fdad3df0464df (patch) | |
tree | 20c2639c8b505a029db3bb4141a918c12e940281 | |
parent | aba3502190a5bd2203e71ae2b1b7dd5aeb223905 (diff) |
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 <chris@chris-wilson.co.uk>
-rw-r--r-- | intel/intel_bufmgr_gem.c | 13 |
1 files changed, 4 insertions, 9 deletions
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); } /** |