diff options
author | Topi Pohjolainen <topi.pohjolainen@intel.com> | 2016-12-21 23:45:17 +0200 |
---|---|---|
committer | Topi Pohjolainen <topi.pohjolainen@intel.com> | 2017-01-13 11:17:00 +0200 |
commit | 24ff3ecc6d4e6faabbd030b41ca465b060dbe24c (patch) | |
tree | 4cb7ab75cd5178fc97de02dd34071736dbbd9744 | |
parent | 0a3fcf290bb644b07b9b3d4c030664b16dc4c80f (diff) |
i965/miptree: Use isl surface size for bo allocationi965_isl_2017_1
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 1850885335..a212125147 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -674,19 +674,12 @@ miptree_create(struct brw_context *brw, unsigned long pitch; mt->etc_format = etc_format; - if (format == MESA_FORMAT_S_UINT8) { - /* Align to size of W tile, 64x64. */ - mt->bo = drm_intel_bo_alloc_tiled(brw->bufmgr, "miptree", - ALIGN(mt->total_width, 64), - ALIGN(mt->total_height, 64), - mt->cpp, &mt->tiling, &pitch, - alloc_flags); - } else { - mt->bo = drm_intel_bo_alloc_tiled(brw->bufmgr, "miptree", - mt->total_width, mt->total_height, - mt->cpp, &mt->tiling, &pitch, - alloc_flags); - } + mt->bo = drm_intel_bo_alloc_tiled(brw->bufmgr, "miptree", + mt->surf.row_pitch, + mt->surf.size / mt->surf.row_pitch, + mt->cpp, &mt->tiling, &pitch, + alloc_flags); + assert(mt->surf.row_pitch == pitch); mt->pitch = pitch; @@ -722,7 +715,7 @@ intel_miptree_create(struct brw_context *brw, (layout_flags & MIPTREE_LAYOUT_ACCELERATED_UPLOAD) ? BO_ALLOC_FOR_RENDER : 0; perf_debug("%dx%d miptree larger than aperture; falling back to X-tiled\n", - mt->total_width, mt->total_height); + mt->surf.row_pitch, mt->surf.size / mt->surf.row_pitch); assert(brw_create_isl_surf(brw, &mt->surf, target, format, first_level, last_level, @@ -733,8 +726,10 @@ intel_miptree_create(struct brw_context *brw, mt->tiling = I915_TILING_X; drm_intel_bo_unreference(mt->bo); mt->bo = drm_intel_bo_alloc_tiled(brw->bufmgr, "miptree", - mt->total_width, mt->total_height, mt->cpp, - &mt->tiling, &pitch, alloc_flags); + mt->surf.row_pitch, + mt->surf.size / mt->surf.row_pitch, + mt->cpp, &mt->tiling, &pitch, + alloc_flags); mt->pitch = pitch; assert(miptree_verify_isl_surf(brw, mt, target, format, |