Module: Mesa Branch: main Commit: b223d33141f7dc2a35ec394f808d686fd27f2cf2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b223d33141f7dc2a35ec394f808d686fd27f2cf2
Author: Sagar Ghuge <[email protected]> Date: Tue Nov 7 14:47:50 2023 -0800 blorp: Handle stencil buffer compression on blitter engine XY_BLOCK_COPY_BLT and XY_FAST_COLOR_BLT instruction supports AUX_CCS surface mode. Stencil buffer compression is stencil data with CCS so we can easily support that on blitter engine. Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26167> --- src/intel/blorp/blorp_blit.c | 1 + src/intel/blorp/blorp_genX_exec.h | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c index 425e0aa02ce..21eadd93803 100644 --- a/src/intel/blorp/blorp_blit.c +++ b/src/intel/blorp/blorp_blit.c @@ -2451,6 +2451,7 @@ blorp_blitter_supports_aux(const struct intel_device_info *devinfo, return true; case ISL_AUX_USAGE_CCS_E: case ISL_AUX_USAGE_FCV_CCS_E: + case ISL_AUX_USAGE_STC_CCS: return devinfo->verx10 >= 125; default: return false; diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h index 9e269f9c7dd..840c41f2880 100644 --- a/src/intel/blorp/blorp_genX_exec.h +++ b/src/intel/blorp/blorp_genX_exec.h @@ -2380,6 +2380,7 @@ xy_aux_mode(const struct brw_blorp_surface_info *info) switch (info->aux_usage) { case ISL_AUX_USAGE_CCS_E: case ISL_AUX_USAGE_FCV_CCS_E: + case ISL_AUX_USAGE_STC_CCS: return XY_CCS_E; case ISL_AUX_USAGE_NONE: return XY_NONE; @@ -2476,7 +2477,9 @@ blorp_xy_block_copy_blt(struct blorp_batch *batch, blt.DestinationMipTailStartLOD = dst_surf->miptail_start_level; blt.DestinationHorizontalAlign = isl_encode_halign(dst_align.width); blt.DestinationVerticalAlign = isl_encode_valign(dst_align.height); - blt.DestinationDepthStencilResource = false; + /* XY_BLOCK_COPY_BLT only supports AUX_CCS. */ + blt.DestinationDepthStencilResource = + params->dst.aux_usage == ISL_AUX_USAGE_STC_CCS; blt.DestinationTargetMemory = params->dst.addr.local_hint ? XY_MEM_LOCAL : XY_MEM_SYSTEM; @@ -2511,7 +2514,9 @@ blorp_xy_block_copy_blt(struct blorp_batch *batch, blt.SourceMipTailStartLOD = src_surf->miptail_start_level; blt.SourceHorizontalAlign = isl_encode_halign(src_align.width); blt.SourceVerticalAlign = isl_encode_valign(src_align.height); - blt.SourceDepthStencilResource = false; + /* XY_BLOCK_COPY_BLT only supports AUX_CCS. */ + blt.SourceDepthStencilResource = + params->src.aux_usage == ISL_AUX_USAGE_STC_CCS; blt.SourceTargetMemory = params->src.addr.local_hint ? XY_MEM_LOCAL : XY_MEM_SYSTEM; @@ -2594,7 +2599,9 @@ blorp_xy_fast_color_blit(struct blorp_batch *batch, blt.DestinationMipTailStartLOD = dst_surf->miptail_start_level; blt.DestinationHorizontalAlign = isl_encode_halign(dst_align.width); blt.DestinationVerticalAlign = isl_encode_valign(dst_align.height); - blt.DestinationDepthStencilResource = false; + /* XY_FAST_COLOR_BLT only supports AUX_CCS. */ + blt.DestinationDepthStencilResource = + params->dst.aux_usage == ISL_AUX_USAGE_STC_CCS; blt.DestinationTargetMemory = params->dst.addr.local_hint ? XY_MEM_LOCAL : XY_MEM_SYSTEM;
