diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index f155f619128..c1a5ebbf3ea 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -387,28 +387,28 @@ panfrost_translate_stencil_op(enum pipe_stencil_op in)
{
switch (in) {
case PIPE_STENCIL_OP_KEEP:
- return MALI_STENCIL_KEEP;
+ return MALI_STENCIL_OP_KEEP;
case PIPE_STENCIL_OP_ZERO:
- return MALI_STENCIL_ZERO;
+ return MALI_STENCIL_OP_ZERO;
case PIPE_STENCIL_OP_REPLACE:
- return MALI_STENCIL_REPLACE;
+ return MALI_STENCIL_OP_REPLACE;
case PIPE_STENCIL_OP_INCR:
- return MALI_STENCIL_INCR;
+ return MALI_STENCIL_OP_INCR_SAT;
case PIPE_STENCIL_OP_DECR:
- return MALI_STENCIL_DECR;
+ return MALI_STENCIL_OP_DECR_SAT;
case PIPE_STENCIL_OP_INCR_WRAP:
- return MALI_STENCIL_INCR_WRAP;
+ return MALI_STENCIL_OP_INCR_WRAP;
case PIPE_STENCIL_OP_DECR_WRAP:
- return MALI_STENCIL_DECR_WRAP;
+ return MALI_STENCIL_OP_DECR_WRAP;
case PIPE_STENCIL_OP_INVERT:
- return MALI_STENCIL_INVERT;
+ return MALI_STENCIL_OP_INVERT;
default:
unreachable("Invalid stencil op");
@@ -585,9 +585,9 @@ panfrost_frag_meta_zsa_update(struct panfrost_context *ctx,
struct pipe_stencil_state default_stencil = {
.enabled = 0,
.func = PIPE_FUNC_ALWAYS,
- .fail_op = MALI_STENCIL_KEEP,
- .zfail_op = MALI_STENCIL_KEEP,
- .zpass_op = MALI_STENCIL_KEEP,
+ .fail_op = PIPE_STENCIL_OP_KEEP,
+ .zfail_op = PIPE_STENCIL_OP_KEEP,
+ .zpass_op = PIPE_STENCIL_OP_KEEP,
.writemask = 0xFF,
.valuemask = 0xFF
};
diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h
index e8f7aaaa312..99d3d85f1bc 100644
--- a/src/panfrost/include/panfrost-job.h
+++ b/src/panfrost/include/panfrost-job.h
@@ -88,17 +88,6 @@ typedef uint64_t mali_ptr;
/* Stencil test state is all encoded in a single u32, just with a lot of
* enums... */
-enum mali_stencil_op {
- MALI_STENCIL_KEEP = 0,
- MALI_STENCIL_REPLACE = 1,
- MALI_STENCIL_ZERO = 2,
- MALI_STENCIL_INVERT = 3,
- MALI_STENCIL_INCR_WRAP = 4,
- MALI_STENCIL_DECR_WRAP = 5,
- MALI_STENCIL_INCR = 6,
- MALI_STENCIL_DECR = 7
-};
-
struct mali_stencil_test {
unsigned ref : 8;
unsigned mask : 8;
diff --git a/src/panfrost/lib/decode.c b/src/panfrost/lib/decode.c
index 69f995aa5cd..66bd6827bf8 100644
--- a/src/panfrost/lib/decode.c
+++ b/src/panfrost/lib/decode.c
@@ -480,28 +480,6 @@ pandecode_msaa_mode(enum mali_msaa_mode mode)
}
#undef DEFINE_CASE
-#define DEFINE_CASE(name) case MALI_STENCIL_ ## name: return "MALI_STENCIL_" #name
-static char *
-pandecode_stencil_op(enum mali_stencil_op op)
-{
- switch (op) {
- DEFINE_CASE(KEEP);
- DEFINE_CASE(REPLACE);
- DEFINE_CASE(ZERO);
- DEFINE_CASE(INVERT);
- DEFINE_CASE(INCR_WRAP);
- DEFINE_CASE(DECR_WRAP);
- DEFINE_CASE(INCR);
- DEFINE_CASE(DECR);
-
- default:
- pandecode_msg("XXX: invalid stencil op %X\n", op);
- return "";
- }
-}
-
-#undef DEFINE_CASE
-
static char *pandecode_attr_mode_short(enum mali_attr_mode mode)
{
switch(mode) {
@@ -1642,9 +1620,9 @@ pandecode_stencil(const char *name, const struct mali_stencil_test *stencil)
return;
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);
+ const char *sfail = mali_stencil_op_as_str(stencil->sfail);
+ const char *dpfail = mali_stencil_op_as_str(stencil->dpfail);
+ const char *dppass = mali_stencil_op_as_str(stencil->dppass);
if (stencil->zero)
pandecode_msg("XXX: stencil zero tripped: %X\n", stencil->zero);
diff --git a/src/panfrost/lib/midgard.xml b/src/panfrost/lib/midgard.xml
index b7558146fe3..3a9351afe6e 100644
--- a/src/panfrost/lib/midgard.xml
+++ b/src/panfrost/lib/midgard.xml
@@ -38,4 +38,15 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/panfrost/lib/pan_blit.c b/src/panfrost/lib/pan_blit.c
index a9289de35f9..7d5b10de9b0 100644
--- a/src/panfrost/lib/pan_blit.c
+++ b/src/panfrost/lib/pan_blit.c
@@ -214,9 +214,9 @@ panfrost_load_midg(
struct mali_stencil_test stencil = {
.mask = 0xFF,
.func = MALI_FUNC_ALWAYS,
- .sfail = MALI_STENCIL_REPLACE,
- .dpfail = MALI_STENCIL_REPLACE,
- .dppass = MALI_STENCIL_REPLACE,
+ .sfail = MALI_STENCIL_OP_REPLACE,
+ .dpfail = MALI_STENCIL_OP_REPLACE,
+ .dppass = MALI_STENCIL_OP_REPLACE,
};
union midgard_blend replace = {