From 1e18d9952bb4c48f8c2bc3c8df3ebb7bc1024cd8 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 27 Oct 2020 14:23:12 -0400 Subject: [PATCH] panfrost: Add MALI_EXTRACT_INDEX helper Extracts the 8-bit index from a 22-bit pixel format. Signed-off-by: Alyssa Rosenzweig Tested-by: Christian Hewitt Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/include/panfrost-job.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h index 5fbe31c0f12..f585d9ebd23 100644 --- a/src/panfrost/include/panfrost-job.h +++ b/src/panfrost/include/panfrost-job.h @@ -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 */