summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/ti-vpe/vpdma.h
diff options
context:
space:
mode:
authorNikhil Devshatwar <nikhil.nd@ti.com>2016-11-18 21:20:21 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-22 07:10:49 -0200
commit634271f8f67532d48db6bf0fcacd5423e941bb5e (patch)
treeda0730738b505cb1bf338fb920142be16d8dfd7e /drivers/media/platform/ti-vpe/vpdma.h
parentf43aa420a89a4a17117e21553283e2a50cf86df8 (diff)
downloadlinux-634271f8f67532d48db6bf0fcacd5423e941bb5e.tar.bz2
[media] media: ti-vpe: vpdma: Add support for setting max width height
Add a helper function to be able to set the maximum VPDMA transfer size to limit potential buffer overrun. Added enums for max_width and max_height fields of the outbound data descriptor. Changed vpdma_add_out_dtd to accept two more arguments for max width and height. Make use of different max width & height sets for different of capture module (i.e. slices). Signed-off-by: Nikhil Devshatwar <nikhil.nd@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/vpdma.h')
-rw-r--r--drivers/media/platform/ti-vpe/vpdma.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/drivers/media/platform/ti-vpe/vpdma.h b/drivers/media/platform/ti-vpe/vpdma.h
index 220dc7e793f6..32b9ed5191c5 100644
--- a/drivers/media/platform/ti-vpe/vpdma.h
+++ b/drivers/media/platform/ti-vpe/vpdma.h
@@ -117,6 +117,30 @@ enum vpdma_frame_start_event {
VPDMA_FSEVENT_CHANNEL_ACTIVE,
};
+/* max width configurations */
+enum vpdma_max_width {
+ MAX_OUT_WIDTH_UNLIMITED = 0,
+ MAX_OUT_WIDTH_REG1,
+ MAX_OUT_WIDTH_REG2,
+ MAX_OUT_WIDTH_REG3,
+ MAX_OUT_WIDTH_352,
+ MAX_OUT_WIDTH_768,
+ MAX_OUT_WIDTH_1280,
+ MAX_OUT_WIDTH_1920,
+};
+
+/* max height configurations */
+enum vpdma_max_height {
+ MAX_OUT_HEIGHT_UNLIMITED = 0,
+ MAX_OUT_HEIGHT_REG1,
+ MAX_OUT_HEIGHT_REG2,
+ MAX_OUT_HEIGHT_REG3,
+ MAX_OUT_HEIGHT_288,
+ MAX_OUT_HEIGHT_576,
+ MAX_OUT_HEIGHT_720,
+ MAX_OUT_HEIGHT_1080,
+};
+
/*
* VPDMA channel numbers
*/
@@ -198,11 +222,12 @@ void vpdma_add_sync_on_channel_ctd(struct vpdma_desc_list *list,
void vpdma_add_out_dtd(struct vpdma_desc_list *list, int width,
const struct v4l2_rect *c_rect,
const struct vpdma_data_format *fmt, dma_addr_t dma_addr,
- enum vpdma_channel chan, u32 flags);
+ 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,
const struct vpdma_data_format *fmt, dma_addr_t dma_addr,
- int raw_vpdma_chan, u32 flags);
+ 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,
const struct vpdma_data_format *fmt, dma_addr_t dma_addr,
@@ -221,6 +246,9 @@ void vpdma_set_line_mode(struct vpdma_data *vpdma, int line_mode,
enum vpdma_channel chan);
void vpdma_set_frame_start_event(struct vpdma_data *vpdma,
enum vpdma_frame_start_event fs_event, enum vpdma_channel chan);
+void vpdma_set_max_size(struct vpdma_data *vpdma, int reg_addr,
+ u32 width, u32 height);
+
void vpdma_set_bg_color(struct vpdma_data *vpdma,
struct vpdma_data_format *fmt, u32 color);
void vpdma_dump_regs(struct vpdma_data *vpdma);