diff options
Diffstat (limited to 'drivers/media/pci/bt8xx/bttvp.h')
-rw-r--r-- | drivers/media/pci/bt8xx/bttvp.h | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/drivers/media/pci/bt8xx/bttvp.h b/drivers/media/pci/bt8xx/bttvp.h index b750dfbc75cc..0368a583cf07 100644 --- a/drivers/media/pci/bt8xx/bttvp.h +++ b/drivers/media/pci/bt8xx/bttvp.h @@ -26,7 +26,7 @@ #include <media/v4l2-common.h> #include <media/v4l2-ctrls.h> #include <media/v4l2-fh.h> -#include <media/videobuf-dma-sg.h> +#include <media/videobuf2-dma-sg.h> #include <media/tveeprom.h> #include <media/rc-core.h> #include <media/i2c/ir-kbd-i2c.h> @@ -142,7 +142,8 @@ struct bttv_geometry { struct bttv_buffer { /* common v4l buffer stuff -- must be first */ - struct videobuf_buffer vb; + struct vb2_v4l2_buffer vbuf; + struct list_head list; /* bttv specific */ int btformat; @@ -171,6 +172,8 @@ struct bttv_vbi_fmt { }; /* bttv-vbi.c */ +extern const struct vb2_ops bttv_vbi_qops; + void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, unsigned int norm); struct bttv_crop { @@ -187,28 +190,6 @@ struct bttv_crop { __s32 max_scaled_height; }; -struct bttv_fh { - /* This must be the first field in this struct */ - struct v4l2_fh fh; - - struct bttv *btv; - int resources; - enum v4l2_buf_type type; - - /* video capture */ - struct videobuf_queue cap; - const struct bttv_format *fmt; - int width; - int height; - - /* vbi capture */ - struct videobuf_queue vbi; - /* Current VBI capture window as seen through this fh (cannot - be global for compatibility with earlier drivers). Protected - by struct bttv.lock and struct bttv_fh.vbi.lock. */ - struct bttv_vbi_fmt vbi_fmt; -}; - /* ---------------------------------------------------------- */ /* bttv-risc.c */ @@ -229,22 +210,27 @@ int bttv_risc_hook(struct bttv *btv, int slot, struct btcx_riscmem *risc, int bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf); int bttv_buffer_activate_video(struct bttv *btv, struct bttv_buffer_set *set); +int bttv_buffer_risc_vbi(struct bttv *btv, struct bttv_buffer *buf); int bttv_buffer_activate_vbi(struct bttv *btv, struct bttv_buffer *vbi); -void bttv_dma_free(struct videobuf_queue *q, struct bttv *btv, - struct bttv_buffer *buf); /* ---------------------------------------------------------- */ /* bttv-vbi.c */ +/* + * 2048 for compatibility with earlier driver versions. The driver really + * stores 1024 + tvnorm->vbipack * 4 samples per line in the buffer. Note + * tvnorm->vbipack is <= 0xFF (limit of VBIPACK_LO + HI is 0x1FF DWORDs) and + * VBI read()s store a frame counter in the last four bytes of the VBI image. + */ +#define VBI_BPL 2048 + #define VBI_DEFLINES 16 int bttv_try_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f); int bttv_g_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f); int bttv_s_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f); -extern const struct videobuf_queue_ops bttv_vbi_qops; - /* ---------------------------------------------------------- */ /* bttv-gpio.c */ @@ -269,6 +255,8 @@ extern int fini_bttv_i2c(struct bttv *btv); extern unsigned int bttv_verbose; extern unsigned int bttv_debug; extern unsigned int bttv_gpio; +int check_alloc_btres_lock(struct bttv *btv, int bit); +void free_btres_lock(struct bttv *btv, int bits); extern void bttv_gpio_tracking(struct bttv *btv, char *comment); #define dprintk(fmt, ...) \ @@ -390,7 +378,7 @@ struct bttv { v4l2_std_id std; int hue, contrast, bright, saturation; struct v4l2_framebuffer fbuf; - unsigned int field_count; + __u32 field_count; /* various options */ int opt_combfilter; @@ -441,12 +429,21 @@ struct bttv { unsigned int irq_me; unsigned int users; - struct bttv_fh init; + struct v4l2_fh fh; + enum v4l2_buf_type type; + + enum v4l2_field field; + int field_last; + + /* video capture */ + struct vb2_queue capq; const struct bttv_format *fmt; int width; int height; + + /* vbi capture */ + struct vb2_queue vbiq; struct bttv_vbi_fmt vbi_fmt; - unsigned int vbi_skip[2]; unsigned int vbi_count[2]; /* Application called VIDIOC_S_SELECTION. */ @@ -489,6 +486,8 @@ static inline unsigned int bttv_muxsel(const struct bttv *btv, #endif +void init_irqreg(struct bttv *btv); + #define btwrite(dat,adr) writel((dat), btv->bt848_mmio+(adr)) #define btread(adr) readl(btv->bt848_mmio+(adr)) |