panfrost: Add MALI_EXTRACT_INDEX helper
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 27 Oct 2020 18:23:12 +0000 (14:23 -0400)
committerMarge Bot <eric+marge@anholt.net>
Sat, 31 Oct 2020 14:09:18 +0000 (14:09 +0000)
Extracts the 8-bit index from a 22-bit pixel format.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Christian Hewitt <christianshewitt@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7352>

src/panfrost/include/panfrost-job.h

index 5fbe31c..f585d9e 100644 (file)
@@ -96,6 +96,8 @@ typedef uint64_t mali_ptr;
 #define MALI_CHANNEL_FLOAT 7
 #define MALI_EXTRACT_BITS(fmt) (fmt & 0x7)
 
+#define MALI_EXTRACT_INDEX(pixfmt) (((pixfmt) >> 12) & 0xFF)
+
 /* The raw Midgard blend payload can either be an equation or a shader
  * address, depending on the context */