From 531b1b7511af49a6495e55998a67dbbda29763ce Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Tue, 7 Dec 2021 21:23:35 -0500 Subject: [PATCH] intel/isl: Strengthen MCS SINT format restriction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gfx7 MCS restriction for SINT formats actually applies to multisampling in general. Place the stronger restriction in the format support check and assert this in isl_surf_get_mcs_surf. Reviewed-by: Tapani Pälli Acked-by: Kenneth Graunke Part-of: --- src/intel/isl/isl.c | 15 +-------------- src/intel/isl/isl_format.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c index dcc48b74ff3..79d64a9f7de 100644 --- a/src/intel/isl/isl.c +++ b/src/intel/isl/isl.c @@ -2065,20 +2065,7 @@ isl_surf_get_mcs_surf(const struct isl_device *dev, assert(surf->dim == ISL_SURF_DIM_2D); assert(surf->levels == 1); assert(surf->logical_level0_px.depth == 1); - - /* From the Ivy Bridge PRM, Vol4 Part1 p77 ("MCS Enable"): - * - * This field must be set to 0 for all SINT MSRTs when all RT channels - * are not written - * - * In practice this means that we have to disable MCS for all signed - * integer MSAA buffers. The alternative, to disable MCS only when one - * of the render target channels is disabled, is impractical because it - * would require converting between CMS and UMS MSAA layouts on the fly, - * which is expensive. - */ - if (ISL_GFX_VER(dev) == 7 && isl_format_has_sint_channel(surf->format)) - return false; + assert(isl_format_supports_multisampling(dev->info, surf->format)); enum isl_format mcs_format; switch (surf->samples) { diff --git a/src/intel/isl/isl_format.c b/src/intel/isl/isl_format.c index 9dd5e4c1290..f634a3e75c0 100644 --- a/src/intel/isl/isl_format.c +++ b/src/intel/isl/isl_format.c @@ -900,6 +900,21 @@ isl_format_supports_multisampling(const struct intel_device_info *devinfo, * is multisampled. See also isl_surf_get_hiz_surf(). */ return devinfo->ver <= 8; + } else if (devinfo->ver == 7 && isl_format_has_sint_channel(format)) { + /* From the Ivy Bridge PRM, Vol4 Part1 p73 ("Number of Multisamples"): + * + * This field must be set to MULTISAMPLECOUNT_1 for SINT MSRTs when + * all RT channels are not written + * + * From the Ivy Bridge PRM, Vol4 Part1 p77 ("MCS Enable"): + * + * This field must be set to 0 for all SINT MSRTs when all RT channels + * are not written + * + * Disable multisampling support now as we don't handle the case when + * one of the render target channels is disabled. + */ + return false; } else if (devinfo->ver < 7 && isl_format_get_layout(format)->bpb > 64) { return false; } else if (isl_format_is_compressed(format)) {