Skip to content

Commit

Permalink
drm/sun4i: Enable output signal premultiplication for DE2/DE3
Browse files Browse the repository at this point in the history
Otherwise alpha value is discarded, resulting incorrect pixel
apperance on the display.

This also fixes missing transparency for the most bottom layer.

Test applications and videos w/ w/o this patch are available at [1].

[1]: GloDroid/glodroid_tests#1
Signed-off-by: Roman Stratiienko <[email protected]>
  • Loading branch information
rsglobal authored and intel-lab-lkp committed Jun 5, 2022
1 parent 1cfd968 commit 8eec0dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/gpu/drm/sun4i/sun8i_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,9 @@ static void sun8i_mixer_mode_set(struct sunxi_engine *engine,
else
val = 0;

regmap_update_bits(engine->regs, SUN8I_MIXER_BLEND_OUTCTL(bld_base),
SUN8I_MIXER_BLEND_OUTCTL_INTERLACED, val);
val |= SUN8I_MIXER_BLEND_OUTCTL_PREMULTIPLY;

regmap_write(engine->regs, SUN8I_MIXER_BLEND_OUTCTL(bld_base), val);

DRM_DEBUG_DRIVER("Switching display mixer interlaced mode %s\n",
interlaced ? "on" : "off");
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/sun4i/sun8i_mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#define SUN8I_MIXER_BLEND_ROUTE_PIPE_MSK(n) (0xf << ((n) << 2))
#define SUN8I_MIXER_BLEND_ROUTE_PIPE_SHIFT(n) ((n) << 2)

#define SUN8I_MIXER_BLEND_OUTCTL_PREMULTIPLY BIT(0)
#define SUN8I_MIXER_BLEND_OUTCTL_INTERLACED BIT(1)

#define SUN50I_MIXER_BLEND_CSC_CTL_EN(ch) BIT(ch)
Expand Down

0 comments on commit 8eec0dd

Please sign in to comment.