summaryrefslogtreecommitdiff
path: root/drivers/media/platform/ti-vpe/vpe.c
diff options
context:
space:
mode:
authorNikhil Devshatwar <nikhil.nd@ti.com>2016-11-19 02:20:37 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-22 13:08:17 +0300
commit00db969964c8de88ccb33db08db330634e111778 (patch)
tree72f920964a2bc73c6b60cd87eb0697f52a29ef9b /drivers/media/platform/ti-vpe/vpe.c
parent07e72eb0725ccd20b5cc26ee463def3f34606c7f (diff)
downloadlinux-00db969964c8de88ccb33db08db330634e111778.tar.xz
[media] media: ti-vpe: vpe: Fix line stride for output motion vector
For deinterlacing operation, VPE hardware uses motion vectors. MV calculated in the previous iteration are used for next interation. Therefore driver allocates two motion vectors in ping-pong fashion. For every transaction, one MV is DMAed in and one is DMAed out. All the outbound DMAs (DMA to memory) use output parameters, but as the motion vectors is generated purely out of input fields, it should use the input parameters for DMA. Fix the add_out_dtd to use source q_data for creating descriptor. If the output size is greater than input stride, without this change, MV DMA may overwrite the buffer causing memory corruption. This CRITICAL fix ensures that the motion vector DMA descriptor is created based on the attributes with which the buffer was allocated. Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com> Signed-off-by: Ravikumar Kattekola <rk@ti.com> Signed-off-by: Ravi Babu <ravibabu@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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
index 15e846b95719..608d11344147 100644
--- a/drivers/media/platform/ti-vpe/vpe.c
+++ b/drivers/media/platform/ti-vpe/vpe.c
@@ -1046,6 +1046,7 @@ static void add_out_dtd(struct vpe_ctx *ctx, int port)
if (port == VPE_PORT_MV_OUT) {
vpdma_fmt = &vpdma_misc_fmts[VPDMA_DATA_FMT_MV];
dma_addr = ctx->mv_buf_dma[mv_buf_selector];
+ q_data = &ctx->q_data[Q_DATA_SRC];
} else {
/* to incorporate interleaved formats */
int plane = fmt->coplanar ? p_data->vb_part : 0;