提交 00db9699 编写于 作者: N Nikhil Devshatwar 提交者: Mauro Carvalho Chehab

[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: NNikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: NRavikumar Kattekola <rk@ti.com>
Signed-off-by: NRavi Babu <ravibabu@ti.com>
Signed-off-by: NBenoit Parrot <bparrot@ti.com>
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 07e72eb0
...@@ -1046,6 +1046,7 @@ static void add_out_dtd(struct vpe_ctx *ctx, int port) ...@@ -1046,6 +1046,7 @@ static void add_out_dtd(struct vpe_ctx *ctx, int port)
if (port == VPE_PORT_MV_OUT) { if (port == VPE_PORT_MV_OUT) {
vpdma_fmt = &vpdma_misc_fmts[VPDMA_DATA_FMT_MV]; vpdma_fmt = &vpdma_misc_fmts[VPDMA_DATA_FMT_MV];
dma_addr = ctx->mv_buf_dma[mv_buf_selector]; dma_addr = ctx->mv_buf_dma[mv_buf_selector];
q_data = &ctx->q_data[Q_DATA_SRC];
} else { } else {
/* to incorporate interleaved formats */ /* to incorporate interleaved formats */
int plane = fmt->coplanar ? p_data->vb_part : 0; int plane = fmt->coplanar ? p_data->vb_part : 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册