From: "Jernej Škrabec" <jernej.skrabec@siol.net>
To: mripard@kernel.org, wens@csie.org,
Roman Stratiienko <r.stratiienko@gmail.com>
Cc: airlied@linux.ie, Roman Stratiienko <r.stratiienko@gmail.com>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 4/4] RFC: drm/sun4i: Process alpha channel of most bottom layer
Date: Tue, 24 Mar 2020 18:58:56 +0100 [thread overview]
Message-ID: <2979815.5fSG56mABF@jernej-laptop> (raw)
In-Reply-To: <20200302103138.17916-5-r.stratiienko@gmail.com>
Hi!
Dne ponedeljek, 02. marec 2020 ob 11:31:38 CET je Roman Stratiienko
napisal(a):
> Allwinner display engine blender consists of 3 pipelined blending units.
>
> PIPE0->\
> BLD0-\
> PIPE1->/ BLD1-\
> PIPE2->------/ BLD2->OUT
> PIPE3->------------/
>
> This pipeline produces incorrect composition if PIPE0 buffer has alpha.
I always thought that if bottom layer has alpha, it's blended with background
color, which is set to opaque black. If that is not the case, can you solve
this by changing blending formula located in BLD control registers (offsets
0x90, 0x94, 0x98 and 0x9c)?
Best regards,
Jernej
> Correct solution is to add one more blending step and mix PIPE0 with
> background, but it is not supported by the hardware.
>
> Use premultiplied alpha buffer of PIPE0 overlay channel as is.
> In this case we got same effect as mixing PIPE0 with black background.
>
> Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
>
> ---
>
> v4:
> - Initial version, depends on other unmerged patches in the patchset.
> ---
> drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 2 +-
> drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
> b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c index dd6145f80c36..d94f4d8b9128
> 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
> @@ -106,7 +106,7 @@ static void sun8i_ui_layer_update_alpha(struct
> sun8i_mixer *mixer, int channel, regmap_update_bits(mixer->engine.regs,
> SUN8I_MIXER_BLEND_PREMULTIPLY(bld_base),
> SUN8I_MIXER_BLEND_PREMULTIPLY_EN(zpos),
> - SUN8I_MIXER_BLEND_PREMULTIPLY_EN(zpos));
> + zpos ?
SUN8I_MIXER_BLEND_PREMULTIPLY_EN(zpos) : 0);
> }
>
> static int sun8i_ui_layer_update_coord(struct sun8i_mixer *mixer, int
> channel, diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
> b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index e6d8a539614f..68a6843db4ab
> 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
> @@ -108,7 +108,7 @@ static void sun8i_vi_layer_update_alpha(struct
> sun8i_mixer *mixer, int channel, regmap_update_bits(mixer->engine.regs,
> SUN8I_MIXER_BLEND_PREMULTIPLY(bld_base),
> SUN8I_MIXER_BLEND_PREMULTIPLY_EN(zpos),
> - (mixer->cfg->is_de3) ?
> + (zpos != 0 && mixer->cfg->is_de3) ?
>
SUN8I_MIXER_BLEND_PREMULTIPLY_EN(zpos) : 0);
>
> }
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2020-03-24 17:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <.>
2020-03-02 10:31 ` .[PATCH v4 0/4] drm/sun4i: Improve alpha processing Roman Stratiienko
2020-03-02 10:31 ` [PATCH v4 1/4] drm/sun4i: Add alpha property for sun8i UI layer Roman Stratiienko
2020-03-02 10:31 ` [PATCH v4 2/4] drm/sun4i: Add alpha property for sun8i and sun50i VI layer Roman Stratiienko
2020-03-02 10:31 ` [PATCH v4 3/4] drm/sun4i: Add support for premulti/coverage blending mode handling Roman Stratiienko
2020-03-24 17:49 ` Jernej Škrabec
2020-03-02 10:31 ` [PATCH v4 4/4] RFC: drm/sun4i: Process alpha channel of most bottom layer Roman Stratiienko
2020-03-24 15:36 ` Maxime Ripard
2020-03-24 17:58 ` Jernej Škrabec [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2979815.5fSG56mABF@jernej-laptop \
--to=jernej.skrabec@siol.net \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=r.stratiienko@gmail.com \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox