diff options
Diffstat (limited to 'linux/drivers/media/common')
-rw-r--r-- | linux/drivers/media/common/saa7146.h | 9 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_fops.c | 28 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_vbi.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_video.c | 9 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_vv.h | 2 |
5 files changed, 26 insertions, 26 deletions
diff --git a/linux/drivers/media/common/saa7146.h b/linux/drivers/media/common/saa7146.h index 2b1329f89..d9354a5d2 100644 --- a/linux/drivers/media/common/saa7146.h +++ b/linux/drivers/media/common/saa7146.h @@ -1,10 +1,6 @@ #ifndef __SAA7146__ #define __SAA7146__ -/* fixme: this triggers bugs in video_read(), resulting -from flaws in video-buf.c => Gerd Knorr */ -//#define DEBUG_SPINLOCKS 1 - #include <linux/version.h> /* for version macros */ #include <linux/module.h> /* for module-version */ #include <linux/delay.h> /* for delay-stuff */ @@ -82,11 +78,6 @@ struct saa7146_extension struct pci_driver driver; struct pci_device_id *pci_tbl; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) - void (*inc_use)(struct saa7146_dev*); - void (*dec_use)(struct saa7146_dev*); -#endif - /* extension functions */ int (*probe)(struct saa7146_dev *); int (*attach)(struct saa7146_dev *, struct saa7146_pci_extension_data *); diff --git a/linux/drivers/media/common/saa7146_fops.c b/linux/drivers/media/common/saa7146_fops.c index 2c5596e77..217b85f14 100644 --- a/linux/drivers/media/common/saa7146_fops.c +++ b/linux/drivers/media/common/saa7146_fops.c @@ -4,6 +4,19 @@ #define KBUILD_MODNAME saa7146 #endif +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,48)) +static inline +int try_module_get(struct module *mod) +{ + if (!MOD_CAN_QUERY(mod)) + return 0; + __MOD_INC_USE_COUNT(mod); + return 1; +} + +#define module_put(mod) __MOD_DEC_USE_COUNT(mod) +#endif + #define BOARD_CAN_DO_VBI(dev) (dev->revision != 0 && dev->vv_data->vbi_minor != -1) /********************************************************************************/ @@ -203,17 +216,14 @@ int fops_open(struct inode *inode, struct file *file) goto out; } memset(fh,0,sizeof(*fh)); + + // FIXME: do we need to increase *our* usage count? - /* fixme: increase some usage counts */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) - dev->ext->inc_use(dev); - MOD_INC_USE_COUNT; -#else if( 0 == try_module_get(dev->ext->module)) { result = -EINVAL; goto out; } -#endif + file->private_data = fh; fh->dev = dev; fh->type = type; @@ -247,13 +257,7 @@ static int fops_release(struct inode *inode, struct file *file) saa7146_vbi_uops.release(dev,fh,file); } - /* fixme: decrease some usage counts */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) - dev->ext->dec_use(dev); - MOD_DEC_USE_COUNT; -#else module_put(dev->ext->module); -#endif file->private_data = NULL; kfree(fh); diff --git a/linux/drivers/media/common/saa7146_vbi.c b/linux/drivers/media/common/saa7146_vbi.c index baee2669f..664d8a484 100644 --- a/linux/drivers/media/common/saa7146_vbi.c +++ b/linux/drivers/media/common/saa7146_vbi.c @@ -212,7 +212,7 @@ int buffer_activate(struct saa7146_dev *dev, } static -int buffer_prepare(struct file *file, struct videobuf_buffer *vb) +int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l2_field field) { struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; @@ -239,6 +239,7 @@ int buffer_prepare(struct file *file, struct videobuf_buffer *vb) buf->vb.width = llength; buf->vb.height = lines; buf->vb.size = size; + buf->vb.field = field; // FIXME: check this saa7146_pgtable_free(dev->pci, &buf->pt[2]); saa7146_pgtable_alloc(dev->pci, &buf->pt[2]); @@ -379,6 +380,7 @@ void vbi_open(struct saa7146_dev *dev, struct saa7146_fh *fh) videobuf_queue_init(&fh->vbi_q, &vbi_qops, dev->pci, &dev->slock, V4L2_BUF_TYPE_VBI_CAPTURE, + V4L2_FIELD_SEQ_TB, // FIXME: does this really work? sizeof(struct saa7146_buf)); init_MUTEX(&fh->vbi_q.lock); diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c index e1ce84f4d..cdeeada3b 100644 --- a/linux/drivers/media/common/saa7146_video.c +++ b/linux/drivers/media/common/saa7146_video.c @@ -1100,8 +1100,8 @@ int buffer_activate (struct saa7146_dev *dev, return 0; } -static -int buffer_prepare(struct file *file, struct videobuf_buffer *vb) +static +int buffer_prepare(struct file *file, struct videobuf_buffer *vb, enum v4l2_field field) { struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; @@ -1128,7 +1128,8 @@ int buffer_prepare(struct file *file, struct videobuf_buffer *vb) fh->video_fmt.width,fh->video_fmt.height,size,v4l2_field_names[fh->video_fmt.field])); if (buf->vb.width != fh->video_fmt.width || buf->vb.height != fh->video_fmt.height || - buf->vb.size != size || + buf->vb.size != size || + buf->vb.field != field || buf->vb.field != fh->video_fmt.field || buf->fmt != &fh->video_fmt) { saa7146_dma_free(dev,buf); @@ -1140,6 +1141,7 @@ int buffer_prepare(struct file *file, struct videobuf_buffer *vb) buf->vb.width = fh->video_fmt.width; buf->vb.height = fh->video_fmt.height; buf->vb.size = size; + buf->vb.field = field; buf->fmt = &fh->video_fmt; buf->vb.field = fh->video_fmt.field; @@ -1266,6 +1268,7 @@ void video_open(struct saa7146_dev *dev, struct saa7146_fh *fh) videobuf_queue_init(&fh->video_q, &video_qops, dev->pci, &dev->slock, V4L2_BUF_TYPE_VIDEO_CAPTURE, + V4L2_FIELD_INTERLACED, sizeof(struct saa7146_buf)); init_MUTEX(&fh->video_q.lock); diff --git a/linux/drivers/media/common/saa7146_vv.h b/linux/drivers/media/common/saa7146_vv.h index 917f2b007..062622329 100644 --- a/linux/drivers/media/common/saa7146_vv.h +++ b/linux/drivers/media/common/saa7146_vv.h @@ -220,7 +220,7 @@ extern struct saa7146_use_ops saa7146_vbi_uops; #define V_OFFSET_SECAM 0x14 /* number of horizontal pixels to process */ -#define H_PIXELS_PAL 720 +#define H_PIXELS_PAL 680 #define H_PIXELS_NTSC 708 #define H_PIXELS_SECAM 720 |