From 9cdd32257fbeaa927668beec503ad130f86168e5 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 15 Jun 2022 16:03:32 -0400 Subject: [PATCH] panfrost: Add tristate_is_defined helper This is useful to ensure that the tri-state has been set. It could be inlined, but the tri-state structure is designed to be opaque so this matches better. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_job.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h index 49dedf84d8b..7ca6fe552a6 100644 --- a/src/gallium/drivers/panfrost/pan_job.h +++ b/src/gallium/drivers/panfrost/pan_job.h @@ -79,6 +79,16 @@ pan_tristate_get(struct pan_tristate state) return (state.v == PAN_TRISTATE_TRUE); } +/* + * Check whether a tristate has a defined value (not PAN_TRISTATE_DONTCARE). If + * true, pan_tristate_get will return a defined value. + */ +static inline bool +pan_tristate_is_defined(struct pan_tristate state) +{ + return (state.v != PAN_TRISTATE_DONTCARE); +} + /* A panfrost_batch corresponds to a bound FBO we're rendering to, * collecting over multiple draws. */