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>
This commit is contained in:
Nanley Chery 2020-07-23 16:09:59 -07:00 committed by Marge Bot
parent 1ea3a54366
commit 9efd71466d
3 changed files with 18 additions and 1 deletions

View File

@ -2980,6 +2980,12 @@ isl_format_get_aux_map_encoding(enum isl_format format)
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;

View File

@ -298,6 +298,7 @@ enum isl_format {
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 @@ enum isl_format {
* 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 @@ isl_format_has_bc_compression(enum isl_format fmt)
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

View File

@ -258,6 +258,9 @@ BC7_UNORM , 128, 4, 4, 1, un8, un8, un8, un8, ,
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

Can't render this file because it contains an unexpected character in line 4 and column 65.