From: Alyssa Rosenzweig Date: Wed, 5 Aug 2020 22:47:52 +0000 (-0400) Subject: panfrost: XMLify mali_func X-Git-Url: https://git.libre-soc.org/?p=mesa.git;a=commitdiff_plain;h=d182a6057fd2288210a2f623d480f8619fb32c7f panfrost: XMLify mali_func Signed-off-by: Alyssa Rosenzweig Reviewed-by: Tomeu Vizoso Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 6eedf888fbd..f155f619128 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -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; diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h index cdfc6ccc97a..e8f7aaaa312 100644 --- a/src/panfrost/include/panfrost-job.h +++ b/src/panfrost/include/panfrost-job.h @@ -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) diff --git a/src/panfrost/lib/decode.c b/src/panfrost/lib/decode.c index 6d13333d83a..69f995aa5cd 100644 --- a/src/panfrost/lib/decode.c +++ b/src/panfrost/lib/decode.c @@ -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); diff --git a/src/panfrost/lib/midgard.xml b/src/panfrost/lib/midgard.xml index 010f8797d20..b7558146fe3 100644 --- a/src/panfrost/lib/midgard.xml +++ b/src/panfrost/lib/midgard.xml @@ -27,4 +27,15 @@ + + + + + + + + + + +