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 <boris.brezillon@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41151>
This commit is contained in:
Erik Faye-Lund 2026-04-24 10:49:43 +02:00 committed by Marge Bot
parent b205c7d592
commit 36fc68ffa1
2 changed files with 1 additions and 17 deletions

View file

@ -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

View file

@ -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':