blorp: Use R8G8_UINT for YCRCB_* formats with CCS
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Mon, 14 Aug 2023 18:50:18 +0000 (13:50 -0500)
committerMarge Bot <emma+marge@anholt.net>
Mon, 14 Aug 2023 23:44:19 +0000 (23:44 +0000)
BLORP uses the get_ccs_compatible_copy_format() based on whether or not
ISL claims the format supports CCS_E, not whether or not CCS_E is used
on the image.  This is probably a good thing as it improves consistency.
However, it means that we need CCS-compatible formats for YCRCB_*
formats even if we never use them with CCS_E enabled.  In practice,
these do actually seem to work according to the Vulkan CTS but coverage
is likely far less than perfect.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24619>

src/intel/blorp/blorp_blit.c

index baa1535..57aced3 100644 (file)
@@ -2740,6 +2740,18 @@ get_ccs_compatible_copy_format(const struct isl_format_layout *fmtl)
    case ISL_FORMAT_R8G8_UINT:
       return ISL_FORMAT_R8G8_UINT;
 
+   case ISL_FORMAT_YCRCB_NORMAL:
+   case ISL_FORMAT_YCRCB_SWAPY:
+   case ISL_FORMAT_YCRCB_SWAPUV:
+   case ISL_FORMAT_YCRCB_SWAPUVY:
+      /* Tiger Lake starts claiming CCS_E support for certain YCRCB formats.
+       * BLORP chooses to take the CCS-compatible format path whenever ISL
+       * claims CCS_E support on a format, not when CCS_E is actually used.
+       * Therefore, if these formats are going to be used with BLORP, we need
+       * a CCS-compatible format. R8G8_UINT seems as good as any.
+       */
+      return ISL_FORMAT_R8G8_UINT;
+
    case ISL_FORMAT_B5G5R5X1_UNORM:
    case ISL_FORMAT_B5G5R5X1_UNORM_SRGB:
    case ISL_FORMAT_B5G5R5A1_UNORM: