etnaviv: drop translate_blend(..)

PIPE_BLEND_* matches 1:1 the hardware defines.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4187>
This commit is contained in:
Christian Gmeiner
2020-06-06 12:28:13 +02:00
committed by Marge Bot
parent 9f1cf0e491
commit 7ec2582087
2 changed files with 9 additions and 22 deletions
+9 -2
View File
@@ -43,6 +43,13 @@ etna_blend_state_create(struct pipe_context *pctx,
struct etna_blend_state *co = CALLOC_STRUCT(etna_blend_state);
bool alpha_enable, logicop_enable;
/* pipe_blend_func happens to match the hardware. */
STATIC_ASSERT(PIPE_BLEND_ADD == BLEND_EQ_ADD);
STATIC_ASSERT(PIPE_BLEND_SUBTRACT == BLEND_EQ_SUBTRACT);
STATIC_ASSERT(PIPE_BLEND_REVERSE_SUBTRACT == BLEND_EQ_REVERSE_SUBTRACT);
STATIC_ASSERT(PIPE_BLEND_MIN == BLEND_EQ_MIN);
STATIC_ASSERT(PIPE_BLEND_MAX == BLEND_EQ_MAX);
if (!co)
return NULL;
@@ -79,8 +86,8 @@ etna_blend_state_create(struct pipe_context *pctx,
VIVS_PE_ALPHA_CONFIG_SRC_FUNC_ALPHA(translate_blend_factor(rt0->alpha_src_factor)) |
VIVS_PE_ALPHA_CONFIG_DST_FUNC_COLOR(translate_blend_factor(rt0->rgb_dst_factor)) |
VIVS_PE_ALPHA_CONFIG_DST_FUNC_ALPHA(translate_blend_factor(rt0->alpha_dst_factor)) |
VIVS_PE_ALPHA_CONFIG_EQ_COLOR(translate_blend(rt0->rgb_func)) |
VIVS_PE_ALPHA_CONFIG_EQ_ALPHA(translate_blend(rt0->alpha_func));
VIVS_PE_ALPHA_CONFIG_EQ_COLOR(rt0->rgb_func) |
VIVS_PE_ALPHA_CONFIG_EQ_ALPHA(rt0->alpha_func);
} else {
co->PE_ALPHA_CONFIG = 0;
}
@@ -113,26 +113,6 @@ translate_stencil_op(unsigned stencil_op)
}
}
static inline uint32_t
translate_blend(unsigned blend)
{
switch (blend) {
case PIPE_BLEND_ADD:
return BLEND_EQ_ADD;
case PIPE_BLEND_SUBTRACT:
return BLEND_EQ_SUBTRACT;
case PIPE_BLEND_REVERSE_SUBTRACT:
return BLEND_EQ_REVERSE_SUBTRACT;
case PIPE_BLEND_MIN:
return BLEND_EQ_MIN;
case PIPE_BLEND_MAX:
return BLEND_EQ_MAX;
default:
DBG("Unhandled blend: %i", blend);
return ETNA_NO_MATCH;
}
}
static inline uint32_t
translate_blend_factor(unsigned blend_factor)
{