intel/isl: Add YUV format info for the aux-map
* Define ISL equivalents for the P010, P012, and P016 formats.
* Add aux-map encodings for the YUV formats iris will soon support.
v2. Replace &&'s with ||'s in isl_format_is_planar() (Lionel)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6486>
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index 8e3d408..1f37971 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -2980,6 +2980,12 @@
case ISL_FORMAT_R8_SINT: return 0x1C;
case ISL_FORMAT_R8_UINT: return 0x1D;
case ISL_FORMAT_A8_UNORM: return 0xA;
+ case ISL_FORMAT_PLANAR_420_8: return 0xF;
+ case ISL_FORMAT_PLANAR_420_10: return 0x7;
+ case ISL_FORMAT_PLANAR_420_12: return 0x8;
+ case ISL_FORMAT_PLANAR_420_16: return 0x8;
+ case ISL_FORMAT_YCRCB_NORMAL: return 0x3;
+ case ISL_FORMAT_YCRCB_SWAPY: return 0xB;
default:
unreachable("Unsupported aux-map format!");
return 0;
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
index fc36085..871b98d 100644
--- a/src/intel/isl/isl.h
+++ b/src/intel/isl/isl.h
@@ -298,6 +298,7 @@
ISL_FORMAT_BC7_UNORM_SRGB = 419,
ISL_FORMAT_BC6H_UF16 = 420,
ISL_FORMAT_PLANAR_420_8 = 421,
+ ISL_FORMAT_PLANAR_420_16 = 422,
ISL_FORMAT_R8G8B8_UNORM_SRGB = 424,
ISL_FORMAT_ETC1_RGB8 = 425,
ISL_FORMAT_ETC2_RGB8 = 426,
@@ -375,6 +376,10 @@
* actual hardware formats *must* come before these in the list.
*/
+ /* Formats for the aux-map */
+ ISL_FORMAT_PLANAR_420_10,
+ ISL_FORMAT_PLANAR_420_12,
+
/* Formats for auxiliary surfaces */
ISL_FORMAT_HIZ,
ISL_FORMAT_MCS_2X,
@@ -1633,7 +1638,10 @@
static inline bool
isl_format_is_planar(enum isl_format fmt)
{
- return fmt == ISL_FORMAT_PLANAR_420_8;
+ return fmt == ISL_FORMAT_PLANAR_420_8 ||
+ fmt == ISL_FORMAT_PLANAR_420_10 ||
+ fmt == ISL_FORMAT_PLANAR_420_12 ||
+ fmt == ISL_FORMAT_PLANAR_420_16;
}
static inline bool
diff --git a/src/intel/isl/isl_format_layout.csv b/src/intel/isl/isl_format_layout.csv
index 6d80111..a9bbf3f 100644
--- a/src/intel/isl/isl_format_layout.csv
+++ b/src/intel/isl/isl_format_layout.csv
@@ -258,6 +258,9 @@
BC7_UNORM_SRGB , 128, 4, 4, 1, un8, un8, un8, un8, , , , , srgb, bptc
BC6H_UF16 , 128, 4, 4, 1, uf16, uf16, uf16, , , , , , linear, bptc
PLANAR_420_8 , 0, 0, 0, 0, , , , , , , , , yuv,
+PLANAR_420_10 , 0, 0, 0, 0, , , , , , , , , yuv,
+PLANAR_420_12 , 0, 0, 0, 0, , , , , , , , , yuv,
+PLANAR_420_16 , 0, 0, 0, 0, , , , , , , , , yuv,
R8G8B8_UNORM_SRGB , 24, 1, 1, 1, un8, un8, un8, , , , , rgb, srgb,
ETC1_RGB8 , 64, 4, 4, 1, un8, un8, un8, , , , , , linear, etc1
ETC2_RGB8 , 64, 4, 4, 1, un8, un8, un8, , , , , , linear, etc2