Skip to contentSkip to conversation

v4l: ti-vpe: Some VPE fixes

PATCH In review Archit Taneja 2 participants 5 messages Dec 3, 2013 – Dec 17, 2013 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

cover v4l: ti-vpe: Some VPE fixes

This series fixes 2 issues in the VPE driver. The first fix allows us to use UYVY color format for source and destination buffers. The second fix makes sure we don't set pixel format widths which the VPDMA HW can't support. None of these fixes are fatal, so they don't necessarily need to go in for the 3.13-rc fixes.

Archit Taneja (2):
v4l: ti-vpe: Fix the data_type value for UYVY VPDMA format
v4l: ti-vpe: make sure VPDMA line stride constraints are met

 drivers/media/platform/ti-vpe/vpdma.c      |  4 +--
 drivers/media/platform/ti-vpe/vpdma.h      |  5 ++-
 drivers/media/platform/ti-vpe/vpdma_priv.h |  2 +-
 drivers/media/platform/ti-vpe/vpe.c        | 53 ++++++++++++++++++++++--------
 4 files changed, 47 insertions(+), 17 deletions(-)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/2 v4l: ti-vpe: Fix the data_type value for UYVY VPDMA format

The data_type value to be programmed in the data descriptors to fetch/write a UYVY buffer was not mentioned correctly in the older DRA7x documentation. This caused VPE to fail with UYVY color formats.

Update the data_type value to fix functionality when UYVY format is used.

---
 drivers/media/platform/ti-vpe/vpdma_priv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/ti-vpe/vpdma_priv.h +1 -1
index f0e9a80..c1a6ce1 100644
@@ -78,7 +78,7 @@
 #define DATA_TYPE_C420				0x6
 #define DATA_TYPE_YC422				0x7
 #define DATA_TYPE_YC444				0x8
-#define DATA_TYPE_CY422				0x23
+#define DATA_TYPE_CY422				0x27
 
 #define DATA_TYPE_RGB16_565			0x0
 #define DATA_TYPE_ARGB_1555			0x1
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 2/2 v4l: ti-vpe: make sure VPDMA line stride constraints are met

In reply to Archit Taneja

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.

---
 drivers/media/platform/ti-vpe/vpdma.c |  4 +--
 drivers/media/platform/ti-vpe/vpdma.h |  5 +++-
 drivers/media/platform/ti-vpe/vpe.c   | 53 ++++++++++++++++++++++++++---------
 3 files changed, 46 insertions(+), 16 deletions(-)
drivers/media/platform/ti-vpe/vpdma.c +2 -2
index af0a5ff..f97253f 100644
@@ -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;
drivers/media/platform/ti-vpe/vpdma.h +4 -1
index eaa2a71..62dd143 100644
@@ -45,7 +45,10 @@ struct vpdma_data_format {
 };
 
 #define VPDMA_DESC_ALIGN		16	/* 16-byte descriptor alignment */
-
+#define VPDMA_STRIDE_ALIGN		16	/*
+						 * line stride of source and dest
+						 * buffers should be 16 byte aligned
+						 */
 #define VPDMA_DTD_DESC_SIZE		32	/* 8 words */
 #define VPDMA_CFD_CTD_DESC_SIZE		16	/* 4 words */
 
drivers/media/platform/ti-vpe/vpe.c +40 -13

97 lines not on this page · raw message

Signature · 1 line
1.8.3.2
Acked-by on the v1 series
#3 lore raw
In reply to Archit Taneja
Quoted 9 lines · Archit Taneja

This series fixes 2 issues in the VPE driver. The first fix allows us to use UYVY color format for source and destination buffers. The second fix makes sure we don't set pixel format widths which the VPDMA HW can't support. None of these fixes are fatal, so they don't necessarily need to go in for the 3.13-rc fixes.

Archit Taneja (2):
v4l: ti-vpe: Fix the data_type value for UYVY VPDMA format
v4l: ti-vpe: make sure VPDMA line stride constraints are met

Quoted 6 lines
 drivers/media/platform/ti-vpe/vpdma.c      |  4 +--
 drivers/media/platform/ti-vpe/vpdma.h      |  5 ++-
 drivers/media/platform/ti-vpe/vpdma_priv.h |  2 +-
 drivers/media/platform/ti-vpe/vpe.c        | 53 ++++++++++++++++++++++--------
 4 files changed, 47 insertions(+), 17 deletions(-)

For this patch series:

Regards,

Hans

#4 lore raw
Quoted 17 lines · Hans Verkuil
Quoted 9 lines · Archit Taneja

This series fixes 2 issues in the VPE driver. The first fix allows us to use UYVY color format for source and destination buffers. The second fix makes sure we don't set pixel format widths which the VPDMA HW can't support. None of these fixes are fatal, so they don't necessarily need to go in for the 3.13-rc fixes.

Archit Taneja (2):
v4l: ti-vpe: Fix the data_type value for UYVY VPDMA format
v4l: ti-vpe: make sure VPDMA line stride constraints are met

Quoted 6 lines
 drivers/media/platform/ti-vpe/vpdma.c      |  4 +--
 drivers/media/platform/ti-vpe/vpdma.h      |  5 ++-
 drivers/media/platform/ti-vpe/vpdma_priv.h |  2 +-
 drivers/media/platform/ti-vpe/vpe.c        | 53 ++++++++++++++++++++++--------
 4 files changed, 47 insertions(+), 17 deletions(-)
Quoted 3 lines

For this patch series:

Ah, it's already merged. I missed that :-)

Regards,

Hans