Re: [PATCH 1/2] drm/verisilicon: set blend mode for the primary plane

From: Icenowy Zheng

Date: Thu Sep 10 2026 - 05:15:13 EST


在 2026-09-10四的 10:56 +0200,Thomas Zimmermann写道:
> Hi
>
> Am 10.09.26 um 10:45 schrieb Icenowy Zheng:
> > 在 2026-09-10四的 10:31 +0200,Thomas Zimmermann写道:
> > > Hi
> > >
> > > Am 10.09.26 um 10:00 schrieb Icenowy Zheng:
> > > > 在 2026-09-10四的 09:58 +0200,Thomas Zimmermann写道:
> > > > > Hi
> > > > >
> > > > > Am 10.09.26 um 09:09 schrieb Icenowy Zheng:
> > > > > > 在 2026-09-02三的 01:17 +0800,Icenowy Zheng写道:
> > > > > > > Blend modes are now required to expose pixel formats w/
> > > > > > > alpha.
> > > > > > >
> > > > > > > As it's the primary plane and blending is explicitly
> > > > > > > disabled,
> > > > > > > just
> > > > > > > expose PIXEL_NONE blend mode.
> > > > > > Gently ping for reviews.
> > > > > What do these alpha formats do?  Are they a hardware
> > > > > feature?  It
> > > > > looks
> > > > > like they are programmable, but don't differ from XRGB at
> > > > > all.
> > > > I think they're for consistency with overlay planes.
> > > But there are no overlay planes in this driver, are there?
> > >
> > > What I want to get at is that it might be preferable to remove
> > > ARGB
> > > entirely from the primary plane if it does not to serve a
> > > purpose.
> > > But
> > > if the driver can do something useful with these formats, it
> > > might be
> > > worth exposing that instead.
> > On DC8000 display controllers (support for them is WIP by Joey Lu)
> > there seem to be no way to control the blend behavior of the
> > primary
> > plane.
> >
> > On DC8200 display controllers the primary plane does have a
> > blending
> > register, although it seems to be blending with pure black.
>
> IIRC there's a background-color property for the CRTC.  So it might
> be
> possible to expose this as read-only property. (Not sure.)

The hardware has a "background color" per plane, but it seems that this
is only for the colorkey (punching out special color values) feature,
not for alpha blending.

>
> >
> > Maybe it's viable to just remove the ARGB formats now, and re-
> > introduce
> > them when overlays are being implemented (and only expose them for
> > the
> > overlay)?
>
> I see. Thanks for digging through this. I've meanwhile acked the
> patches
> as there's at least some support in hardware.

As the DC8000 support is being developed (a new revision of that
patchset just appeared on this Tuesday), and on that hardware the A
channel has no meaning except for being ignored (no blend configuration
register for the primary plane), maybe I still need to remove alpha
formats (at least for DC8000)?

Although in such case, when the overlay support is going to be
introduced, two format tables need to be present -- one with alpha and
one without.

Thanks,
Icenowy

>
> Best regards
> Thomas
>
>
> >
> > Thanks,
> > Icenowy
> >
> > > In pl111, we now remove the ARGB foramts because the hardware
> > > does
> > > not
> > > handle them at all. The situation seems less clear in
> > > verisilicon.
> > >
> > > Best regards
> > > Thomas
> > >
> > >
> > > > Thanks,
> > > > Icenowy
> > > >
> > > > > Best regards
> > > > > Thomas
> > > > >
> > > > > > Thanks,
> > > > > > Icenowy
> > > > > >
> > > > > > > Signed-off-by: Icenowy Zheng <zhengxingda@xxxxxxxxxxx>
> > > > > > > ---
> > > > > > >     drivers/gpu/drm/verisilicon/vs_primary_plane.c | 3
> > > > > > > +++
> > > > > > >     1 file changed, 3 insertions(+)
> > > > > > >
> > > > > > > diff --git
> > > > > > > a/drivers/gpu/drm/verisilicon/vs_primary_plane.c
> > > > > > > b/drivers/gpu/drm/verisilicon/vs_primary_plane.c
> > > > > > > index 1f2be41ae496c..8d58682d88ef8 100644
> > > > > > > --- a/drivers/gpu/drm/verisilicon/vs_primary_plane.c
> > > > > > > +++ b/drivers/gpu/drm/verisilicon/vs_primary_plane.c
> > > > > > > @@ -7,6 +7,7 @@
> > > > > > >    
> > > > > > >     #include <drm/drm_atomic.h>
> > > > > > >     #include <drm/drm_atomic_helper.h>
> > > > > > > +#include <drm/drm_blend.h>
> > > > > > >     #include <drm/drm_crtc.h>
> > > > > > >     #include <drm/drm_fourcc.h>
> > > > > > >     #include <drm/drm_framebuffer.h>
> > > > > > > @@ -179,5 +180,7 @@ struct drm_plane
> > > > > > > *vs_primary_plane_init(struct
> > > > > > > drm_device *drm_dev, struct vs_dc
> > > > > > >    
> > > > > > >      drm_plane_helper_add(plane,
> > > > > > > &vs_primary_plane_helper_funcs);
> > > > > > >    
> > > > > > > + drm_plane_create_blend_mode_property(plane,
> > > > > > > +
> > > > > > > BIT(DRM_MODE_BLEND_PIXEL_NONE));
> > > > > > >      return plane;
> > > > > > >     }