From 8429bd5caebc8a056ff8a26705580f557fdceb1b Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 6 Dec 2019 10:06:03 +0900 Subject: wiki: Porting wiki: Porting 2017-09 PeriPeriCon Signed-off-by: Kuninori Morimoto --- ...1-Add-support-for-colorkey-alpha-blending.patch | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 wiki/2017-09-periperi/0001-v4l-vsp1-Add-support-for-colorkey-alpha-blending.patch (limited to 'wiki/2017-09-periperi/0001-v4l-vsp1-Add-support-for-colorkey-alpha-blending.patch') diff --git a/wiki/2017-09-periperi/0001-v4l-vsp1-Add-support-for-colorkey-alpha-blending.patch b/wiki/2017-09-periperi/0001-v4l-vsp1-Add-support-for-colorkey-alpha-blending.patch new file mode 100644 index 0000000..d95c662 --- /dev/null +++ b/wiki/2017-09-periperi/0001-v4l-vsp1-Add-support-for-colorkey-alpha-blending.patch @@ -0,0 +1,86 @@ +From 41b782c5d67bfaf7d61e27e7fcb7cedf1f1eea0b Mon Sep 17 00:00:00 2001 +From: Alexandru Gheorghe +Date: Wed, 15 Feb 2017 14:27:21 +0200 +Subject: [PATCH 1/2] v4l: vsp1: Add support for colorkey alpha blending + +The vsp2 hw supports changing of the alpha of pixels that match a color +key, this patch adds support for this feature in order to be used by +the rcar-du driver. +The colorkey is interpreted different depending of the pixel format: + * RGB - all color components have to match. + * YCbCr - only the Y component has to match. + +Signed-off-by: Alexandru Gheorghe +--- + drivers/media/platform/vsp1/vsp1_drm.c | 3 +++ + drivers/media/platform/vsp1/vsp1_rpf.c | 10 ++++++++-- + drivers/media/platform/vsp1/vsp1_rwpf.h | 3 +++ + include/media/vsp1.h | 3 +++ + 4 files changed, 17 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c +index 3627f08..a4d0aee 100644 +--- a/drivers/media/platform/vsp1/vsp1_drm.c ++++ b/drivers/media/platform/vsp1/vsp1_drm.c +@@ -393,6 +393,9 @@ int vsp1_du_atomic_update(struct device *dev, unsigned int rpf_index, + else + rpf->format.plane_fmt[1].bytesperline = cfg->pitch; + rpf->alpha = cfg->alpha; ++ rpf->colorkey = cfg->colorkey; ++ rpf->colorkey_en = cfg->colorkey_en; ++ rpf->colorkey_alpha = cfg->colorkey_alpha; + rpf->interlaced = cfg->interlaced; + + if (soc_device_match(r8a7795es1) && rpf->interlaced) { +diff --git a/drivers/media/platform/vsp1/vsp1_rpf.c b/drivers/media/platform/vsp1/vsp1_rpf.c +index a12d6f9..91f2a9f 100644 +--- a/drivers/media/platform/vsp1/vsp1_rpf.c ++++ b/drivers/media/platform/vsp1/vsp1_rpf.c +@@ -356,8 +356,14 @@ static void rpf_configure(struct vsp1_entity *entity, + } + + vsp1_rpf_write(rpf, dl, VI6_RPF_MSK_CTRL, 0); +- vsp1_rpf_write(rpf, dl, VI6_RPF_CKEY_CTRL, 0); +- ++ if (rpf->colorkey_en) { ++ vsp1_rpf_write(rpf, dl, VI6_RPF_CKEY_SET0, ++ (rpf->colorkey_alpha << 24) | rpf->colorkey); ++ vsp1_rpf_write(rpf, dl, VI6_RPF_CKEY_CTRL, ++ VI6_RPF_CKEY_CTRL_SAPE0); ++ } else { ++ vsp1_rpf_write(rpf, dl, VI6_RPF_CKEY_CTRL, 0); ++ } + } + + static const struct vsp1_entity_operations rpf_entity_ops = { +diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.h b/drivers/media/platform/vsp1/vsp1_rwpf.h +index fbe6aa6..2d7f4b9 100644 +--- a/drivers/media/platform/vsp1/vsp1_rwpf.h ++++ b/drivers/media/platform/vsp1/vsp1_rwpf.h +@@ -51,6 +51,9 @@ struct vsp1_rwpf { + unsigned int brs_input; + + unsigned int alpha; ++ u32 colorkey; ++ bool colorkey_en; ++ u32 colorkey_alpha; + + u32 mult_alpha; + u32 outfmt; +diff --git a/include/media/vsp1.h b/include/media/vsp1.h +index 97265f7..65e3934 100644 +--- a/include/media/vsp1.h ++++ b/include/media/vsp1.h +@@ -32,6 +32,9 @@ struct vsp1_du_atomic_config { + struct v4l2_rect dst; + unsigned int alpha; + unsigned int zpos; ++ u32 colorkey; ++ u32 colorkey_alpha; ++ bool colorkey_en; + bool interlaced; + }; + +-- +1.9.1 + -- cgit v1.2.3