summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/ti-vpe/vpe.c
diff options
context:
space:
mode:
authorNikhil Devshatwar2016-11-19 00:20:21 +0100
committerMauro Carvalho Chehab2016-11-22 10:10:49 +0100
commit634271f8f67532d48db6bf0fcacd5423e941bb5e (patch)
treeda0730738b505cb1bf338fb920142be16d8dfd7e /drivers/media/platform/ti-vpe/vpe.c
parent[media] media: ti-vpe: Free vpdma buffers in vpe_release (diff)
downloadkernel-qcow2-linux-634271f8f67532d48db6bf0fcacd5423e941bb5e.tar.gz
kernel-qcow2-linux-634271f8f67532d48db6bf0fcacd5423e941bb5e.tar.xz
kernel-qcow2-linux-634271f8f67532d48db6bf0fcacd5423e941bb5e.zip
[media] media: ti-vpe: vpdma: Add support for setting max width height
Add a helper function to be able to set the maximum VPDMA transfer size to limit potential buffer overrun. Added enums for max_width and max_height fields of the outbound data descriptor. Changed vpdma_add_out_dtd to accept two more arguments for max width and height. Make use of different max width & height sets for different of capture module (i.e. slices). Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com> Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/ti-vpe/vpe.c')
-rw-r--r--drivers/media/platform/ti-vpe/vpe.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
index f2b90d42b408..151a9280bb85 100644
--- a/drivers/media/platform/ti-vpe/vpe.c
+++ b/drivers/media/platform/ti-vpe/vpe.c
@@ -44,6 +44,7 @@
#include <media/videobuf2-dma-contig.h>
#include "vpdma.h"
+#include "vpdma_priv.h"
#include "vpe_regs.h"
#include "sc.h"
#include "csc.h"
@@ -1035,8 +1036,12 @@ static void add_out_dtd(struct vpe_ctx *ctx, int port)
if (q_data->flags & Q_DATA_MODE_TILED)
flags |= VPDMA_DATA_MODE_TILED;
+ vpdma_set_max_size(ctx->dev->vpdma, VPDMA_MAX_SIZE1,
+ MAX_W, MAX_H);
+
vpdma_add_out_dtd(&ctx->desc_list, q_data->width, &q_data->c_rect,
- vpdma_fmt, dma_addr, p_data->channel, flags);
+ vpdma_fmt, dma_addr, MAX_OUT_WIDTH_REG1,
+ MAX_OUT_HEIGHT_REG1, p_data->channel, flags);
}
static void add_in_dtd(struct vpe_ctx *ctx, int port)