mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
isl: centralize supported tilings in a single function
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32676>
This commit is contained in:
parent
f22f53cfe8
commit
8e1cad8d8f
6 changed files with 71 additions and 36 deletions
|
|
@ -428,6 +428,69 @@ isl_device_init(struct isl_device *dev,
|
|||
dev->emit_cpb_control_s = isl_emit_cpb_control_s_get_func(dev);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Query the supported tilings by the device.
|
||||
*
|
||||
* This function always returns non-zero as ISL_TILING_LINEAR_BIT is always
|
||||
* supported.
|
||||
*/
|
||||
isl_tiling_flags_t
|
||||
isl_device_get_supported_tilings(const struct isl_device *dev)
|
||||
{
|
||||
isl_tiling_flags_t flags;
|
||||
|
||||
if (ISL_GFX_VERX10(dev) >= 200) {
|
||||
flags =
|
||||
ISL_TILING_LINEAR_BIT |
|
||||
ISL_TILING_X_BIT |
|
||||
ISL_TILING_4_BIT |
|
||||
ISL_TILING_64_XE2_BIT;
|
||||
} else if (ISL_GFX_VERX10(dev) >= 125) {
|
||||
flags =
|
||||
ISL_TILING_LINEAR_BIT |
|
||||
ISL_TILING_X_BIT |
|
||||
ISL_TILING_4_BIT |
|
||||
ISL_TILING_64_BIT;
|
||||
} else if (ISL_GFX_VER(dev) >= 12) {
|
||||
flags =
|
||||
ISL_TILING_LINEAR_BIT |
|
||||
ISL_TILING_X_BIT |
|
||||
ISL_TILING_Y0_BIT |
|
||||
ISL_TILING_ICL_Yf_BIT |
|
||||
ISL_TILING_ICL_Ys_BIT;
|
||||
} else if (ISL_GFX_VER(dev) >= 11) {
|
||||
flags =
|
||||
ISL_TILING_LINEAR_BIT |
|
||||
ISL_TILING_X_BIT |
|
||||
ISL_TILING_W_BIT |
|
||||
ISL_TILING_Y0_BIT |
|
||||
ISL_TILING_ICL_Yf_BIT |
|
||||
ISL_TILING_ICL_Ys_BIT;
|
||||
} else if (ISL_GFX_VER(dev) >= 9) {
|
||||
flags =
|
||||
ISL_TILING_LINEAR_BIT |
|
||||
ISL_TILING_X_BIT |
|
||||
ISL_TILING_W_BIT |
|
||||
ISL_TILING_Y0_BIT |
|
||||
ISL_TILING_SKL_Yf_BIT |
|
||||
ISL_TILING_SKL_Ys_BIT;
|
||||
} else if (ISL_GFX_VER(dev) >= 6) {
|
||||
flags =
|
||||
ISL_TILING_LINEAR_BIT |
|
||||
ISL_TILING_X_BIT |
|
||||
ISL_TILING_W_BIT |
|
||||
ISL_TILING_Y0_BIT;
|
||||
} else {
|
||||
/* Gfx4-5 only support linear, X, and Y-tiling. */
|
||||
flags =
|
||||
ISL_TILING_LINEAR_BIT |
|
||||
ISL_TILING_X_BIT |
|
||||
ISL_TILING_Y0_BIT;
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Query the set of multisamples supported by the device.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -2029,6 +2029,9 @@ void
|
|||
isl_device_init(struct isl_device *dev,
|
||||
const struct intel_device_info *info);
|
||||
|
||||
isl_tiling_flags_t
|
||||
isl_device_get_supported_tilings(const struct isl_device *dev);
|
||||
|
||||
isl_sample_count_mask_t ATTRIBUTE_CONST
|
||||
isl_device_get_sample_counts(const struct isl_device *dev);
|
||||
|
||||
|
|
|
|||
|
|
@ -44,10 +44,7 @@ isl_gfx125_filter_tiling(const struct isl_device *dev,
|
|||
/* Clear flags unsupported on this hardware */
|
||||
assert(ISL_GFX_VERX10(dev) == 125);
|
||||
|
||||
*flags &= ISL_TILING_LINEAR_BIT |
|
||||
ISL_TILING_X_BIT |
|
||||
ISL_TILING_4_BIT |
|
||||
ISL_TILING_64_BIT;
|
||||
*flags &= isl_device_get_supported_tilings(dev);
|
||||
|
||||
if (isl_surf_usage_is_depth_or_stencil(info->usage)) {
|
||||
*flags &= ISL_TILING_4_BIT | ISL_TILING_64_BIT;
|
||||
|
|
|
|||
|
|
@ -44,10 +44,7 @@ isl_gfx20_filter_tiling(const struct isl_device *dev,
|
|||
/* Clear flags unsupported on this hardware */
|
||||
assert(ISL_GFX_VERX10(dev) >= 200);
|
||||
|
||||
*flags &= ISL_TILING_LINEAR_BIT |
|
||||
ISL_TILING_X_BIT |
|
||||
ISL_TILING_4_BIT |
|
||||
ISL_TILING_64_XE2_BIT;
|
||||
*flags &= isl_device_get_supported_tilings(dev);
|
||||
|
||||
if (isl_surf_usage_is_depth_or_stencil(info->usage)) {
|
||||
*flags &= ISL_TILING_4_BIT | ISL_TILING_64_XE2_BIT;
|
||||
|
|
|
|||
|
|
@ -42,8 +42,7 @@ isl_gfx4_filter_tiling(const struct isl_device *dev,
|
|||
const struct isl_surf_init_info *restrict info,
|
||||
isl_tiling_flags_t *flags)
|
||||
{
|
||||
/* Gfx4-5 only support linear, X, and Y-tiling. */
|
||||
*flags &= (ISL_TILING_LINEAR_BIT | ISL_TILING_X_BIT | ISL_TILING_Y0_BIT);
|
||||
*flags &= isl_device_get_supported_tilings(dev);;
|
||||
|
||||
if (isl_surf_usage_is_depth_or_stencil(info->usage)) {
|
||||
assert(!ISL_DEV_USE_SEPARATE_STENCIL(dev));
|
||||
|
|
|
|||
|
|
@ -198,32 +198,8 @@ isl_gfx6_filter_tiling(const struct isl_device *dev,
|
|||
|
||||
/* Clear flags unsupported on this hardware */
|
||||
assert(ISL_GFX_VERX10(dev) < 125);
|
||||
if (ISL_GFX_VER(dev) >= 12) {
|
||||
*flags &= ISL_TILING_LINEAR_BIT |
|
||||
ISL_TILING_X_BIT |
|
||||
ISL_TILING_Y0_BIT |
|
||||
ISL_TILING_ICL_Yf_BIT |
|
||||
ISL_TILING_ICL_Ys_BIT;
|
||||
} else if (ISL_GFX_VER(dev) >= 11) {
|
||||
*flags &= ISL_TILING_LINEAR_BIT |
|
||||
ISL_TILING_X_BIT |
|
||||
ISL_TILING_W_BIT |
|
||||
ISL_TILING_Y0_BIT |
|
||||
ISL_TILING_ICL_Yf_BIT |
|
||||
ISL_TILING_ICL_Ys_BIT;
|
||||
} else if (ISL_GFX_VER(dev) >= 9) {
|
||||
*flags &= ISL_TILING_LINEAR_BIT |
|
||||
ISL_TILING_X_BIT |
|
||||
ISL_TILING_W_BIT |
|
||||
ISL_TILING_Y0_BIT |
|
||||
ISL_TILING_SKL_Yf_BIT |
|
||||
ISL_TILING_SKL_Ys_BIT;
|
||||
} else {
|
||||
*flags &= ISL_TILING_LINEAR_BIT |
|
||||
ISL_TILING_X_BIT |
|
||||
ISL_TILING_W_BIT |
|
||||
ISL_TILING_Y0_BIT;
|
||||
}
|
||||
|
||||
*flags &= isl_device_get_supported_tilings(dev);
|
||||
|
||||
/* TODO: Investigate Yf failures (~5000 VK CTS failures at the time of this
|
||||
* writing).
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue