From 36fc68ffa1f62cdedcb287a96a82f74549409258 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 24 Apr 2026 10:49:43 +0200 Subject: [PATCH] util/format: make Y8_UNORM an alias of Y8_400_UNORM The definiton of Y8_UNORM and Y8_400_UNORM are already identical, with the only real difference being that pipe_format_to_chroma_format() does not return R8 for Y8_UNORM. But Y8_UNORM is only used by freedreno, the intel drivers and virgl, none of which doesn't even call pipe_format_to_chroma_format() in the first place, so this shouldn't matter. Reviewed-by: Boris Brezillon Reviewed-by: Eric R. Smith Part-of: --- src/util/format/u_format.yaml | 10 +--------- src/util/format/u_format_table.py | 8 -------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/util/format/u_format.yaml b/src/util/format/u_format.yaml index ff0afde0fd8..bea68f27f14 100644 --- a/src/util/format/u_format.yaml +++ b/src/util/format/u_format.yaml @@ -2033,6 +2033,7 @@ channels: [] swizzles: [X, Y, Z, W] - name: Y8_400_UNORM + alias: Y8_UNORM layout: other colorspace: YUV block: {width: 1, height: 1, depth: 1} @@ -2183,15 +2184,6 @@ channels: [X120] swizzles: [X, Y, Z, 1] -# While most of Mesa uses R8 for Y, U, and V planes, freedreno requires -# distinguishing between tiled Y8 data and tiled R8 data. -- name: Y8_UNORM - layout: other - colorspace: YUV - block: {width: 1, height: 1, depth: 1} - channels: [UN8] - swizzles: [X, 0, 0, 1] - # 10-bit channels stored in 16-bit containers (upper 10 bits used, # lower 6 bits are padding). - name: X6R10X6G10X6B10X6A10_UNORM diff --git a/src/util/format/u_format_table.py b/src/util/format/u_format_table.py index 48a25ae623d..a5a70eb60be 100644 --- a/src/util/format/u_format_table.py +++ b/src/util/format/u_format_table.py @@ -142,7 +142,6 @@ def has_access(format): 'r8_g8_b8_444_unorm', 'r8g8b8_420_unorm_packed', 'r10g10b10_420_unorm_packed', - 'y8_unorm', 'y8u8v8_420_unorm_packed', 'y10u10v10_420_unorm_packed', 'g8_b8r8_444_unorm', @@ -437,9 +436,6 @@ def write_get_plane_format(formats): 'X4B12X4R12': 'X4R12X4G12', } - # On some YUV formats, we don't want RGB lowering - no_rgb_lowering = ['Y8_UNORM'] - print('static inline enum pipe_format', file=sys.stdout3) print('util_format_get_plane_format(enum pipe_format format, unsigned plane)', file=sys.stdout3) print('{', file=sys.stdout3) @@ -449,10 +445,6 @@ def write_get_plane_format(formats): if f.layout not in ['planar2', 'planar3'] and f.colorspace != 'YUV': continue - if f.short_name().upper() in no_rgb_lowering: - unhandled_formats += [f.name] - continue - nplanes = int(f.layout[-1]) if f.layout.startswith('planar') else 1 planes = f.short_name().upper().split('_') if planes[-1] == 'PACKED':