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 <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17068>
This commit is contained in:
Alyssa Rosenzweig 2022-06-15 16:03:32 -04:00 committed by Marge Bot
parent 950d27f9bf
commit 9cdd32257f

View file

@ -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. */