From: Alyssa Rosenzweig Date: Tue, 20 Aug 2019 21:03:18 +0000 (-0700) Subject: pan/decode: Don't print the default swizzle X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ac090b365f1643376d87e0f813eb21cdf48e1b9c;p=mesa.git pan/decode: Don't print the default swizzle It's just noise. Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c index e4c1f8f7bc2..95f3d25fc01 100644 --- a/src/panfrost/pandecode/decode.c +++ b/src/panfrost/pandecode/decode.c @@ -1426,8 +1426,17 @@ pandecode_validate_format_swizzle(enum mali_format fmt, unsigned swizzle) return false; } - /* TODO: Trivial swizzle check */ - return false; + /* Check for the default non-swizzling swizzle so we can suppress + * useless printing for the defaults */ + + unsigned default_swizzles[4] = { + MALI_CHANNEL_RED | (MALI_CHANNEL_ZERO << 3) | (MALI_CHANNEL_ZERO << 6) | (MALI_CHANNEL_ONE << 9), + MALI_CHANNEL_RED | (MALI_CHANNEL_GREEN << 3) | (MALI_CHANNEL_ZERO << 6) | (MALI_CHANNEL_ONE << 9), + MALI_CHANNEL_RED | (MALI_CHANNEL_GREEN << 3) | (MALI_CHANNEL_BLUE << 6) | (MALI_CHANNEL_ONE << 9), + MALI_CHANNEL_RED | (MALI_CHANNEL_GREEN << 3) | (MALI_CHANNEL_BLUE << 6) | (MALI_CHANNEL_ALPHA << 9) + }; + + return (swizzle == default_swizzles[nr_comp - 1]); } static int