intel/isl: Allow creating non-Y-tiled ASTC surfaces

The sampler can only decode ASTC surfaces that are Y-tiled. ISL has
been asserting this restriction at surface creation time.

However, some drivers want to create a surface that is only used for
copying compressed data. And during the copy, the surface won't have a
compressed format.

To enable this behavior, we choose to move the tiling assertion to the
moment a surface state is created for the sampler.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13881>
This commit is contained in:
Nanley Chery 2021-11-12 09:42:22 -05:00 committed by Marge Bot
parent 574c5d1540
commit caa998ca8f
2 changed files with 8 additions and 6 deletions

View file

@ -237,12 +237,6 @@ isl_gfx6_filter_tiling(const struct isl_device *dev,
*flags &= ~ISL_TILING_W_BIT;
}
/* From the SKL+ PRMs, RENDER_SURFACE_STATE:TileMode,
* If Surface Format is ASTC*, this field must be TILEMODE_YMAJOR.
*/
if (isl_format_get_layout(info->format)->txc == ISL_TXC_ASTC)
*flags &= ISL_TILING_Y0_BIT;
/* MCS buffers are always Y-tiled */
if (isl_format_get_layout(info->format)->txc == ISL_TXC_MCS)
*flags &= ISL_TILING_Y0_BIT;

View file

@ -532,6 +532,14 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
#if GFX_VER >= 8
assert(GFX_VER < 12 || info->surf->tiling != ISL_TILING_W);
/* From the SKL+ PRMs, RENDER_SURFACE_STATE:TileMode,
*
* If Surface Format is ASTC*, this field must be TILEMODE_YMAJOR.
*/
if (isl_format_get_layout(info->view->format)->txc == ISL_TXC_ASTC)
assert(info->surf->tiling == ISL_TILING_Y0);
s.TileMode = isl_encode_tiling[info->surf->tiling];
#else
s.TiledSurface = info->surf->tiling != ISL_TILING_LINEAR,