[Mesa-dev] [PATCH 02/23] i965: Use miptree non-aligned dimensions directly for x-tiled

Ben Widawsky ben at bwidawsk.net
Tue Feb 9 20:31:11 UTC 2016


On Mon, Feb 08, 2016 at 06:51:22PM +0200, Topi Pohjolainen wrote:
> The logic in intel_miptree_create() uses the local copies
> for 64-byte aligned equivalent but only for stencil buffers which
> in turn are never x-tiled. This makes the logic a little more
> explicit and helps to keep subsequent patches easier to read.
> 
> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 0edd59f..033f4c6 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -698,7 +698,7 @@ 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",
> -                                  total_width, total_height, mt->cpp,
> +                                  mt->total_width, mt->total_height, mt->cpp,
>                                    &mt->tiling, &pitch, alloc_flags);
>        mt->pitch = pitch;
>     }

Maybe you can just move the stencil alignment down into the if statement and
make it even better isolated. Right now I think it's a little confusing to have
the local variables defined and unused except gen < 6 + stencil. Either way:
Reviewed-by: Ben Widawsky <benjamin.widawsky at intel.com>


BTW, maybe you can see if this still makes sense:
https://patchwork.freedesktop.org/patch/56792/


More information about the mesa-dev mailing list