aboutsummaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3-adas
diff options
context:
space:
mode:
authorAndrey Dolnikov <andrey.dolnikov@cogentembedded.com>2018-04-11 17:15:57 +0300
committerAndrey Dolnikov <andrey.dolnikov@cogentembedded.com>2018-04-11 17:17:47 +0300
commit620c0dd2ee137ea588326362c6c27dd175a7ed9d (patch)
tree531a98963dcd1f9869302f96fb3233bc01ef6319 /meta-rcar-gen3-adas
parent7051d448e4589b74ec69ba56910e4cfbf1c86877 (diff)
linux-renesas: VSP1: Add cropping handling to VSP alpha-planes
Diffstat (limited to 'meta-rcar-gen3-adas')
-rw-r--r--meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0129-Add-cropping-handling-to-VSP-alpha-planes.patch44
-rw-r--r--meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_4.9.bbappend1
2 files changed, 45 insertions, 0 deletions
diff --git a/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0129-Add-cropping-handling-to-VSP-alpha-planes.patch b/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0129-Add-cropping-handling-to-VSP-alpha-planes.patch
new file mode 100644
index 0000000..d55b196
--- /dev/null
+++ b/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0129-Add-cropping-handling-to-VSP-alpha-planes.patch
@@ -0,0 +1,44 @@
+From 4b26e8c561541c68c5755660eaad355d9a9afc86 Mon Sep 17 00:00:00 2001
+From: Konstantin Kozhevnikov <Konstantin.Kozhevnikov@cogentembedded.com>
+Date: Wed, 11 Apr 2018 05:11:21 -0700
+Subject: [PATCH] Add cropping handling to VSP alpha-planes
+
+---
+ drivers/media/platform/vsp1/vsp1_dl.c | 2 +-
+ drivers/media/platform/vsp1/vsp1_rpf.c | 5 +++--
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/media/platform/vsp1/vsp1_dl.c b/drivers/media/platform/vsp1/vsp1_dl.c
+index f9c6d09..d6314cd 100644
+--- a/drivers/media/platform/vsp1/vsp1_dl.c
++++ b/drivers/media/platform/vsp1/vsp1_dl.c
+@@ -363,7 +363,7 @@ void vsp1_dl_set_addr_auto_fld(struct vsp1_dl_list *dl, struct vsp1_rwpf *rpf)
+ dl->src_dst_addr[v_bot_index].addr = v_bot_addr;
+
+ /* ...set alpha-plane address as needed */
+- dl->src_dst_addr[alpha_index].addr = rpf->mem.alpha;
++ dl->src_dst_addr[alpha_index].addr = rpf->mem.alpha + crop->top * width + crop->left;
+ }
+
+ static struct vsp1_dl_list *vsp1_dl_list_alloc(struct vsp1_dl_manager *dlm)
+diff --git a/drivers/media/platform/vsp1/vsp1_rpf.c b/drivers/media/platform/vsp1/vsp1_rpf.c
+index 2cce294..1f70186 100644
+--- a/drivers/media/platform/vsp1/vsp1_rpf.c
++++ b/drivers/media/platform/vsp1/vsp1_rpf.c
+@@ -292,10 +292,11 @@ static void rpf_configure(struct vsp1_entity *entity,
+
+ // ...setup alpha-plane as required
+ if (rpf->mem.alpha) {
+- vsp1_rpf_write(rpf, dl, VI6_RPF_SRCM_ADDR_AI, rpf->mem.alpha);
++ struct v4l2_rect *crop = vsp1_rwpf_get_crop(rpf, rpf->entity.config);
++ vsp1_rpf_write(rpf, dl, VI6_RPF_SRCM_ADDR_AI, rpf->mem.alpha + crop->top * rpf->alpha_pitch + crop->left);
+ vsp1_rpf_write(rpf, dl, VI6_RPF_ALPH_SEL, VI6_RPF_ALPH_SEL_ASEL_8B_PLANE);
+ vsp1_rpf_write(rpf, dl, VI6_RPF_SRCM_ASTRIDE, rpf->alpha_pitch);
+- dev_dbg(vsp1->dev, "rpf#%d: setup alpha-plane: buffer=%pad, stride=%u\n", rpf->entity.index, &rpf->mem.alpha, rpf->alpha_pitch);
++ dev_dbg(vsp1->dev, "rpf#%d: setup alpha-plane: buffer=%pad, crop=%d,%d, stride=%u\n", rpf->entity.index, &rpf->mem.alpha, crop->left, crop->top, rpf->alpha_pitch);
+ goto out;
+ }
+
+--
+2.7.4
+
diff --git a/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_4.9.bbappend b/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_4.9.bbappend
index 0233afa..b26c5d4 100644
--- a/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_4.9.bbappend
+++ b/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_4.9.bbappend
@@ -108,6 +108,7 @@ SRC_URI_append = " \
file://0126-r8a7798-pinctrl-Add-pin-function-for-hyperflash.patch \
file://0127-IMR-UIO-Driver-initial-version.patch \
file://0128-rcar_imr-v4l2-driver-Fix-module-support.patch \
+ file://0129-Add-cropping-handling-to-VSP-alpha-planes.patch \
"
SRC_URI_append_h3ulcb = " file://ulcb.cfg"