Commit 1e912802 authored by Nanley Chery's avatar Nanley Chery
Browse files

isl: Add and use isl_tiling_flag_to_enum()



Use a helper that will automatically handle Gen12's CCS tiling when
creating a CCS isl_surf.
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen's avatarJordan Justen <jordan.l.justen@intel.com>
parent 82822bc5
......@@ -384,7 +384,7 @@ isl_surf_choose_tiling(const struct isl_device *dev,
if (info->usage & ISL_SURF_USAGE_HIZ_BIT) {
assert(info->format == ISL_FORMAT_HIZ);
assert(tiling_flags == ISL_TILING_HIZ_BIT);
*tiling = ISL_TILING_HIZ;
*tiling = isl_tiling_flag_to_enum(tiling_flags);
return true;
}
......@@ -392,7 +392,7 @@ isl_surf_choose_tiling(const struct isl_device *dev,
if (info->usage & ISL_SURF_USAGE_CCS_BIT) {
assert(isl_format_get_layout(info->format)->txc == ISL_TXC_CCS);
assert(tiling_flags == ISL_TILING_CCS_BIT);
*tiling = ISL_TILING_CCS;
*tiling = isl_tiling_flag_to_enum(tiling_flags);
return true;
}
......
......@@ -1636,6 +1636,13 @@ bool
isl_has_matching_typed_storage_image_format(const struct gen_device_info *devinfo,
enum isl_format fmt);
static inline enum isl_tiling
isl_tiling_flag_to_enum(isl_tiling_flags_t flag)
{
assert(__builtin_popcount(flag) == 1);
return (enum isl_tiling) (__builtin_ffs(flag) - 1);
}
static inline bool
isl_tiling_is_any_y(enum isl_tiling tiling)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment