Commit effdd2b7 authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] bttv driver update

This patch updates the bttv driver.  Changes:

 * moved much code to the generic video-buf.c helper module
   (bttv-driver.c, bttv-vbi.c, videobuf.c).
 * a number of changes in the card list and the card-specific code
   (bttv-cards.c).
 * misc small fixes here and there.
parent 76f0c877
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -24,7 +24,7 @@
#ifndef _BTTVP_H_
#define _BTTVP_H_
#define BTTV_VERSION_CODE KERNEL_VERSION(0,8,38)
#define BTTV_VERSION_CODE KERNEL_VERSION(0,8,42)
#include <linux/types.h>
#include <linux/wait.h>
......@@ -127,40 +127,20 @@ struct bttv_overlay {
};
struct bttv_vbi {
struct semaphore lock;
int users;
int lines;
/* mmap */
int streaming;
struct bttv_buffer *bufs[VIDEO_MAX_FRAME];
struct list_head stream;
/* read */
int reading;
int read_off;
struct bttv_buffer *read_buf;
int users;
int lines;
struct videobuf_queue q;
};
struct bttv_fh {
struct bttv *btv;
/* locking */
struct videobuf_queue q;
int resources;
struct semaphore lock;
/* keep current driver settings */
/* current settings */
const struct bttv_format *ovfmt;
struct bttv_overlay ov;
struct bttv_buffer buf;
/* for read() capture */
struct bttv_buffer read_buf;
int read_off;
/* mmap()'ed buffers */
struct bttv_buffer *bufs[VIDEO_MAX_FRAME];
struct list_head stream; /* v4l2 QBUF/DQBUF */
};
/* ---------------------------------------------------------- */
......@@ -221,6 +201,8 @@ int bttv_overlay_risc(struct bttv *btv, struct bttv_overlay *ov,
/* bttv-vbi.c */
extern struct video_device bttv_vbi_template;
extern struct videobuf_queue_ops vbi_qops;
/* ---------------------------------------------------------- */
/* bttv-driver.c */
......@@ -277,7 +259,8 @@ struct bttv {
/* gpio interface */
wait_queue_head_t gpioq;
int shutdown;
void (*audio_hook)(struct bttv *btv, struct video_audio *v, int set);
/* i2c layer */
struct i2c_adapter i2c_adap;
struct i2c_algo_bit_data i2c_algo;
......
This diff is collapsed.
......@@ -103,15 +103,14 @@ int videobuf_dma_free(struct videobuf_dmabuf *dma);
*/
struct videobuf_buffer;
typedef void (*videobuf_buffer_free)(struct file *file,
struct videobuf_buffer *vb);
struct videobuf_queue;
struct videobuf_mapping {
int count;
int highmem_ok;
unsigned long start;
unsigned long end;
struct videobuf_buffer **buflist;
struct videobuf_queue *q;
};
#define VBUF_FIELD_EVEN 1
......@@ -132,7 +131,6 @@ struct videobuf_buffer {
int i;
/* info about the buffer */
int type;
int width;
int height;
long size;
......@@ -146,7 +144,6 @@ struct videobuf_buffer {
unsigned long bsize; /* buffer size */
unsigned long baddr; /* buffer addr (userland ptr!) */
struct videobuf_mapping *map;
videobuf_buffer_free free;
/* touched by irq handler */
struct list_head queue;
......@@ -157,19 +154,76 @@ struct videobuf_buffer {
#endif
};
void* videobuf_alloc(int size, int type);
struct videobuf_queue_ops {
int (*buf_setup)(struct file *file, int *count, int *size);
int (*buf_prepare)(struct file *file,struct videobuf_buffer *vb,
int field);
void (*buf_queue)(struct file *file,struct videobuf_buffer *vb);
void (*buf_release)(struct file *file,struct videobuf_buffer *vb);
};
struct videobuf_queue {
struct semaphore lock;
spinlock_t *irqlock;
struct pci_dev *pci;
int type;
int msize;
struct videobuf_buffer *bufs[VIDEO_MAX_FRAME];
struct videobuf_queue_ops *ops;
/* capture via mmap() + ioctl(QBUF/DQBUF) */
int streaming;
struct list_head stream;
/* capture via read() */
int reading;
int read_off;
struct videobuf_buffer *read_buf;
};
void* videobuf_alloc(int size);
int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr);
int videobuf_iolock(struct pci_dev *pci, struct videobuf_buffer *vb);
void videobuf_queue_init(struct videobuf_queue *q,
struct videobuf_queue_ops *ops,
struct pci_dev *pci, spinlock_t *irqlock,
int type, int msize);
void videobuf_queue_cancel(struct file *file, struct videobuf_queue *q);
#ifdef HAVE_V4L2
void videobuf_status(struct v4l2_buffer *b, struct videobuf_buffer *vb);
void videobuf_status(struct v4l2_buffer *b, struct videobuf_buffer *vb,
int type);
int videobuf_reqbufs(struct file *file, struct videobuf_queue *q,
struct v4l2_requestbuffers *req);
int videobuf_querybuf(struct videobuf_queue *q, struct v4l2_buffer *b);
int videobuf_qbuf(struct file *file, struct videobuf_queue *q,
struct v4l2_buffer *b);
int videobuf_dqbuf(struct file *file, struct videobuf_queue *q,
struct v4l2_buffer *b);
#endif
int videobuf_mmap_setup(struct file *file, struct videobuf_buffer **buflist,
int msize, int bcount, int bsize, int type,
videobuf_buffer_free free);
int videobuf_mmap_free(struct file *file, struct videobuf_buffer **buflist);
int videobuf_streamon(struct file *file, struct videobuf_queue *q);
int videobuf_streamoff(struct file *file, struct videobuf_queue *q);
int videobuf_read_start(struct file *file, struct videobuf_queue *q);
void videobuf_read_stop(struct file *file, struct videobuf_queue *q);
ssize_t videobuf_read_stream(struct file *file, struct videobuf_queue *q,
char *data, size_t count, loff_t *ppos,
int vbihack);
ssize_t videobuf_read_one(struct file *file, struct videobuf_queue *q,
char *data, size_t count, loff_t *ppos);
unsigned int videobuf_poll_stream(struct file *file,
struct videobuf_queue *q,
poll_table *wait);
int videobuf_mmap_setup(struct file *file, struct videobuf_queue *q,
int bcount, int bsize);
int videobuf_mmap_free(struct file *file, struct videobuf_queue *q);
int videobuf_mmap_mapper(struct vm_area_struct *vma,
struct videobuf_buffer **buflist);
struct videobuf_queue *q);
/* --------------------------------------------------------------------- */
/*
* Local variables:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment