From: Boris Brezillon Date: Fri, 9 Oct 2020 12:00:28 +0000 (+0200) Subject: panfrost: Fix fixed-function blend on bifrost X-Git-Tag: upstream/21.0.0~3697 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8326ceafbd8903b69e211ec6449ecdb83efc761;p=platform%2Fupstream%2Fmesa.git panfrost: Fix fixed-function blend on bifrost The conversion from a 32b float to a 16b fixed-point number was wrong. Fixes: 8389976b7c09 ("panfrost: XML-ify the blend descriptors") Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 52f3abc..e95e414 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -311,7 +311,7 @@ panfrost_emit_bifrost_blend(struct panfrost_batch *batch, cfg.bifrost.equation = blend[i].equation.equation; /* Fixed point constant */ - u16 constant = blend[i].equation.constant / ((1 << chan_size) - 1); + u16 constant = blend[i].equation.constant * ((1 << chan_size) - 1); constant <<= 16 - chan_size; cfg.bifrost.constant = constant;