[PATCH 1/3] media: vsp1: save pixel alpha info in vsp1_rwpf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In order to support DRM blend mode, we need to able to override pixel
alpha flag. When DRM_MODE_BLEND_PIXEL_NONE is desired, we'd like to let
VSP1 to ignore the pixel alpha by overriding the flag.

Signed-off-by: Takanari Hayama <taki@xxxxxxxxxx>
---
 drivers/media/platform/renesas/vsp1/vsp1_drm.c  | 1 +
 drivers/media/platform/renesas/vsp1/vsp1_rpf.c  | 6 +++---
 drivers/media/platform/renesas/vsp1/vsp1_rwpf.h | 2 ++
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drm.c b/drivers/media/platform/renesas/vsp1/vsp1_drm.c
index 0c2507dc03d6..9ec3ac835987 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_drm.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_drm.c
@@ -600,6 +600,7 @@ static int vsp1_du_pipeline_set_rwpf_format(struct vsp1_device *vsp1,
 	rwpf->format.num_planes = fmtinfo->planes;
 	rwpf->format.plane_fmt[0].bytesperline = pitch;
 	rwpf->format.plane_fmt[1].bytesperline = pitch / chroma_hsub;
+	rwpf->pixel_alpha = fmtinfo->alpha;
 
 	return 0;
 }
diff --git a/drivers/media/platform/renesas/vsp1/vsp1_rpf.c b/drivers/media/platform/renesas/vsp1/vsp1_rpf.c
index 75083cb234fe..e6bd813dc68c 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_rpf.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_rpf.c
@@ -152,13 +152,13 @@ static void rpf_configure_stream(struct vsp1_entity *entity,
 	 * In all cases, disable color keying.
 	 */
 	vsp1_rpf_write(rpf, dlb, VI6_RPF_ALPH_SEL, VI6_RPF_ALPH_SEL_AEXT_EXT |
-		       (fmtinfo->alpha ? VI6_RPF_ALPH_SEL_ASEL_PACKED
-				       : VI6_RPF_ALPH_SEL_ASEL_FIXED));
+		       (rpf->pixel_alpha ? VI6_RPF_ALPH_SEL_ASEL_PACKED
+					 : VI6_RPF_ALPH_SEL_ASEL_FIXED));
 
 	if (entity->vsp1->info->gen == 3) {
 		u32 mult;
 
-		if (fmtinfo->alpha) {
+		if (rpf->pixel_alpha) {
 			/*
 			 * When the input contains an alpha channel enable the
 			 * alpha multiplier. If the input is premultiplied we
diff --git a/drivers/media/platform/renesas/vsp1/vsp1_rwpf.h b/drivers/media/platform/renesas/vsp1/vsp1_rwpf.h
index eac5c04c2239..07ddebb78dfa 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_rwpf.h
+++ b/drivers/media/platform/renesas/vsp1/vsp1_rwpf.h
@@ -43,6 +43,8 @@ struct vsp1_rwpf {
 	const struct vsp1_format_info *fmtinfo;
 	unsigned int brx_input;
 
+	bool pixel_alpha;
+
 	unsigned int alpha;
 
 	u32 mult_alpha;
-- 
2.25.1




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux