summaryrefslogtreecommitdiff
path: root/drivers/media/platform/vsp1/vsp1_wpf.c
diff options
context:
space:
mode:
authorKieran Bingham <kieran+renesas@bingham.xyz>2016-09-12 05:26:35 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-19 21:01:30 +0300
commitfc6e514a72c718f025d69e3006d6827b25a6df27 (patch)
treea76c9831ec374a2b305f27b4484bb7af95ba1c0a /drivers/media/platform/vsp1/vsp1_wpf.c
parentdf32c924518716160d43defc444199e894859c08 (diff)
downloadlinux-fc6e514a72c718f025d69e3006d6827b25a6df27.tar.xz
[media] v4l: vsp1: Support multiple partitions per frame
Adapt vsp1_video_pipeline_run() such that it can iterate each partition required for constructing this frame's display list chain in the event that multiple display lists are required to process in hardware. The first display list is held as the head list object, whilst any following parition display lists are linked to the head by means of vsp1_dl_list_add_chain(). Linking the chained display list headers to process using the auto start mechanism of the hardware is performed during the vsp1_dl_list_commit(). Signed-off-by: Kieran Bingham <kieran+renesas@bingham.xyz> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/vsp1/vsp1_wpf.c')
-rw-r--r--drivers/media/platform/vsp1/vsp1_wpf.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c
index b757d2579d6c..fdee5a891e40 100644
--- a/drivers/media/platform/vsp1/vsp1_wpf.c
+++ b/drivers/media/platform/vsp1/vsp1_wpf.c
@@ -224,6 +224,9 @@ static void wpf_configure(struct vsp1_entity *entity,
/* Cropping. The partition algorithm can split the image into
* multiple slices.
*/
+ if (pipe->partitions > 1)
+ width = pipe->partition.width;
+
vsp1_wpf_write(wpf, dl, VI6_WPF_HSZCLIP, VI6_WPF_SZCLIP_EN |
(0 << VI6_WPF_SZCLIP_OFST_SHIFT) |
(width << VI6_WPF_SZCLIP_SIZE_SHIFT));
@@ -237,10 +240,31 @@ static void wpf_configure(struct vsp1_entity *entity,
/* Update the memory offsets based on flipping configuration.
* The destination addresses point to the locations where the
* VSP starts writing to memory, which can be different corners
- * of the image depending on vertical flipping. Horizontal
- * flipping is handled through a line buffer and doesn't modify
- * the start address.
+ * of the image depending on vertical flipping.
*/
+ if (pipe->partitions > 1) {
+ const struct vsp1_format_info *fmtinfo = wpf->fmtinfo;
+
+ /* Horizontal flipping is handled through a line buffer
+ * and doesn't modify the start address, but still needs
+ * to be handled when image partitioning is in effect to
+ * order the partitions correctly.
+ */
+ if (flip & BIT(WPF_CTRL_HFLIP))
+ offset = format->width - pipe->partition.left
+ - pipe->partition.width;
+ else
+ offset = pipe->partition.left;
+
+ mem.addr[0] += offset * fmtinfo->bpp[0] / 8;
+ if (format->num_planes > 1) {
+ mem.addr[1] += offset / fmtinfo->hsub
+ * fmtinfo->bpp[1] / 8;
+ mem.addr[2] += offset / fmtinfo->hsub
+ * fmtinfo->bpp[2] / 8;
+ }
+ }
+
if (flip & BIT(WPF_CTRL_VFLIP)) {
mem.addr[0] += (format->height - 1)
* format->plane_fmt[0].bytesperline;