{
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");
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
};
/* 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;
}
#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) {
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);
<value name="Always" value="7"/>
</enum>
+ <enum name="Stencil Op">
+ <value name="Keep" value="0"/>
+ <value name="Replace" value="1"/>
+ <value name="Zero" value="2"/>
+ <value name="Invert" value="3"/>
+ <value name="Incr Wrap" value="4"/>
+ <value name="Decr Wrap" value="5"/>
+ <value name="Incr Sat" value="6"/>
+ <value name="Decr Sat" value="7"/>
+ </enum>
+
</panxml>
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 = {