summaryrefslogtreecommitdiff
path: root/drivers/media/platform/ti-vpe/vpdma.c
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2013-12-03 15:51:13 +0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-12-10 22:49:48 +0400
commita51cd8f5d0a21ccc8d313a9992293ab2541b40a8 (patch)
tree1c0b27151a708233adea082fdc5f137770cd9339 /drivers/media/platform/ti-vpe/vpdma.c
parentfe104a9b61ac8856e7973058b71f33224a7d5ed7 (diff)
downloadlinux-a51cd8f5d0a21ccc8d313a9992293ab2541b40a8.tar.xz
[media] v4l: ti-vpe: make sure VPDMA line stride constraints are met
When VPDMA fetches or writes to an image buffer, the line stride must be a multiple of 16 bytes. If it isn't, VPDMA HW will write/fetch until the next 16 byte boundry. This causes VPE to work incorrectly for source or destination widths which don't satisfy the above alignment requirement. In order to prevent this, we now make sure that when we set pix format for the input and output buffers, the VPE source and destination image line strides are 16 byte aligned. Also, the motion vector buffers for the de-interlacer are allocated in such a way that it ensures the same alignment. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/platform/ti-vpe/vpdma.c')
-rw-r--r--drivers/media/platform/ti-vpe/vpdma.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/ti-vpe/vpdma.c b/drivers/media/platform/ti-vpe/vpdma.c
index af0a5ffcaa98..f97253f6699f 100644
--- a/drivers/media/platform/ti-vpe/vpdma.c
+++ b/drivers/media/platform/ti-vpe/vpdma.c
@@ -602,7 +602,7 @@ void vpdma_add_out_dtd(struct vpdma_desc_list *list, struct v4l2_rect *c_rect,
if (fmt->data_type == DATA_TYPE_C420)
depth = 8;
- stride = (depth * c_rect->width) >> 3;
+ stride = ALIGN((depth * c_rect->width) >> 3, VPDMA_STRIDE_ALIGN);
dma_addr += (c_rect->left * depth) >> 3;
dtd = list->next;
@@ -655,7 +655,7 @@ void vpdma_add_in_dtd(struct vpdma_desc_list *list, int frame_width,
depth = 8;
}
- stride = (depth * c_rect->width) >> 3;
+ stride = ALIGN((depth * c_rect->width) >> 3, VPDMA_STRIDE_ALIGN);
dma_addr += (c_rect->left * depth) >> 3;
dtd = list->next;