panfrost: XMLify mali_func

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
This commit is contained in:
Alyssa Rosenzweig 2020-08-05 18:47:52 -04:00 committed by Tomeu Vizoso
parent 32dbc80979
commit d182a6057f
4 changed files with 15 additions and 38 deletions

View file

@ -369,7 +369,7 @@ panfrost_translate_compare_func(enum pipe_compare_func in)
return MALI_FUNC_GREATER;
case PIPE_FUNC_NOTEQUAL:
return MALI_FUNC_NOTEQUAL;
return MALI_FUNC_NOT_EQUAL;
case PIPE_FUNC_GEQUAL:
return MALI_FUNC_GEQUAL;

View file

@ -53,19 +53,6 @@ typedef uint64_t mali_ptr;
#define MALI_CULL_FACE_FRONT (1 << 6)
#define MALI_CULL_FACE_BACK (1 << 7)
/* Used in stencil and depth tests */
enum mali_func {
MALI_FUNC_NEVER = 0,
MALI_FUNC_LESS = 1,
MALI_FUNC_EQUAL = 2,
MALI_FUNC_LEQUAL = 3,
MALI_FUNC_GREATER = 4,
MALI_FUNC_NOTEQUAL = 5,
MALI_FUNC_GEQUAL = 6,
MALI_FUNC_ALWAYS = 7
};
/* Flags apply to unknown2_3? */
#define MALI_HAS_MSAA (1 << 0)

View file

@ -464,27 +464,6 @@ static char *pandecode_format(enum mali_format format)
#undef DEFINE_CASE
#define DEFINE_CASE(name) case MALI_FUNC_ ## name: return "MALI_FUNC_" #name
static char *
pandecode_func(enum mali_func mode)
{
switch (mode) {
DEFINE_CASE(NEVER);
DEFINE_CASE(LESS);
DEFINE_CASE(EQUAL);
DEFINE_CASE(LEQUAL);
DEFINE_CASE(GREATER);
DEFINE_CASE(NOTEQUAL);
DEFINE_CASE(GEQUAL);
DEFINE_CASE(ALWAYS);
default:
pandecode_msg("XXX: invalid func %X\n", mode);
return "";
}
}
#undef DEFINE_CASE
#define DEFINE_CASE(name) case MALI_MSAA_ ## name: return "MALI_MSAA_" #name
static char *
pandecode_msaa_mode(enum mali_msaa_mode mode)
@ -1662,7 +1641,7 @@ pandecode_stencil(const char *name, const struct mali_stencil_test *stencil)
if (any_nonzero == 0)
return;
const char *func = pandecode_func(stencil->func);
const char *func = mali_func_as_str(stencil->func);
const char *sfail = pandecode_stencil_op(stencil->sfail);
const char *dpfail = pandecode_stencil_op(stencil->dpfail);
const char *dppass = pandecode_stencil_op(stencil->dppass);
@ -2597,7 +2576,7 @@ pandecode_samplers(mali_ptr samplers, unsigned sampler_count, int job_no, bool i
pandecode_prop("wrap_t = %s", pandecode_wrap_mode(s->wrap_t));
pandecode_prop("wrap_r = %s", pandecode_wrap_mode(s->wrap_r));
pandecode_prop("compare_func = %s", pandecode_func(s->compare_func));
pandecode_prop("compare_func = %s", mali_func_as_str(s->compare_func));
if (s->zero || s->zero2) {
pandecode_msg("XXX: sampler zero tripped\n");
@ -2750,7 +2729,7 @@ pandecode_vertex_tiler_postfix_pre(
/* We're not quite sure what these flags mean without the depth test, if anything */
if (unknown2_3 & (MALI_DEPTH_WRITEMASK | MALI_DEPTH_FUNC_MASK)) {
const char *func = pandecode_func(MALI_GET_DEPTH_FUNC(unknown2_3));
const char *func = mali_func_as_str(MALI_GET_DEPTH_FUNC(unknown2_3));
unknown2_3 &= ~MALI_DEPTH_FUNC_MASK;
pandecode_log_cont("MALI_DEPTH_FUNC(%s) | ", func);

View file

@ -27,4 +27,15 @@
<value name="Quad strip" value="15"/>
</enum>
<enum name="Func">
<value name="Never" value="0"/>
<value name="Less" value="1"/>
<value name="Equal" value="2"/>
<value name="Lequal" value="3"/>
<value name="Greater" value="4"/>
<value name="Not Equal" value="5"/>
<value name="Gequal" value="6"/>
<value name="Always" value="7"/>
</enum>
</panxml>