diff options
Diffstat (limited to 'drivers/media/platform/omap/omap_voutdef.h')
-rw-r--r-- | drivers/media/platform/omap/omap_voutdef.h | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/drivers/media/platform/omap/omap_voutdef.h b/drivers/media/platform/omap/omap_voutdef.h index c740393c8509..1cff6dea1879 100644 --- a/drivers/media/platform/omap/omap_voutdef.h +++ b/drivers/media/platform/omap/omap_voutdef.h @@ -11,6 +11,7 @@ #ifndef OMAP_VOUTDEF_H #define OMAP_VOUTDEF_H +#include <media/videobuf2-dma-contig.h> #include <media/v4l2-ctrls.h> #include <video/omapfb_dss.h> #include <video/omapvrfb.h> @@ -113,6 +114,20 @@ struct omap2video_device { struct omap_overlay_manager *managers[MAX_MANAGERS]; }; +/* buffer for one video frame */ +struct omap_vout_buffer { + /* common v4l buffer stuff -- must be first */ + struct vb2_v4l2_buffer vbuf; + struct list_head queue; +}; + +static inline struct omap_vout_buffer *vb2_to_omap_vout_buffer(struct vb2_buffer *vb) +{ + struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); + + return container_of(vbuf, struct omap_vout_buffer, vbuf); +} + /* per-device data structure */ struct omap_vout_device { @@ -121,29 +136,12 @@ struct omap_vout_device { struct omap2video_device *vid_dev; struct v4l2_ctrl_handler ctrl_handler; int vid; - int opened; - /* we don't allow to change image fmt/size once buffer has - * been allocated - */ - int buffer_allocated; /* allow to reuse previously allocated buffer which is big enough */ int buffer_size; - /* keep buffer info across opens */ - unsigned long buf_virt_addr[VIDEO_MAX_FRAME]; - unsigned long buf_phy_addr[VIDEO_MAX_FRAME]; enum omap_color_mode dss_mode; - /* we don't allow to request new buffer when old buffers are - * still mmapped - */ - int mmap_count; - - spinlock_t vbq_lock; /* spinlock for videobuf queues */ - unsigned long field_count; /* field counter for videobuf_buffer */ - - /* non-NULL means streaming is in progress. */ - bool streaming; + u32 sequence; struct v4l2_pix_format pix; struct v4l2_rect crop; @@ -169,19 +167,14 @@ struct omap_vout_device { unsigned char pos; int ps, vr_ps, line_length, first_int, field_id; - enum v4l2_memory memory; - struct videobuf_buffer *cur_frm, *next_frm; + struct omap_vout_buffer *cur_frm, *next_frm; + spinlock_t vbq_lock; /* spinlock for dma_queue */ struct list_head dma_queue; u8 *queued_buf_addr[VIDEO_MAX_FRAME]; u32 cropped_offset; s32 tv_field1_offset; void *isr_handle; - - /* Buffer queue variables */ - struct omap_vout_device *vout; - enum v4l2_buf_type type; - struct videobuf_queue vbq; - int io_allowed; + struct vb2_queue vq; }; |