Commit 0efb6fd3 authored by Takanari Hayama's avatar Takanari Hayama Committed by Laurent Pinchart
Browse files

media: vsp1: Add premultiplied alpha support



To support DRM blend mode in R-Car DU driver, we must be able to pass
a plane with the premultiplied alpha. Adding a new property to
vsp1_du_atomic_config allows the R-Car DU driver to pass the
premultiplied alpha plane.

Signed-off-by: default avatarTakanari Hayama <taki@igel.co.jp>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 8284bae7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -856,6 +856,8 @@ int vsp1_du_atomic_update(struct device *dev, unsigned int pipe_index,
	rpf->mem.addr[1] = cfg->mem[1];
	rpf->mem.addr[2] = cfg->mem[2];

	rpf->format.flags = cfg->premult ? V4L2_PIX_FMT_FLAG_PREMUL_ALPHA : 0;

	vsp1->drm->inputs[rpf_index].crop = cfg->src;
	vsp1->drm->inputs[rpf_index].compose = cfg->dst;
	vsp1->drm->inputs[rpf_index].zpos = cfg->zpos;
+2 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index,
 * @dst: destination rectangle on the display (integer coordinates)
 * @alpha: alpha value (0: fully transparent, 255: fully opaque)
 * @zpos: Z position of the plane (from 0 to number of planes minus 1)
 * @premult: true for premultiplied alpha
 */
struct vsp1_du_atomic_config {
	u32 pixelformat;
@@ -60,6 +61,7 @@ struct vsp1_du_atomic_config {
	struct v4l2_rect dst;
	unsigned int alpha;
	unsigned int zpos;
	bool premult;
};

/**