anv: set aux usage to GFX12_CCS_E if a platform needs WA 14010672564

Account for the aux usage in various places now that we set the aux
usage correctly.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22076>
This commit is contained in:
Rohan Garg
2023-04-19 11:05:28 +02:00
committed by Marge Bot
parent 963847735a
commit 3debf2af0c
4 changed files with 16 additions and 9 deletions
+1 -1
View File
@@ -773,7 +773,7 @@ anv_get_image_format_features2(const struct intel_device_info *devinfo,
}
}
if (isl_mod_info->aux_usage == ISL_AUX_USAGE_CCS_E &&
if (isl_aux_usage_has_ccs_e(isl_mod_info->aux_usage) &&
!isl_format_supports_ccs_e(devinfo, plane_format.isl_format)) {
return 0;
}
+10 -3
View File
@@ -593,7 +593,7 @@ add_aux_state_tracking_buffer(struct anv_device *device,
unsigned state_size = clear_color_state_size + 4;
/* We only need to track compression on CCS_E surfaces. */
if (image->planes[plane].aux_usage == ISL_AUX_USAGE_CCS_E) {
if (isl_aux_usage_has_ccs_e(image->planes[plane].aux_usage)) {
if (image->vk.image_type == VK_IMAGE_TYPE_3D) {
for (uint32_t l = 0; l < image->vk.mip_levels; l++)
state_size += u_minify(image->vk.extent.depth, l) * 4;
@@ -757,7 +757,10 @@ add_aux_surface_if_supported(struct anv_device *device,
if (anv_formats_ccs_e_compatible(device->info, image->vk.create_flags,
image->vk.format, image->vk.tiling,
image->vk.usage, fmt_list)) {
image->planes[plane].aux_usage = ISL_AUX_USAGE_CCS_E;
image->planes[plane].aux_usage =
intel_needs_workaround(device->info, 14010672564) ?
ISL_AUX_USAGE_GFX12_CCS_E :
ISL_AUX_USAGE_CCS_E;
} else if (device->info->ver >= 12) {
anv_perf_warn(VK_LOG_OBJS(&image->vk.base),
"The CCS_D aux mode is not yet handled on "
@@ -1923,6 +1926,7 @@ VkResult anv_BindImageMemory2(
image->planes[p].aux_usage = ISL_AUX_USAGE_HIZ;
} else {
assert(image->planes[p].aux_usage == ISL_AUX_USAGE_CCS_E ||
image->planes[p].aux_usage == ISL_AUX_USAGE_GFX12_CCS_E ||
image->planes[p].aux_usage == ISL_AUX_USAGE_STC_CCS);
image->planes[p].aux_usage = ISL_AUX_USAGE_NONE;
}
@@ -2164,6 +2168,7 @@ anv_layout_to_aux_state(const struct intel_device_info * const devinfo,
break;
case ISL_AUX_USAGE_CCS_E:
case ISL_AUX_USAGE_GFX12_CCS_E:
case ISL_AUX_USAGE_STC_CCS:
break;
@@ -2197,6 +2202,7 @@ anv_layout_to_aux_state(const struct intel_device_info * const devinfo,
}
case ISL_AUX_USAGE_CCS_E:
case ISL_AUX_USAGE_GFX12_CCS_E:
if (aux_supported) {
assert(clear_supported);
return ISL_AUX_STATE_COMPRESSED_CLEAR;
@@ -2350,7 +2356,8 @@ anv_layout_to_fast_clear_type(const struct intel_device_info * const devinfo,
*/
return ANV_FAST_CLEAR_DEFAULT_VALUE;
} else if (image->planes[plane].aux_usage == ISL_AUX_USAGE_MCS ||
image->planes[plane].aux_usage == ISL_AUX_USAGE_CCS_E) {
image->planes[plane].aux_usage == ISL_AUX_USAGE_CCS_E ||
image->planes[plane].aux_usage == ISL_AUX_USAGE_GFX12_CCS_E) {
if (devinfo->ver >= 11) {
/* The image might not support non zero fast clears when mutable. */
if (!image->planes[plane].can_non_zero_fast_clear)
+1 -1
View File
@@ -3893,7 +3893,7 @@ anv_image_get_compression_state_addr(const struct anv_device *device,
assert(level < anv_image_aux_levels(image, aspect));
assert(array_layer < anv_image_aux_layers(image, aspect, level));
UNUSED uint32_t plane = anv_image_aspect_to_plane(image, aspect);
assert(image->planes[plane].aux_usage == ISL_AUX_USAGE_CCS_E);
assert(isl_aux_usage_has_ccs_e(image->planes[plane].aux_usage));
/* Relative to start of the plane's fast clear memory range */
uint32_t offset;
+4 -4
View File
@@ -562,7 +562,7 @@ set_image_compressed_bit(struct anv_cmd_buffer *cmd_buffer,
const uint32_t plane = anv_image_aspect_to_plane(image, aspect);
/* We only have compression tracking for CCS_E */
if (image->planes[plane].aux_usage != ISL_AUX_USAGE_CCS_E)
if (!isl_aux_usage_has_ccs_e(image->planes[plane].aux_usage))
return;
for (uint32_t a = 0; a < layer_count; a++) {
@@ -968,7 +968,7 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer,
must_init_aux_surface = true;
} else {
assert(image->planes[plane].aux_usage == ISL_AUX_USAGE_CCS_E);
assert(isl_aux_usage_has_ccs_e(image->planes[plane].aux_usage));
/* We can start using the CCS immediately without ambiguating. The
* two conditions that enable this are:
@@ -1160,8 +1160,8 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer,
if (final_fast_clear < initial_fast_clear)
resolve_op = ISL_AUX_OP_PARTIAL_RESOLVE;
if (initial_aux_usage == ISL_AUX_USAGE_CCS_E &&
final_aux_usage != ISL_AUX_USAGE_CCS_E)
if (isl_aux_usage_has_ccs_e(initial_aux_usage) &&
!isl_aux_usage_has_ccs_e(final_aux_usage))
resolve_op = ISL_AUX_OP_FULL_RESOLVE;
if (resolve_op == ISL_AUX_OP_NONE)