Mesa (main): util/format: Add PIPE_FORMAT_Y8_UNORM as an "other" layout format

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 22 11:52:10 UTC 2021


Module: Mesa
Branch: main
Commit: e0a74c7cad5c37ed91d87a4273affb6fd6ad38f4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e0a74c7cad5c37ed91d87a4273affb6fd6ad38f4

Author: Matt Turner <mattst88 at gmail.com>
Date:   Wed Sep  1 16:03:39 2021 -0700

util/format: Add PIPE_FORMAT_Y8_UNORM as an "other" layout format

freedreno has a different layout for tiled Y8 planes from normal R8
textures, so we need to be able to talk about them separately.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6792>

---

 src/gallium/include/pipe/p_format.h | 1 +
 src/util/format/u_format.csv        | 4 ++++
 src/util/format/u_format_table.py   | 1 +
 3 files changed, 6 insertions(+)

diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h
index a697cd5edc1..fde4dd24b32 100644
--- a/src/gallium/include/pipe/p_format.h
+++ b/src/gallium/include/pipe/p_format.h
@@ -505,6 +505,7 @@ enum pipe_format {
 
    PIPE_FORMAT_R8_G8B8_420_UNORM,
    PIPE_FORMAT_R8_G8_B8_420_UNORM,
+   PIPE_FORMAT_Y8_UNORM,
 
    PIPE_FORMAT_B8G8R8X8_SNORM,
    PIPE_FORMAT_B8G8R8X8_UINT,
diff --git a/src/util/format/u_format.csv b/src/util/format/u_format.csv
index 8468f33bef2..7c505f52b0f 100644
--- a/src/util/format/u_format.csv
+++ b/src/util/format/u_format.csv
@@ -402,6 +402,10 @@ PIPE_FORMAT_NV21                  , planar2, 1, 1, 1,     ,     ,     ,     , xy
 PIPE_FORMAT_R8_G8B8_420_UNORM     , planar2, 1, 1, 1,  un8,     ,     ,     , xyzw, rgb
 PIPE_FORMAT_R8_G8_B8_420_UNORM    , planar3, 1, 1, 1,  un8,     ,     ,     , xyzw, rgb
 
+# While most of Mesa uses R8 for Y, U, and V planes, freedreno requires distinguishing
+# between tiled Y8 data and tiled R8 data.
+PIPE_FORMAT_Y8_UNORM              , other,   1, 1, 1,  un8,     ,     ,     , x001, yuv
+
 PIPE_FORMAT_Y8_U8_V8_422_UNORM    , planar3, 1, 1, 1,     ,     ,     ,     , xyzw, yuv
 PIPE_FORMAT_Y8_U8V8_422_UNORM     , planar2, 1, 1, 1,     ,     ,     ,     , xyzw, yuv
 PIPE_FORMAT_Y8_U8_V8_444_UNORM    , planar3, 1, 1, 1,     ,     ,     ,     , xyzw, yuv
diff --git a/src/util/format/u_format_table.py b/src/util/format/u_format_table.py
index 8e7691d0675..32b45fe4739 100644
--- a/src/util/format/u_format_table.py
+++ b/src/util/format/u_format_table.py
@@ -110,6 +110,7 @@ def has_access(format):
         'y16_u16_v16_444_unorm',
         'r8_g8b8_420_unorm',
         'r8_g8_b8_420_unorm',
+        'y8_unorm',
     ]
     if format.short_name() in noaccess_formats:
         return False



More information about the mesa-commit mailing list