]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
[media] media: ti-vpe: vpdma: add support for user specified stride
authorBenoit Parrot <bparrot@ti.com>
Mon, 13 Feb 2017 13:06:57 +0000 (11:06 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 3 Mar 2017 17:42:42 +0000 (14:42 -0300)
This patch introduce the needed vpdma API changes to support
user space specified stride instead of forcing a driver calculated
one.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/ti-vpe/vpdma.c
drivers/media/platform/ti-vpe/vpdma.h
drivers/media/platform/ti-vpe/vpe.c

index 23472e3784ff169f0c05c9bcb473cccb6d9af0d0..e2cf2b90e500fb81480f6a7b1b2f62333260dcb3 100644 (file)
@@ -801,17 +801,17 @@ static void dump_dtd(struct vpdma_dtd *dtd)
  * flags: VPDMA flags to configure some descriptor fileds
  */
 void vpdma_add_out_dtd(struct vpdma_desc_list *list, int width,
-               const struct v4l2_rect *c_rect,
+               int stride, const struct v4l2_rect *c_rect,
                const struct vpdma_data_format *fmt, dma_addr_t dma_addr,
                int max_w, int max_h, enum vpdma_channel chan, u32 flags)
 {
-       vpdma_rawchan_add_out_dtd(list, width, c_rect, fmt, dma_addr,
+       vpdma_rawchan_add_out_dtd(list, width, stride, c_rect, fmt, dma_addr,
                                  max_w, max_h, chan_info[chan].num, flags);
 }
 EXPORT_SYMBOL(vpdma_add_out_dtd);
 
 void vpdma_rawchan_add_out_dtd(struct vpdma_desc_list *list, int width,
-               const struct v4l2_rect *c_rect,
+               int stride, const struct v4l2_rect *c_rect,
                const struct vpdma_data_format *fmt, dma_addr_t dma_addr,
                int max_w, int max_h, int raw_vpdma_chan, u32 flags)
 {
@@ -821,7 +821,6 @@ void vpdma_rawchan_add_out_dtd(struct vpdma_desc_list *list, int width,
        int channel, next_chan;
        struct v4l2_rect rect = *c_rect;
        int depth = fmt->depth;
-       int stride;
        struct vpdma_dtd *dtd;
 
        channel = next_chan = raw_vpdma_chan;
@@ -833,8 +832,6 @@ void vpdma_rawchan_add_out_dtd(struct vpdma_desc_list *list, int width,
                depth = 8;
        }
 
-       stride = ALIGN((depth * width) >> 3, VPDMA_STRIDE_ALIGN);
-
        dma_addr += rect.top * stride + (rect.left * depth >> 3);
 
        dtd = list->next;
@@ -882,7 +879,7 @@ EXPORT_SYMBOL(vpdma_rawchan_add_out_dtd);
  *                     contribute to the client)
  */
 void vpdma_add_in_dtd(struct vpdma_desc_list *list, int width,
-               const struct v4l2_rect *c_rect,
+               int stride, const struct v4l2_rect *c_rect,
                const struct vpdma_data_format *fmt, dma_addr_t dma_addr,
                enum vpdma_channel chan, int field, u32 flags, int frame_width,
                int frame_height, int start_h, int start_v)
@@ -892,7 +889,6 @@ void vpdma_add_in_dtd(struct vpdma_desc_list *list, int width,
        int depth = fmt->depth;
        int channel, next_chan;
        struct v4l2_rect rect = *c_rect;
-       int stride;
        struct vpdma_dtd *dtd;
 
        channel = next_chan = chan_info[chan].num;
@@ -904,8 +900,6 @@ void vpdma_add_in_dtd(struct vpdma_desc_list *list, int width,
                depth = 8;
        }
 
-       stride = ALIGN((depth * width) >> 3, VPDMA_STRIDE_ALIGN);
-
        dma_addr += rect.top * stride + (rect.left * depth >> 3);
 
        dtd = list->next;
index 131700c112b2675d2cde282ac8c43057c3d9c5a6..7e611501c291696a45b6283d064d2ac8fccd0405 100644 (file)
@@ -242,16 +242,16 @@ void vpdma_add_sync_on_channel_ctd(struct vpdma_desc_list *list,
 void vpdma_add_abort_channel_ctd(struct vpdma_desc_list *list,
                int chan_num);
 void vpdma_add_out_dtd(struct vpdma_desc_list *list, int width,
-               const struct v4l2_rect *c_rect,
+               int stride, const struct v4l2_rect *c_rect,
                const struct vpdma_data_format *fmt, dma_addr_t dma_addr,
                int max_w, int max_h, enum vpdma_channel chan, u32 flags);
 void vpdma_rawchan_add_out_dtd(struct vpdma_desc_list *list, int width,
-               const struct v4l2_rect *c_rect,
+               int stride, const struct v4l2_rect *c_rect,
                const struct vpdma_data_format *fmt, dma_addr_t dma_addr,
                int max_w, int max_h, int raw_vpdma_chan, u32 flags);
 
 void vpdma_add_in_dtd(struct vpdma_desc_list *list, int width,
-               const struct v4l2_rect *c_rect,
+               int stride, const struct v4l2_rect *c_rect,
                const struct vpdma_data_format *fmt, dma_addr_t dma_addr,
                enum vpdma_channel chan, int field, u32 flags, int frame_width,
                int frame_height, int start_h, int start_v);
index f0156b7759e9263d303abdf5e145de6e54f3ac33..2dd67232b3bc83a9f8e1146ad835eb75b3fdfa06 100644 (file)
@@ -1085,7 +1085,8 @@ static void add_out_dtd(struct vpe_ctx *ctx, int port)
        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_add_out_dtd(&ctx->desc_list, q_data->width,
+                         q_data->bytesperline[VPE_LUMA], &q_data->c_rect,
                          vpdma_fmt, dma_addr, MAX_OUT_WIDTH_REG1,
                          MAX_OUT_HEIGHT_REG1, p_data->channel, flags);
 }
@@ -1169,7 +1170,8 @@ static void add_in_dtd(struct vpe_ctx *ctx, int port)
        if (p_data->vb_part && fmt->fourcc == V4L2_PIX_FMT_NV12)
                frame_height /= 2;
 
-       vpdma_add_in_dtd(&ctx->desc_list, q_data->width, &q_data->c_rect,
+       vpdma_add_in_dtd(&ctx->desc_list, q_data->width,
+                        q_data->bytesperline[VPE_LUMA], &q_data->c_rect,
                vpdma_fmt, dma_addr, p_data->channel, field, flags, frame_width,
                frame_height, 0, 0);
 }