From c35194b945cec0fb005d3f2ec417152f8acede5b Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 14 May 2021 09:50:14 -0400 Subject: [PATCH] panfrost: Fix is_opaque prototype Fixes: 93824b6451a ("panfrost: Move the blend logic out of the gallium driver") Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_blend_cso.c | 2 +- src/panfrost/lib/pan_blend.c | 30 +++++++++++++--------------- src/panfrost/lib/pan_blend.h | 3 +-- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_blend_cso.c b/src/gallium/drivers/panfrost/pan_blend_cso.c index 9f30f67..c18a3a2 100644 --- a/src/gallium/drivers/panfrost/pan_blend_cso.c +++ b/src/gallium/drivers/panfrost/pan_blend_cso.c @@ -148,7 +148,7 @@ panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rti, struc struct panfrost_blend_final final = { .load_dest = pan_blend_reads_dest(pan_blend.rts[rti].equation), .equation.constant = pan_blend_get_constant(dev, &pan_blend, rti), - .opaque = pan_blend_is_opaque(&pan_blend, rti), + .opaque = pan_blend_is_opaque(pan_blend.rts[rti].equation), .no_colour = pan_blend.rts[rti].equation.color_mask == 0, }; diff --git a/src/panfrost/lib/pan_blend.c b/src/panfrost/lib/pan_blend.c index 07fbad1..59bd0d5 100644 --- a/src/panfrost/lib/pan_blend.c +++ b/src/panfrost/lib/pan_blend.c @@ -277,23 +277,21 @@ to_panfrost_function(enum blend_func blend_func, } bool -pan_blend_is_opaque(const struct pan_blend_state *state, unsigned rt) +pan_blend_is_opaque(const struct pan_blend_equation equation) { - const struct pan_blend_equation *equation = &state->rts[rt].equation; - - return equation->rgb_src_factor == BLEND_FACTOR_ZERO && - equation->rgb_invert_src_factor && - equation->rgb_dst_factor == BLEND_FACTOR_ZERO && - !equation->rgb_invert_dst_factor && - (equation->rgb_func == BLEND_FUNC_ADD || - equation->rgb_func == BLEND_FUNC_SUBTRACT) && - equation->alpha_src_factor == BLEND_FACTOR_ZERO && - equation->alpha_invert_src_factor && - equation->alpha_dst_factor == BLEND_FACTOR_ZERO && - !equation->alpha_invert_dst_factor && - (equation->alpha_func == BLEND_FUNC_ADD || - equation->alpha_func == BLEND_FUNC_SUBTRACT) && - equation->color_mask == 0xf; + return equation.rgb_src_factor == BLEND_FACTOR_ZERO && + equation.rgb_invert_src_factor && + equation.rgb_dst_factor == BLEND_FACTOR_ZERO && + !equation.rgb_invert_dst_factor && + (equation.rgb_func == BLEND_FUNC_ADD || + equation.rgb_func == BLEND_FUNC_SUBTRACT) && + equation.alpha_src_factor == BLEND_FACTOR_ZERO && + equation.alpha_invert_src_factor && + equation.alpha_dst_factor == BLEND_FACTOR_ZERO && + !equation.alpha_invert_dst_factor && + (equation.alpha_func == BLEND_FUNC_ADD || + equation.alpha_func == BLEND_FUNC_SUBTRACT) && + equation.color_mask == 0xf; } static bool diff --git a/src/panfrost/lib/pan_blend.h b/src/panfrost/lib/pan_blend.h index 09c69f3..cad8c32 100644 --- a/src/panfrost/lib/pan_blend.h +++ b/src/panfrost/lib/pan_blend.h @@ -105,8 +105,7 @@ pan_blend_can_fixed_function(const struct panfrost_device *dev, unsigned rt); bool -pan_blend_is_opaque(const struct pan_blend_state *state, - unsigned rt); +pan_blend_is_opaque(const struct pan_blend_equation eq); unsigned pan_blend_constant_mask(const struct pan_blend_state *state, -- 2.7.4