V4L/DVB fixes
cover V4L/DVB fixes
Linus,
Please pull 'master' from:
git://git.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git master
It fixes some OOPS and compilation troubles on non x86 platforms and some Kconfig broken dependencies. There are several fixes at the drivers, including some fixes to support some not so common standards, like PAL/60.
The biggest changes are some required fixes on usbvision. There's no risk of causing regression, since this driver were just introduced at kernel.
- Fix autosearch index
- Put remote-debugging in the right place
- Fix namespace conflict between w9968cf.c on MIPS
- Usbvision: possible cleanups
- Removal of unused code from usbvision-i2c.c
- VIDEO_PALETTE_YUYV and VIDEO_PALETTE_YUV422 are the same palette
- Add missing tuner module option pal=60 for PAL-60 support.
- Add PAL-60 support for cx2584x.
- Usbvision memory fixes
- Dvb-core: fix bug in CRC-32 checking on 64-bit systems
- Dvb-core: fix printk type warning
- Fixes compilation when CONFIG_V4L1_COMPAT is not selected
- Fixes bug 7267: PAL/60 is not working
- Fix broken audio mode handling for line-in in msp3400.
- Force temporal filter to 0 when scaling to prevent ghosting.
- LOG_STATUS should show the real temporal filter value.
- Cx2341x audio_properties is an u16, not u8
- Cpia2/cpia2_usb.c: fix error-path leak
- Cafe_ccic.c: fix NULL dereference
- Fix typo in saa7134-dvb.c
- Vivi: fix use after free in list_for_each()
- Vivi: fix kthread_run() error check
- Msp3400: fix kthread_run error check
- Bttv: delete duplicated ioremap()
- Allyesconfig build fixes on some non x86 arch
- Add two required headers on kernel 2.6.20-rc1
- Usbvision fix: It was using "&&" instead "&"
- Cx88: Fix leadtek_eeprom tagging
Cheers,
Mauro.
V4L/DVB development is hosted at http://linuxtv.org
---
drivers/media/common/ir-functions.c | 1 drivers/media/dvb/dvb-core/dvb_net.c | 4 - drivers/media/dvb/dvb-usb/nova-t-usb2.c | 4 - drivers/media/dvb/frontends/dib3000mc.c | 2 drivers/media/video/Kconfig | 2 drivers/media/video/bt8xx/bttv-driver.c | 4 - drivers/media/video/cafe_ccic.c | 2 drivers/media/video/cpia2/cpia2_usb.c | 4 + drivers/media/video/cx2341x.c | 21 ++- drivers/media/video/cx25840/cx25840-vbi.c | 9 + drivers/media/video/cx88/cx88-cards.c | 2 drivers/media/video/cx88/cx88-core.c | 35 +++-- drivers/media/video/cx88/cx88.h | 2 drivers/media/video/em28xx/em28xx-video.c | 4 - drivers/media/video/meye.c | 4 - drivers/media/video/msp3400-driver.c | 8 - drivers/media/video/msp3400-kthreads.c | 11 +- drivers/media/video/saa7134/saa7134-dvb.c | 8 + drivers/media/video/tuner-core.c | 4 + drivers/media/video/usbvision/usbvision-cards.c | 11 +- drivers/media/video/usbvision/usbvision-core.c | 83 +++++-------- drivers/media/video/usbvision/usbvision-i2c.c | 35 +---- drivers/media/video/usbvision/usbvision-video.c | 150 ++++++++++++++--------- drivers/media/video/usbvision/usbvision.h | 27 ---- drivers/media/video/vivi.c | 8 + drivers/media/video/w9966.c | 2 drivers/media/video/w9968cf.c | 24 ++-- drivers/media/video/zoran_device.c | 3 include/media/cx2341x.h | 2 include/media/ir-common.h | 1 30 files changed, 242 insertions(+), 235 deletions(-)
PATCH 1/28 V4L/DVB (4955): Fix autosearch index
From: Mario Rossi <[email protected]>
After rewriting the driver the wrong autosearch index was used when COFDM-parameter needed to be detected.
Thanks to Mario Rossi who found it.
---
drivers/media/dvb/frontends/dib3000mc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/dvb/frontends/dib3000mc.c +1 -1
@@ -515,7 +515,7 @@ static int dib3000mc_autosearch_start(st fchan.vit_alpha =1 ; fchan.vit_code_rate_hp =2 ; fchan.vit_code_rate_lp =2 ; fchan.vit_hrch =0 ; fchan.vit_select_hp =1 ; -dib3000mc_set_channel_cfg (state, &fchan,7 ); +dib3000mc_set_channel_cfg (state, &fchan,11 ); reg =dib3000mc_read_word (state,0 );dib3000mc_write_word (state,0 , reg | (1 <<8 ));
PATCH 2/28 V4L/DVB (4956): [NOVA-T-USB2] Put remote-debugging in the right place
In reply to Mauro Carvalho ChehabFrom: Mario Rossi <[email protected]>
This patch removes unnecessary (and misleading) debug output (it printed the values of the keys in the table up to the value of the key pressed).
---
drivers/media/dvb/dvb-usb/nova-t-usb2.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/media/dvb/dvb-usb/nova-t-usb2.c +3 -1
@@ -90,9 +90,11 @@ static int nova_t_rc_query(struct dvb_usdeb_rc ("raw key code 0x%02x, 0x%02x, 0x%02x to c: %02x d: %02x toggle: %d\n" ,key[1 ],key[2 ],key[3 ],custom,data,toggle);for (i =0 ; i <ARRAY_SIZE (haupp_rc_keys); i++) { -deb_rc ("c: %x, d: %x\n" ,haupp_rc_keys[i].data,haupp_rc_keys[i].custom);if (haupp_rc_keys[i].data == data && haupp_rc_keys[i].custom == custom) { + +deb_rc ("c: %x, d: %x\n" ,haupp_rc_keys[i].data,haupp_rc_keys[i].custom); + *event = haupp_rc_keys[i].event; *state =REMOTE_KEY_PRESSED ;if (st->old_toggle == toggle) {
PATCH 3/28 V4L/DVB (4958): Fix namespace conflict between w9968cf.c on MIPS
In reply to Mauro Carvalho ChehabFrom: Ralf Baechle <[email protected]>
Both use __SC. Since __* is sort of private namespace I've choosen to fix this in the driver. For consistency I decieded to also change __UNSC to UNSC.
---
drivers/media/video/w9968cf.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-)
drivers/media/video/w9968cf.c +12 -12
@@ -1827,8 +1827,8 @@ w9968cf_set_window(struct w9968cf_deviceint err =0 ;/* Work around to avoid FP arithmetics */ -#define __SC (x) ((x) << 10) -#define __UNSC (x) ((x) >> 10) +#define SC (x) ((x) << 10) +#define UNSC (x) ((x) >> 10)/* Make sure we are using a supported resolution */ if ((err = w9968cf_adjust_window_size(cam, (u16*)&win.width,
@@ -1836,15 +1836,15 @@ w9968cf_set_window(struct w9968cf_device goto error;/* Scaling factors */ - fw =__SC (win.width) / cam->maxwidth; - fh =__SC (win.height) / cam->maxheight; + fw =SC (win.width) / cam->maxwidth; + fh =SC (win.height) / cam->maxheight;/* Set up the width and height values used by the chip */ if ((win.width > cam->maxwidth) || (win.height > cam->maxheight)) { cam->vpp_flag |=VPP_UPSCALE ;/* Calculate largest w,h mantaining the same w/h ratio */ - w = (fw >= fh) ? cam->maxwidth :__SC (win.width)/fh; - h = (fw >= fh) ?__SC (win.height)/fw : cam->maxheight; + w = (fw >= fh) ? cam->maxwidth :SC (win.width)/fh; + h = (fw >= fh) ?SC (win.height)/fw : cam->maxheight;if (w < cam->minwidth)/* just in case */ w = cam->minwidth;if (h < cam->minheight)/* just in case */
@@ -1861,8 +1861,8 @@ w9968cf_set_window(struct w9968cf_device/* Calculate cropped area manteining the right w/h ratio */ if (cam->largeview && !(cam->vpp_flag &VPP_UPSCALE )) { - cw = (fw >= fh) ? cam->maxwidth :__SC (win.width)/fh; - ch = (fw >= fh) ?__SC (win.height)/fw : cam->maxheight; + cw = (fw >= fh) ? cam->maxwidth :SC (win.width)/fh; + ch = (fw >= fh) ?SC (win.height)/fw : cam->maxheight; }else { cw = w; ch = h;
@@ -1901,8 +1901,8 @@ w9968cf_set_window(struct w9968cf_device/* We have to scale win.x and win.y offsets */ if ( (cam->largeview && !(cam->vpp_flag &VPP_UPSCALE )) || (cam->vpp_flag &VPP_UPSCALE ) ) { - ax =__SC (win.x)/fw; - ay =__SC (win.y)/fh; + ax =SC (win.x)/fw; + ay =SC (win.y)/fh; }else { ax = win.x; ay = win.y;
@@ -1917,8 +1917,8 @@ w9968cf_set_window(struct w9968cf_device/* Adjust win.x, win.y */ if ( (cam->largeview && !(cam->vpp_flag &VPP_UPSCALE )) || (cam->vpp_flag &VPP_UPSCALE ) ) { - win.x =__UNSC (ax*fw); - win.y =__UNSC (ay*fh); + win.x =UNSC (ax*fw); + win.y =UNSC (ay*fh); }else { win.x = ax; win.y = ay;
PATCH 4/28 V4L/DVB (4959): Usbvision: possible cleanups
In reply to Mauro Carvalho ChehabFrom: Adrian Bunk <[email protected]>
This patch contains the following possible cleanups:
- make needlessly global functions static
- remove the unused EXPORT_SYMBOL's
---
drivers/media/video/usbvision/usbvision-core.c | 33 +++++++++++++---------- drivers/media/video/usbvision/usbvision-i2c.c | 5 +-- drivers/media/video/usbvision/usbvision-video.c | 2 + drivers/media/video/usbvision/usbvision.h | 2 - 4 files changed, 21 insertions(+), 21 deletions(-)
drivers/media/video/usbvision/usbvision-core.c +19 -14
@@ -118,7 +118,7 @@ static int usbvision_measure_bandwidth (* This is used when initializing the contents of the area. */ -void *usbvision_rvmalloc (unsigned long size) +static void *usbvision_rvmalloc (unsigned long size) {void *mem;unsigned long adr;
@@ -181,7 +181,7 @@ #endif/******************************** * scratch ring buffer handling ********************************/ -int scratch_len (struct usb_usbvision *usbvision)/*This returns the amount of data actually in the buffer */ +static int scratch_len (struct usb_usbvision *usbvision)/*This returns the amount of data actually in the buffer */ {int len = usbvision->scratch_write_ptr - usbvision->scratch_read_ptr;if (len <0 ) {
@@ -194,7 +194,7 @@ int scratch_len(struct usb_usbvision *us/* This returns the free space left in the buffer */ -int scratch_free (struct usb_usbvision *usbvision) +static int scratch_free (struct usb_usbvision *usbvision) {int free = usbvision->scratch_read_ptr - usbvision->scratch_write_ptr;if (free <=0 ) {
@@ -211,7 +211,8 @@ int scratch_free(struct usb_usbvision *u/* This puts data into the buffer */ -int scratch_put (struct usb_usbvision *usbvision,unsigned char *data,int len) +static int scratch_put (struct usb_usbvision *usbvision,unsigned char *data, +int len) {int len_part;
@@ -237,7 +238,7 @@ int scratch_put(struct usb_usbvision *us }/* This marks the write_ptr as position of new frame header */ -void scratch_mark_header (struct usb_usbvision *usbvision) +static void scratch_mark_header (struct usb_usbvision *usbvision) {PDEBUG (DBG_SCRATCH ,"header at write_ptr=%d\n" , usbvision->scratch_headermarker_write_ptr);
@@ -248,7 +249,8 @@ void scratch_mark_header(struct usb_usbv }/* This gets data from the buffer at the given "ptr" position */ -int scratch_get_extra (struct usb_usbvision *usbvision,unsigned char *data,int *ptr,int len) +static int scratch_get_extra (struct usb_usbvision *usbvision, +unsigned char *data,int *ptr,int len) {int len_part;if (*ptr + len < scratch_buf_size) {
@@ -274,7 +276,8 @@ int scratch_get_extra(struct usb_usbvisi/* This sets the scratch extra read pointer */ -void scratch_set_extra_ptr (struct usb_usbvision *usbvision,int *ptr,int len) +static void scratch_set_extra_ptr (struct usb_usbvision *usbvision,int *ptr, +int len) { *ptr = (usbvision->scratch_read_ptr + len)%scratch_buf_size;
@@ -283,7 +286,7 @@ void scratch_set_extra_ptr(struct usb_us/*This increments the scratch extra read pointer */ -void scratch_inc_extra_ptr (int *ptr,int len) +static void scratch_inc_extra_ptr (int *ptr,int len) { *ptr = (*ptr + len) % scratch_buf_size;
@@ -292,7 +295,8 @@ void scratch_inc_extra_ptr(int *ptr, int/* This gets data from the buffer */ -int scratch_get (struct usb_usbvision *usbvision,unsigned char *data,int len) +static int scratch_get (struct usb_usbvision *usbvision,unsigned char *data, +int len) {int len_part;if (usbvision->scratch_read_ptr + len < scratch_buf_size) {
@@ -318,7 +322,8 @@ int scratch_get(struct usb_usbvision *us/* This sets read pointer to next header and returns it */ -int scratch_get_header (struct usb_usbvision *usbvision,struct usbvision_frame_header *header) +static int scratch_get_header (struct usb_usbvision *usbvision, +struct usbvision_frame_header *header) {int errCode =0 ;
@@ -346,7 +351,7 @@ int scratch_get_header(struct usb_usbvis/*This removes len bytes of old data from the buffer */ -void scratch_rm_old (struct usb_usbvision *usbvision,int len) +static void scratch_rm_old (struct usb_usbvision *usbvision,int len) { usbvision->scratch_read_ptr += len;
@@ -356,7 +361,7 @@ void scratch_rm_old(struct usb_usbvision/*This resets the buffer - kills all data in it too */ -void scratch_reset (struct usb_usbvision *usbvision) +static void scratch_reset (struct usb_usbvision *usbvision) {PDEBUG (DBG_SCRATCH ,"\n" );
@@ -399,8 +404,8 @@ void usbvision_scratch_free(struct usb_u* 1: Draw a colored grid * */ -void usbvision_testpattern (struct usb_usbvision *usbvision,int fullframe, -int pmode) +static void usbvision_testpattern (struct usb_usbvision *usbvision, +int fullframe,int pmode) {static const char proc[] ="usbvision_testpattern" ;struct usbvision_frame *frame;
drivers/media/video/usbvision/usbvision-i2c.c +1 -4
@@ -213,7 +213,7 @@ static struct i2c_algorithm i2c_usb_algo/* * registering functions to load algorithms at runtime */ -int usbvision_i2c_usb_add_bus (struct i2c_adapter *adap) +static int usbvision_i2c_usb_add_bus (struct i2c_adapter *adap) {PDEBUG (DBG_I2C ,"I2C debugging is enabled [i2c]" );PDEBUG (DBG_ALGO ,"ALGO debugging is enabled [i2c]" );
@@ -559,9 +559,6 @@ static struct i2c_client i2c_client_temp .name = "usbvision internal", }; -EXPORT_SYMBOL (usbvision_i2c_usb_add_bus); -EXPORT_SYMBOL (usbvision_i2c_usb_del_bus); -/* * Overrides for Emacs so that we follow Linus's tabbing style. * ---------------------------------------------------------------------------
drivers/media/video/usbvision/usbvision-video.c +1 -1
@@ -1884,7 +1884,7 @@ static struct usb_driver usbvision_drive* This procedure preprocesses CustomDevice parameter if any * */ -void customdevice_process (void ) +static void customdevice_process (void ) { usbvision_device_data[0 ]=usbvision_device_data[1 ]; usbvision_table[0 ]=usbvision_table[1 ];
drivers/media/video/usbvision/usbvision.h +0 -2
@@ -489,7 +489,6 @@ struct usb_usbvision {/* i2c-algo-usb declaration */ /* --------------------------------------------------------------- */ -int usbvision_i2c_usb_add_bus (struct i2c_adapter *);int usbvision_i2c_usb_del_bus (struct i2c_adapter *);static inline void *i2c_get_algo_usb_data (struct i2c_algo_usb_data *dev)
@@ -510,7 +509,6 @@ int usbvision_init_i2c(struct usb_usbvisvoid call_i2c_clients (struct usb_usbvision *usbvision,unsigned int cmd,void *arg);/* defined in usbvision-core.c */ -void *usbvision_rvmalloc (unsigned long size);void usbvision_rvfree (void *mem,unsigned long size);int usbvision_read_reg (struct usb_usbvision *usbvision,unsigned char reg); int usbvision_write_reg(struct usb_usbvision *usbvision, unsigned char reg,
PATCH 5/28 V4L/DVB (4960): Removal of unused code from usbvision-i2c.c
In reply to Mauro Carvalho ChehabFrom: Mauro Carvalho Chehab <[email protected]>
i2c_adap is almost not used. This patch removes it, cleaning the i2c support, and improving driver understanding.
Thanks to Thierry Merle for testing it.
---
drivers/media/video/usbvision/usbvision-i2c.c | 27 ++++--------------------- drivers/media/video/usbvision/usbvision.h | 23 --------------------- 2 files changed, 4 insertions(+), 46 deletions(-)
drivers/media/video/usbvision/usbvision-i2c.c +4 -23
@@ -58,7 +58,6 @@ static int usbvision_i2c_read(void *datastatic inline int try_write_address (struct i2c_adapter *i2c_adap,unsigned char addr,int retries) { -struct i2c_algo_usb_data *adap = i2c_adap->algo_data;void *data;int i, ret =-1 ;char buf[4 ];
@@ -69,10 +68,10 @@ static inline int try_write_address(stru ret = (usbvision_i2c_write (data, addr, buf,1 ));if (ret ==1 )break ;/* success! */ -udelay (5 /*adap->udelay */ ); +udelay (5 );if (i == retries)/* no success */ break ; -udelay (adap->udelay); +udelay (10 ); }if (i) {PDEBUG (DBG_ALGO ,"Needed %d retries for address %#2x" , i, addr);
@@ -84,7 +83,6 @@ static inline int try_write_address(strustatic inline int try_read_address (struct i2c_adapter *i2c_adap,unsigned char addr,int retries) { -struct i2c_algo_usb_data *adap = i2c_adap->algo_data;void *data;int i, ret =-1 ;char buf[4 ];
@@ -94,10 +92,10 @@ static inline int try_read_address(struc ret = (usbvision_i2c_read (data, addr, buf,1 ));if (ret ==1 )break ;/* success! */ -udelay (5 /*adap->udelay */ ); +udelay (5 );if (i == retries)/* no success */ break ; -udelay (adap->udelay); +udelay (10 ); }if (i) {PDEBUG (DBG_ALGO ,"Needed %d retries for address %#2x" , i, addr);
@@ -248,15 +246,12 @@ int usbvision_i2c_usb_del_bus(struct i2c/* usbvision specific I2C functions */ /* ----------------------------------------------------------------------- */ static struct i2c_adapter i2c_adap_template; -static struct i2c_algo_usb_data i2c_algo_template;static struct i2c_client i2c_client_template;int usbvision_init_i2c (struct usb_usbvision *usbvision) {memcpy (&usbvision->i2c_adap, &i2c_adap_template,sizeof (struct i2c_adapter )); -memcpy (&usbvision->i2c_algo, &i2c_algo_template, -sizeof (struct i2c_algo_usb_data ));memcpy (&usbvision->i2c_client, &i2c_client_template,sizeof (struct i2c_client ));
@@ -266,9 +261,7 @@ int usbvision_init_i2c(struct usb_usbvisi2c_set_adapdata (&usbvision->i2c_adap, usbvision);i2c_set_clientdata (&usbvision->i2c_client, usbvision); -i2c_set_algo_usb_data (&usbvision->i2c_algo, usbvision); - usbvision->i2c_adap.algo_data = &usbvision->i2c_algo; usbvision->i2c_client.adapter = &usbvision->i2c_adap;if (usbvision_write_reg (usbvision,USBVISION_SER_MODE ,USBVISION_IIC_LRNACK ) <0 ) {
@@ -297,7 +290,6 @@ #endifvoid call_i2c_clients (struct usb_usbvision *usbvision,unsigned int cmd,void *arg) { -BUG_ON (NULL == usbvision->i2c_adap.algo_data);i2c_clients_command (&usbvision->i2c_adap, cmd, arg); }
@@ -531,21 +523,10 @@ static int usbvision_i2c_read(void *datareturn rdcount; } -static struct i2c_algo_usb_data i2c_algo_template = { - .data =NULL , - .inb = usbvision_i2c_read, - .outb = usbvision_i2c_write, - .udelay =10 , - .mdelay =10 , - .timeout =100 , -}; -static struct i2c_adapter i2c_adap_template = { .owner =THIS_MODULE , .name ="usbvision" , .id =I2C_HW_B_BT848 ,/* FIXME */ - .algo =NULL , - .algo_data =NULL , .client_register = attach_inform, .client_unregister = detach_inform, #ifdef I2C_ADAP_CLASS_TV_ANALOG
drivers/media/video/usbvision/usbvision.h +0 -23
@@ -219,18 +219,6 @@ #define USBVISION_IS_OPERATIONAL(udevice ((udevice)->last_error == 0) && \ (!(udevice)->remove_pending)) -/* I2C structures */ -struct i2c_algo_usb_data { -void *data;/* private data for lowlevel routines */ -int (*inb) (void *data,unsigned char addr,char *buf,short len); -int (*outb) (void *data,unsigned char addr,char *buf,short len); - -/* local settings */ -int udelay; -int mdelay; -int timeout; -}; -#define I2C_USB_ADAP_MAX 16/* ----------------------------------------------------------------- */
@@ -383,7 +371,6 @@ struct usb_usbvision {/* i2c Declaration Section*/ struct i2c_adapter i2c_adap; -struct i2c_algo_usb_data i2c_algo;struct i2c_client i2c_client;struct urb *ctrlUrb;
@@ -491,16 +478,6 @@ struct usb_usbvision {int usbvision_i2c_usb_del_bus (struct i2c_adapter *); -static inline void *i2c_get_algo_usb_data (struct i2c_algo_usb_data *dev) -{ -return dev->data; -} - -static inline void i2c_set_algo_usb_data (struct i2c_algo_usb_data *dev,void *data) -{ - dev->data = data; -} -/* ----------------------------------------------------------------------- */ /* usbvision specific I2C functions */
PATCH 6/28 V4L/DVB (4964): VIDEO_PALETTE_YUYV and VIDEO_PALETTE_YUV422 are the same palette
In reply to Mauro Carvalho ChehabFrom: [email protected] <[email protected]>
Consistent handling of VIDEO_PALETTE_YUYV and VIDEO_PALETTE_YUV422
---
drivers/media/video/meye.c | 4 ++-- drivers/media/video/w9966.c | 2 +- drivers/media/video/zoran_device.c | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-)
drivers/media/video/meye.c +2 -2
@@ -923,7 +923,7 @@ static int meye_do_ioctl(struct inode *istruct video_picture *p = arg;if (p->depth !=16 )return -EINVAL ; -if (p->palette !=VIDEO_PALETTE_YUV422 ) +if (p->palette !=VIDEO_PALETTE_YUV422 && p->palette !=VIDEO_PALETTE_YUYV )return -EINVAL ;mutex_lock (&meye.lock); sonypi_camera_command(SONYPI_COMMAND_SETCAMERABRIGHTNESS,
@@ -978,7 +978,7 @@ static int meye_do_ioctl(struct inode *iif (vm->frame >= gbuffers || vm->frame <0 )return -EINVAL ; -if (vm->format !=VIDEO_PALETTE_YUV422 ) +if (vm->format !=VIDEO_PALETTE_YUV422 && vm->format !=VIDEO_PALETTE_YUYV )return -EINVAL ;if (vm->height * vm->width *2 > gbufsize)return -EINVAL ;
drivers/media/video/w9966.c +1 -1
@@ -789,7 +789,7 @@ static int w9966_v4l_do_ioctl(struct inocase VIDIOCSPICT : {struct video_picture *vpic = arg; -if (vpic->depth !=16 || vpic->palette !=VIDEO_PALETTE_YUV422 ) +if (vpic->depth !=16 || (vpic->palette !=VIDEO_PALETTE_YUV422 && vpic->palette !=VIDEO_PALETTE_YUYV ))return -EINVAL ; cam->brightness = vpic->brightness >>8 ;
drivers/media/video/zoran_device.c +2 -1
@@ -429,7 +429,7 @@ zr36057_set_vfe (struct zoran reg |= (HorDcm << ZR36057_VFESPFR_HorDcm); reg |= (VerDcm << ZR36057_VFESPFR_VerDcm); reg |= (DispMode << ZR36057_VFESPFR_DispMode); -if (format->palette !=VIDEO_PALETTE_YUV422 ) +if (format->palette !=VIDEO_PALETTE_YUV422 && format->palette !=VIDEO_PALETTE_YUYV ) reg |= ZR36057_VFESPFR_LittleEndian;/* RJ: I don't know, why the following has to be the opposite * of the corresponding ZR36060 setting, but only this way
@@ -441,6 +441,7 @@ zr36057_set_vfe (struct zoran reg |= ZR36057_VFESPFR_TopField;switch (format->palette) { +case VIDEO_PALETTE_YUYV :case VIDEO_PALETTE_YUV422 : reg |=ZR36057_VFESPFR_YUV422 ;break ;
PATCH 7/28 V4L/DVB (4967): Add missing tuner module option pal=60 for PAL-60 support.
In reply to Mauro Carvalho ChehabFrom: Hans Verkuil <[email protected]>
---
drivers/media/video/tuner-core.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/media/video/tuner-core.c +4 -0
@@ -267,6 +267,10 @@ static int tuner_fixup_std(struct tuner {if ((t->std &V4L2_STD_PAL ) ==V4L2_STD_PAL ) {switch (pal[0 ]) { +case '6' : +tuner_dbg ("insmod fixup: PAL => PAL-60\n" ); + t->std =V4L2_STD_PAL_60 ; +break ;case 'b' :case 'B' :case 'g' :
PATCH 8/28 V4L/DVB (4968): Add PAL-60 support for cx2584x.
In reply to Mauro Carvalho ChehabFrom: Hans Verkuil <[email protected]>
---
drivers/media/video/cx25840/cx25840-vbi.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
drivers/media/video/cx25840/cx25840-vbi.c +8 -1
@@ -128,7 +128,14 @@ void cx25840_vbi_setup(struct i2c_client uv_lpf=1 ; src_decimation=0x21f ; -if (std ==V4L2_STD_PAL_M ) { +if (std ==V4L2_STD_PAL_60 ) { + vblank=26 ; + vblank656=26 ; + burst=0x5b ; + luma_lpf=2 ; + comb=0x20 ; + sc=0x0a8263 ; + }else if (std ==V4L2_STD_PAL_M ) { vblank=20 ; vblank656=24 ; burst=0x61 ;
PATCH 9/28 V4L/DVB (4970): Usbvision memory fixes
In reply to Mauro Carvalho ChehabFrom: Thierry MERLE <[email protected]>
- fix decompression buffer allocation not done at first driver open
- simplification of USB sbuf allocation (use of usb_buffer_alloc)
- replaced vmalloc by vmalloc_32 (for homogeneity)
- add of saa7111 (i2cAddr=0x48) detection printout in attach_inform
---
drivers/media/video/usbvision/usbvision-core.c | 48 ++++++----------------- drivers/media/video/usbvision/usbvision-i2c.c | 3 + drivers/media/video/usbvision/usbvision-video.c | 14 ++----- drivers/media/video/usbvision/usbvision.h | 2 - 4 files changed, 19 insertions(+), 48 deletions(-)
drivers/media/video/usbvision/usbvision-core.c +12 -36
@@ -374,7 +374,7 @@ static void scratch_reset(struct usb_usbint usbvision_scratch_alloc (struct usb_usbvision *usbvision) { - usbvision->scratch =vmalloc (scratch_buf_size); + usbvision->scratch =vmalloc_32 (scratch_buf_size);scratch_reset (usbvision);if (usbvision->scratch ==NULL ) { err("%s: unable to allocate %d bytes for scratch",
@@ -485,7 +485,7 @@ static void usbvision_testpattern(structint usbvision_decompress_alloc (struct usb_usbvision *usbvision) {int IFB_size =MAX_FRAME_WIDTH *MAX_FRAME_HEIGHT *3 /2 ; - usbvision->IntraFrameBuffer =vmalloc (IFB_size); + usbvision->IntraFrameBuffer =vmalloc_32 (IFB_size);if (usbvision->IntraFrameBuffer ==NULL ) {err ("%s: unable to allocate %d for compr. frame buffer" , __FUNCTION__, IFB_size);return -ENOMEM ;
@@ -2204,6 +2204,7 @@ int usbvision_power_on(struct usb_usbvisusbvision_write_reg (usbvision,USBVISION_PWR_REG ,USBVISION_SSPND_EN );usbvision_write_reg (usbvision,USBVISION_PWR_REG ,USBVISION_SSPND_EN |USBVISION_RES2 ); +usbvision_write_reg (usbvision,USBVISION_PWR_REG ,USBVISION_SSPND_EN |USBVISION_PWR_VID ); errCode = usbvision_write_reg(usbvision, USBVISION_PWR_REG,
@@ -2351,40 +2352,6 @@ int usbvision_setup(struct usb_usbvisionreturn USBVISION_IS_OPERATIONAL (usbvision); } - -int usbvision_sbuf_alloc (struct usb_usbvision *usbvision) -{ -int i, errCode =0 ; -const int sb_size =USBVISION_URB_FRAMES *USBVISION_MAX_ISOC_PACKET_SIZE ; - -/* Clean pointers so we know if we allocated something */ -for (i =0 ; i <USBVISION_NUMSBUF ; i++) - usbvision->sbuf[i].data =NULL ; - -for (i =0 ; i <USBVISION_NUMSBUF ; i++) { - usbvision->sbuf[i].data =kzalloc (sb_size,GFP_KERNEL ); -if (usbvision->sbuf[i].data ==NULL ) { -err ("%s: unable to allocate %d bytes for sbuf" , __FUNCTION__, sb_size); - errCode = -ENOMEM ; -break ; - } - } -return errCode; -} - - -void usbvision_sbuf_free (struct usb_usbvision *usbvision) -{ -int i; - -for (i =0 ; i <USBVISION_NUMSBUF ; i++) { -if (usbvision->sbuf[i].data !=NULL ) { -kfree (usbvision->sbuf[i].data); - usbvision->sbuf[i].data =NULL ; - } - } -} -/* * usbvision_init_isoc() *
@@ -2393,6 +2360,7 @@ int usbvision_init_isoc(struct usb_usbvi {struct usb_device *dev = usbvision->dev;int bufIdx, errCode, regValue; +const int sb_size =USBVISION_URB_FRAMES *USBVISION_MAX_ISOC_PACKET_SIZE ;if (!USBVISION_IS_OPERATIONAL (usbvision))return -EFAULT ;
@@ -2428,6 +2396,7 @@ int usbvision_init_isoc(struct usb_usbvireturn -ENOMEM ; } usbvision->sbuf[bufIdx].urb = urb; + usbvision->sbuf[bufIdx].data =usb_buffer_alloc (usbvision->dev, sb_size,GFP_KERNEL ,&urb->transfer_dma); urb->dev = dev; urb->context = usbvision; urb->pipe =usb_rcvisocpipe (dev, usbvision->video_endp);
@@ -2469,6 +2438,7 @@ int usbvision_init_isoc(struct usb_usbvivoid usbvision_stop_isoc (struct usb_usbvision *usbvision) {int bufIdx, errCode, regValue; +const int sb_size =USBVISION_URB_FRAMES *USBVISION_MAX_ISOC_PACKET_SIZE ;if ((usbvision->streaming == Stream_Off) || (usbvision->dev ==NULL ))return ;
@@ -2476,6 +2446,12 @@ void usbvision_stop_isoc(struct usb_usbv/* Unschedule all of the iso td's */ for (bufIdx =0 ; bufIdx <USBVISION_NUMSBUF ; bufIdx++) {usb_kill_urb (usbvision->sbuf[bufIdx].urb); +if (usbvision->sbuf[bufIdx].data){ +usb_buffer_free (usbvision->dev, + sb_size, + usbvision->sbuf[bufIdx].data, + usbvision->sbuf[bufIdx].urb->transfer_dma); + }usb_free_urb (usbvision->sbuf[bufIdx].urb); usbvision->sbuf[bufIdx].urb =NULL ; }
drivers/media/video/usbvision/usbvision-i2c.c +3 -0
@@ -319,6 +319,9 @@ static int attach_inform(struct i2c_cliecase 0x4a :PDEBUG (DBG_I2C ,"attach_inform: saa7113 detected." );break ; +case 0x48 : +PDEBUG (DBG_I2C ,"attach_inform: saa7111 detected." ); +break ;case 0xa0 :PDEBUG (DBG_I2C ,"attach_inform: eeprom detected." );break ;
drivers/media/video/usbvision/usbvision-video.c +4 -10
@@ -353,20 +353,15 @@ static int usbvision_v4l2_open(struct inif (!errCode) {/* Allocate memory for the scratch ring buffer */ errCode =usbvision_scratch_alloc (usbvision); -if (!errCode) { -/* Allocate memory for the USB S buffers */ - errCode =usbvision_sbuf_alloc (usbvision); -if ((!errCode) && (usbvision->isocMode==ISOC_MODE_COMPRESS )) { -/* Allocate intermediate decompression buffers only if needed */ - errCode =usbvision_decompress_alloc (usbvision); - } +if ((!errCode) && (isocMode==ISOC_MODE_COMPRESS )) { +/* Allocate intermediate decompression buffers only if needed */ + errCode =usbvision_decompress_alloc (usbvision); } }if (errCode) {/* Deallocate all buffers if trouble */ usbvision_frames_free (usbvision);usbvision_scratch_free (usbvision); -usbvision_sbuf_free (usbvision);usbvision_decompress_free (usbvision); } }
@@ -437,9 +432,8 @@ static int usbvision_v4l2_close(struct iusbvision_stop_isoc (usbvision);usbvision_decompress_free (usbvision); -usbvision_rvfree (usbvision->fbuf, usbvision->fbuf_size); +usbvision_frames_free (usbvision);usbvision_scratch_free (usbvision); -usbvision_sbuf_free (usbvision); usbvision->user--;
drivers/media/video/usbvision/usbvision.h +0 -2
@@ -495,8 +495,6 @@ int usbvision_frames_alloc(struct usb_usvoid usbvision_frames_free (struct usb_usbvision *usbvision);int usbvision_scratch_alloc (struct usb_usbvision *usbvision);void usbvision_scratch_free (struct usb_usbvision *usbvision); -int usbvision_sbuf_alloc (struct usb_usbvision *usbvision); -void usbvision_sbuf_free (struct usb_usbvision *usbvision);int usbvision_decompress_alloc (struct usb_usbvision *usbvision);void usbvision_decompress_free (struct usb_usbvision *usbvision);
PATCH 10/28 V4L/DVB (4972): Dvb-core: fix bug in CRC-32 checking on 64-bit systems
In reply to Mauro Carvalho ChehabFrom: Ang Way Chuang <[email protected]>
CRC-32 checking during ULE decapsulation always failed on x86_64 systems due to the size of a variable used to store CRC. This bug was discovered on Fedora Core 6 with kernel-2.6.18-1.2849. The i386 counterpart has no such problem. This patch has been tested on 64-bit system as well as 32-bit system.
---
drivers/media/dvb/dvb-core/dvb_net.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/dvb/dvb-core/dvb_net.c +1 -1
@@ -605,7 +605,7 @@ #endif { &utype, sizeof utype }, { priv->ule_skb->data, priv->ule_skb->len - 4 } }; -unsigned long ule_crc = ~0L , expected_crc; +u32 ule_crc = ~0L , expected_crc;if (priv->ule_dbit) {/* Set D-bit for CRC32 verification, * if it was set originally. */
PATCH 11/28 V4L/DVB (4973): Dvb-core: fix printk type warning
In reply to Mauro Carvalho ChehabFrom: Michael Krufky <[email protected]>
dvb_net.c: In function 'dvb_net_ule':
dvb_net.c:628: warning: format '%#lx' expects type 'long unsigned int', but argument 3 has type 'u32' dvb_net.c:628: warning: format '%#lx' expects type 'long unsigned int', but argument 4 has type 'u32'
---
drivers/media/dvb/dvb-core/dvb_net.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/dvb/dvb-core/dvb_net.c +1 -1
@@ -618,7 +618,7 @@ #endif *((u8 *)priv->ule_skb->tail -2 ) <<8 | *((u8 *)priv->ule_skb->tail -1 );if (ule_crc != expected_crc) { -printk (KERN_WARNING "%lu: CRC32 check FAILED: %#lx / %#lx, SNDU len %d type %#x, ts_remain %d, next 2: %x.\n" , +printk (KERN_WARNING "%lu: CRC32 check FAILED: %08x / %08x, SNDU len %d type %#x, ts_remain %d, next 2: %x.\n" , priv->ts_count, ule_crc, expected_crc, priv->ule_sndu_len, priv->ule_sndu_type, ts_remain, ts_remain >2 ? *(unsigned short *)from_where :0 );#ifdef ULE_DEBUG
PATCH 12/28 V4L/DVB (4979): Fixes compilation when CONFIG_V4L1_COMPAT is not selected
In reply to Mauro Carvalho ChehabFrom: Dwaine Garden <[email protected]>
- SYSFS: Replaced all to_video_device(cd), video_device_create_file, video_device_remove_file and add the proper checks at create_file
- Converted old norm values to V4L2 ones.
- Robustness on sysfs hue/contrast/saturation queries. Additional check in order to return 0 if the driver is not opened.
- Whitespace cleanups in usbvision-cards.c
This patch merges two fixes by Thierry MERLE and Mauro Chehab, and adds additional checks.
---
drivers/media/video/usbvision/usbvision-cards.c | 11 +- drivers/media/video/usbvision/usbvision-video.c | 134 +++++++++++++++-------- 2 files changed, 94 insertions(+), 51 deletions(-)
drivers/media/video/usbvision/usbvision-cards.c +5 -6
@@ -39,8 +39,8 @@ struct usbvision_device_data_st usbvisi {0x0573, 0x0400, -1, CODEC_SAA7113, 4, V4L2_STD_NTSC, 0, 0, 1, 0, 0, -1, -1, 0, 3, 7, "D-Link V100"}, {0x0573, 0x2000, -1, CODEC_SAA7111, 2, V4L2_STD_NTSC, 1, 0, 1, 0, 0, -1, -1, -1, -1, -1, "X10 USB Camera"}, {0x0573, 0x2d00, -1, CODEC_SAA7111, 2, V4L2_STD_PAL, 1, 0, 1, 0, 0, -1, -1, -1, 3, 7, "Osprey 50"}, - {0x0573, 0x2d01, -1, CODEC_SAA7113, 2, V4L2_STD_NTSC, 0, 0, 1, 0, 0, -1, -1, 0, 3, 7, "Hauppauge USB-Live Model 600"}, - {0x0573, 0x2101, -1, CODEC_SAA7113, 2, V4L2_STD_PAL, 2, 0, 1, 0, 0, -1, -1, 0, 3, 7, "Zoran Co. PMD (Nogatech) AV-grabber Manhattan"}, + {0x0573, 0x2d01, -1, CODEC_SAA7113, 2, V4L2_STD_NTSC, 0, 0, 1, 0, 0, -1, -1, 0, 3, 7, "Hauppauge USB-Live Model 600"}, + {0x0573, 0x2101, -1, CODEC_SAA7113, 2, V4L2_STD_PAL, 2, 0, 1, 0, 0, -1, -1, 0, 3, 7, "Zoran Co. PMD (Nogatech) AV-grabber Manhattan"}, {0x0573, 0x4100, -1, CODEC_SAA7111, 3, V4L2_STD_NTSC, 1, 1, 1, 1, TUNER_PHILIPS_NTSC_M, -1, -1, -1, 20, -1, "Nogatech USB-TV (NTSC) FM"}, {0x0573, 0x4110, -1, CODEC_SAA7111, 3, V4L2_STD_NTSC, 1, 1, 1, 1, TUNER_PHILIPS_NTSC_M, -1, -1, -1, 20, -1, "PNY USB-TV (NTSC) FM"}, {0x0573, 0x4450, 0, CODEC_SAA7113, 3, V4L2_STD_PAL, 1, 1, 1, 1, TUNER_PHILIPS_PAL, -1, -1, 0, 3, 7, "PixelView PlayTv-USB PRO (PAL) FM"},
@@ -71,10 +71,10 @@ struct usbvision_device_data_st usbvisi {0x0573, 0x4d37, 0, CODEC_SAA7113, 3, V4L2_STD_PAL, 1, 1, 1, 1, TUNER_PHILIPS_FM1216ME_MK3, -1, -1, 0, 3, 7, "Hauppauge WinTV USB device Model 40219 Rev E189"}, {0x0768, 0x0006, -1, CODEC_SAA7113, 3, V4L2_STD_NTSC, 1, 1, 1, 1, TUNER_PHILIPS_NTSC_M, -1, -1, 5, 5, -1, "Camtel Technology USB TV Genie Pro FM Model TVB330"}, {0x07d0, 0x0001, -1, CODEC_SAA7113, 2, V4L2_STD_PAL, 0, 0, 1, 0, 0, -1, -1, 0, 3, 7, "Digital Video Creator I"}, - {0x07d0, 0x0002, -1, CODEC_SAA7111, 2, V4L2_STD_NTSC, 0, 0, 1, 0, 0, -1, -1, 82, 20, 7, "Global Village GV-007 (NTSC)"}, + {0x07d0, 0x0002, -1, CODEC_SAA7111, 2, V4L2_STD_NTSC, 0, 0, 1, 0, 0, -1, -1, 82, 20, 7, "Global Village GV-007 (NTSC)"}, {0x07d0, 0x0003, 0, CODEC_SAA7113, 2, V4L2_STD_NTSC, 0, 0, 1, 0, 0, -1, -1, 0, 3, 7, "Dazzle Fusion Model DVC-50 Rev 1 (NTSC)"}, {0x07d0, 0x0004, 0, CODEC_SAA7113, 2, V4L2_STD_PAL, 0, 0, 1, 0, 0, -1, -1, 0, 3, 7, "Dazzle Fusion Model DVC-80 Rev 1 (PAL)"}, - {0x07d0, 0x0005, 0, CODEC_SAA7113, 2, V4L2_STD_SECAM, 0, 0, 1, 0, 0, -1, -1, 0, 3, 7, "Dazzle Fusion Model DVC-90 Rev 1 (SECAM)"}, + {0x07d0, 0x0005, 0, CODEC_SAA7113, 2, V4L2_STD_SECAM, 0, 0, 1, 0, 0, -1, -1, 0, 3, 7, "Dazzle Fusion Model DVC-90 Rev 1 (SECAM)"}, {0x2304, 0x010d, -1, CODEC_SAA7111, 3, V4L2_STD_PAL, 1, 0, 0, 1, TUNER_TEMIC_4066FY5_PAL_I, -1, -1, -1, -1, -1, "Pinnacle Studio PCTV USB (PAL)"}, {0x2304, 0x0109, -1, CODEC_SAA7111, 3, V4L2_STD_SECAM, 1, 0, 1, 1, TUNER_PHILIPS_SECAM, -1, -1, -1, -1, -1, "Pinnacle Studio PCTV USB (SECAM)"}, {0x2304, 0x0110, -1, CODEC_SAA7111, 3, V4L2_STD_PAL, 1, 1, 1, 1, TUNER_PHILIPS_PAL, -1, -1,128, 23, -1, "Pinnacle Studio PCTV USB (PAL) FM"},
@@ -86,7 +86,7 @@ struct usbvision_device_data_st usbvisi {0x2304, 0x0300, -1, CODEC_SAA7113, 2, V4L2_STD_NTSC, 1, 0, 1, 0, 0, -1, -1, 0, 3, 7, "Pinnacle Studio Linx Video input cable (NTSC)"}, {0x2304, 0x0301, -1, CODEC_SAA7113, 2, V4L2_STD_PAL, 1, 0, 1, 0, 0, -1, -1, 0, 3, 7, "Pinnacle Studio Linx Video input cable (PAL)"}, {0x2304, 0x0419, -1, CODEC_SAA7113, 3, V4L2_STD_PAL, 1, 1, 1, 1, TUNER_TEMIC_4009FR5_PAL, -1, -1, 0, 3, 7, "Pinnacle PCTV Bungee USB (PAL) FM"}, - {0x2400, 0x4200, -1, CODEC_SAA7111, 3, VIDEO_MODE_NTSC, 1, 0, 1, 1, TUNER_PHILIPS_NTSC_M, -1, -1, -1, -1, -1, "Hauppauge WinTv-USB"}, + {0x2400, 0x4200, -1, CODEC_SAA7111, 3, V4L2_STD_NTSC, 1, 0, 1, 1, TUNER_PHILIPS_NTSC_M, -1, -1, -1, -1, -1, "Hauppauge WinTv-USB"}, {} /* Terminating entry */ };
@@ -148,7 +148,6 @@ struct usb_device_id usbvision_table [] { USB_DEVICE(0x2304, 0x0300) }, /* Pinnacle Studio Linx Video input cable (NTSC) */ { USB_DEVICE(0x2304, 0x0301) }, /* Pinnacle Studio Linx Video input cable (PAL) */ { USB_DEVICE(0x2304, 0x0419) }, /* Pinnacle PCTV Bungee USB (PAL) FM */ - { USB_DEVICE(0x2400, 0x4200) }, /* Hauppauge WinTv-USB2 Model 42012 */ { } /* Terminating entry */
drivers/media/video/usbvision/usbvision-video.c +89 -45
230 lines not on this page · raw message
PATCH 13/28 V4L/DVB (4980): Fixes bug 7267: PAL/60 is not working
In reply to Mauro Carvalho ChehabFrom: Mauro Carvalho Chehab <[email protected]>
On cx88 driver, sampling rate should be at chroma subcarrier freq (FSC). However, driver were programming wrong values for PAL/60, PAL/Nc and NTSC 4.43. This patch do the proper calculation. It also calculates htotal, hdelay and hactive constants, according with the sampling rate.
It is tested with PAL/60 by Piotr Maksymuk and Olivier. Also tested with the already-supported standards.
Test is still required for PAL/Nc.
---
drivers/media/video/cx88/cx88-core.c | 35 +++++++++++++++++++++------------- drivers/media/video/cx88/cx88.h | 2 +- 2 files changed, 23 insertions(+), 14 deletions(-)
drivers/media/video/cx88/cx88-core.c +22 -13
@@ -633,12 +633,12 @@ int cx88_reset(struct cx88_core *core)static unsigned int inline norm_swidth (struct cx88_tvnorm *norm) { -return (norm->id &V4L2_STD_625_50 ) ?922 :754 ; +return (norm->id & (V4L2_STD_MN & ~V4L2_STD_PAL_Nc)) ?754 :922 ; }static unsigned int inline norm_hdelay (struct cx88_tvnorm *norm) { -return (norm->id &V4L2_STD_625_50 ) ?186 :135 ; +return (norm->id & (V4L2_STD_MN & ~V4L2_STD_PAL_Nc)) ?135 :186 ; }static unsigned int inline norm_vdelay (struct cx88_tvnorm *norm)
@@ -648,24 +648,33 @@ static unsigned int inline norm_vdelay(sstatic unsigned int inline norm_fsc8 (struct cx88_tvnorm *norm) { -static const unsigned int ntsc =28636360 ; -static const unsigned int pal =35468950 ; -static const unsigned int palm =28604892 ; -if (norm->id &V4L2_STD_PAL_M ) -return palm; +return 28604892 ;// 3.575611 MHz + +if (norm->id & (V4L2_STD_PAL_Nc)) +return 28656448 ;// 3.582056 MHz + +if (norm->id &V4L2_STD_NTSC )// All NTSC/M and variants +return 28636360 ;// 3.57954545 MHz +/- 10 Hz -return (norm->id &V4L2_STD_625_50 ) ? pal : ntsc; +/* SECAM have also different sub carrier for chroma, +but step_db and step_dr, at cx88_set_tvnorm already handles that. + +The same FSC applies to PAL/BGDKIH, PAL/60, NTSC/4.43 and PAL/N +*/ + +return 35468950 ;// 4.43361875 MHz +/- 5 Hz }static unsigned int inline norm_htotal (struct cx88_tvnorm *norm) { -/* Should always be Line Draw Time / (4*FSC) */ -if (norm->id &V4L2_STD_PAL_M ) -return 909 ; +unsigned int fsc4=norm_fsc8 (norm)/2 ; -return (norm->id &V4L2_STD_625_50 ) ?1135 :910 ; +/* returns 4*FSC / vtotal / frames per seconds */ +return (norm->id &V4L2_STD_625_50 ) ? + ((fsc4+312 )/625 +12 )/25 : + ((fsc4+262 )/525 *1001 +15000 )/30000 ; }static unsigned int inline norm_vbipack (struct cx88_tvnorm *norm)
@@ -692,7 +701,7 @@ int cx88_set_scale(struct cx88_core *cor value &=0x3fe ;cx_write (MO_HDELAY_EVEN , value);cx_write (MO_HDELAY_ODD , value); -dprintk (1 ,"set_scale: hdelay 0x%04x\n" , value); +dprintk (1 ,"set_scale: hdelay 0x%04x (width %d)\n" , value,swidth); value = (swidth *4096 / width) -4096 ;cx_write (MO_HSCALE_EVEN , value);
drivers/media/video/cx88/cx88.h +1 -1
@@ -91,7 +91,7 @@ struct cx88_tvnorm {static unsigned int inline norm_maxw (struct cx88_tvnorm *norm) { -return (norm->id &V4L2_STD_625_50 ) ?768 :640 ; +return (norm->id & (V4L2_STD_MN & ~V4L2_STD_PAL_Nc)) ?720 :768 ; }
PATCH 14/28 V4L/DVB (4982): Fix broken audio mode handling for line-in in msp3400.
In reply to Mauro Carvalho ChehabFrom: Hans Verkuil <[email protected]>
The wrong matrix was used when an external input was selected instead of the tuner input. The rxsubchans field was also not initialized to STEREO for an external input. And finally the msp34xxg_detect_stereo() should not try to detect stereo for an external input, that code is for the tuner input only.
Together these bugs made it hit 'n miss whether you ever got stereo out of the msp3400 for an external input.
---
drivers/media/video/msp3400-driver.c | 6 ++---- drivers/media/video/msp3400-kthreads.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 7 deletions(-)
drivers/media/video/msp3400-driver.c +2 -4
@@ -633,10 +633,8 @@ #endifif (((rt->input >> (4 + i *4 )) &0xf ) ==0 ) extern_input =0 ; } -if (extern_input) - state->mode =MSP_MODE_EXTERN ; -else - state->mode =MSP_MODE_AM_DETECT ; + state->mode = extern_input ?MSP_MODE_EXTERN :MSP_MODE_AM_DETECT ; + state->rxsubchans =V4L2_TUNER_SUB_STEREO ;msp_set_scart (client, sc_in,0 );msp_set_scart (client, sc1_out,1 );msp_set_scart (client, sc2_out,2 );
drivers/media/video/msp3400-kthreads.c +8 -3
@@ -483,7 +483,6 @@ int msp3400c_thread(void *data)/* no carrier scan, just unmute */ v4l_dbg (1 , msp_debug, client,"thread: no carrier scan\n" ); state->scan_in_progress =0 ; - state->rxsubchans =V4L2_TUNER_SUB_STEREO ;msp_set_audio (client);continue ; }
@@ -851,12 +850,15 @@ static void msp34xxg_set_source(struct i source =1 ;/* stereo or A|B */ matrix =0x20 ;break ; -case V4L2_TUNER_MODE_STEREO :case V4L2_TUNER_MODE_LANG1 : -default : source =3 ;/* stereo or A */ matrix =0x00 ;break ; +case V4L2_TUNER_MODE_STEREO : +default : + source =3 ;/* stereo or A */ + matrix =0x20 ; +break ; }if (in ==MSP_DSP_IN_TUNER )
@@ -1030,6 +1032,9 @@ static int msp34xxg_detect_stereo(structint is_stereo = status &0x40 ;int oldrx = state->rxsubchans; +if (state->mode ==MSP_MODE_EXTERN ) +return 0 ; + state->rxsubchans =0 ;if (is_stereo) state->rxsubchans =V4L2_TUNER_SUB_STEREO ;
PATCH 15/28 V4L/DVB (4983): Force temporal filter to 0 when scaling to prevent ghosting.
In reply to Mauro Carvalho ChehabFrom: Hans Verkuil <[email protected]>
Change the code to unconditionally turn off the temporal filter when scaling. If the window is not full screen the filter will introduce a nasty ghosting effect.
---
drivers/media/video/cx2341x.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-)
drivers/media/video/cx2341x.c +6 -9
@@ -742,7 +742,6 @@ int cx2341x_update(void *priv, cx2341x_mif (old ==NULL || old->width != new->width || old->height != new->height || old->video_encoding != new->video_encoding) { -int is_scaling;u16 w = new->width;u16 h = new->height;
@@ -752,20 +751,18 @@ int cx2341x_update(void *priv, cx2341x_m } err =cx2341x_api (priv, func,CX2341X_ENC_SET_FRAME_SIZE ,2 , h, w);if (err)return err; + } +if (new->width !=720 || new->height != (new->is_50hz ?576 :480 )) {/* Adjust temporal filter if necessary. The problem with the temporal filter is that it works well with full resolution capturing, but not when the capture window is scaled (the filter introduces -a ghosting effect). So if the capture window changed, and there is -no updated filter value, then the filter is set depending on whether -the new window is full resolution or not. +a ghosting effect). So if the capture window is scaled, then +force the filter to 0. -For full resolution a setting of 8 really improves the video +For full resolution the filter really improves the video quality, especially if the original video quality is suboptimal. */ - is_scaling = new->width !=720 || new->height != (new->is_50hz ?576 :480 ); -if (old && old->video_temporal_filter == temporal) { - temporal = is_scaling ?0 :8 ; - } + temporal =0 ; }if (old ==NULL || old->stream_type != new->stream_type) {
PATCH 16/28 V4L/DVB (4984): LOG_STATUS should show the real temporal filter value.
In reply to Mauro Carvalho ChehabFrom: Hans Verkuil <[email protected]>
The temporal filter is forced off when scaling. The VIDIOC_LOG_STATUS handler still showed the old temporal filter. It is now consistent with the real temporal filter value.
---
drivers/media/video/cx2341x.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/media/video/cx2341x.c +5 -1
@@ -863,6 +863,7 @@ invalid:void cx2341x_log_status (struct cx2341x_mpeg_params *p,const char *prefix) {int is_mpeg1 = p->video_encoding ==V4L2_MPEG_VIDEO_ENCODING_MPEG_1 ; +int temporal = p->video_temporal_filter;/* Stream */ printk(KERN_INFO "%s: Stream: %s\n",
@@ -919,10 +920,13 @@ void cx2341x_log_status(struct cx2341x_mcx2341x_menu_item (p,V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE ),cx2341x_menu_item (p,V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE ), p->video_spatial_filter); +if (p->width !=720 || p->height != (p->is_50hz ?576 :480 )) { + temporal =0 ; + }printk (KERN_INFO "%s: Temporal Filter: %s, %d\n" , prefix,cx2341x_menu_item (p,V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE ), - p->video_temporal_filter); + temporal); printk(KERN_INFO "%s: Median Filter: %s, Luma [%d, %d], Chroma [%d, %d]\n", prefix, cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE),
PATCH 17/28 V4L/DVB (4988): Cx2341x audio_properties is an u16, not u8
In reply to Mauro Carvalho ChehabFrom: Hans Verkuil <[email protected]>
This bug broke the MPEG audio mode controls.
---
include/media/cx2341x.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/media/cx2341x.h +1 -1
@@ -49,7 +49,7 @@ struct cx2341x_mpeg_params {enum v4l2_mpeg_audio_mode_extension audio_mode_extension;enum v4l2_mpeg_audio_emphasis audio_emphasis;enum v4l2_mpeg_audio_crc audio_crc; -u8 audio_properties; +u16 audio_properties;/* video */ enum v4l2_mpeg_video_encoding video_encoding;
PATCH 18/28 V4L/DVB (4990): Cpia2/cpia2_usb.c: fix error-path leak
In reply to Mauro Carvalho ChehabFrom: Amit Choudhary <[email protected]>
Free previously allocated memory (in array elements) if kmalloc() returns NULL in submit_urbs().
---
drivers/media/video/cpia2/cpia2_usb.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/media/video/cpia2/cpia2_usb.c +4 -0
@@ -640,6 +640,10 @@ static int submit_urbs(struct camera_dat cam->sbuf[i].data =kmalloc (FRAMES_PER_DESC *FRAME_SIZE_PER_DESC ,GFP_KERNEL );if (!cam->sbuf[i].data) { +while (--i >=0 ) { +kfree (cam->sbuf[i].data); + cam->sbuf[i].data =NULL ; + }return -ENOMEM ; } }
PATCH 19/28 V4L/DVB (4991): Cafe_ccic.c: fix NULL dereference
In reply to Mauro Carvalho ChehabFrom: Adrian Bunk <[email protected]>
We shouldn't dereference "cam" when we already know it's NULL. Spotted by the Coverity checker.
---
drivers/media/video/cafe_ccic.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/video/cafe_ccic.c +1 -1
@@ -2166,7 +2166,7 @@ static void cafe_pci_remove(struct pci_dstruct cafe_camera *cam =cafe_find_by_pdev (pdev);if (cam ==NULL ) { -cam_warn (cam,"pci_remove on unknown pdev %p\n" , pdev); +printk (KERN_WARNING "pci_remove on unknown pdev %p\n" , pdev);return ; }mutex_lock (&cam->s_mutex);
PATCH 20/28 V4L/DVB (4992): Fix typo in saa7134-dvb.c
In reply to Mauro Carvalho ChehabFrom: Stephan Berberig <[email protected]>
Fix a typo (use_frontent -> use_frontend) in saa7134-dvb.c.
---
drivers/media/video/saa7134/saa7134-dvb.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/media/video/saa7134/saa7134-dvb.c +4 -4
@@ -50,9 +50,9 @@ static unsigned int antenna_pwr = 0;module_param (antenna_pwr, int,0444 );MODULE_PARM_DESC (antenna_pwr,"enable antenna power (Pinnacle 300i)" ); -static int use_frontent =0 ; -module_param (use_frontent, int,0644 ); -MODULE_PARM_DESC (use_frontent,"for cards with multiple frontends (0: terrestrial, 1: satellite)" ); +static int use_frontend =0 ; +module_param (use_frontend, int,0644 ); +MODULE_PARM_DESC (use_frontend,"for cards with multiple frontends (0: terrestrial, 1: satellite)" );/* ------------------------------------------------------------------ */ static int pinnacle_antenna_pwr (struct saa7134_dev *dev,int on)
@@ -1303,7 +1303,7 @@ static int dvb_init(struct saa7134_dev * }break ;case SAA7134_BOARD_FLYDVB_TRIO : -if (! use_frontent) {//terrestrial +if (! use_frontend) {//terrestrial dev->dvb.frontend =dvb_attach (tda10046_attach, &lifeview_trio_config, &dev->i2c_adap);
PATCH 21/28 V4L/DVB (4994): Vivi: fix use after free in list_for_each()
In reply to Mauro Carvalho ChehabFrom: Akinobu Mita <[email protected]>
Freeing data including list_head in list_for_each() is not safe.
---
drivers/media/video/vivi.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/media/video/vivi.c +3 -1
@@ -1363,7 +1363,9 @@ static void __exit vivi_exit(void)struct vivi_dev *h;struct list_head *list; -list_for_each (list,&vivi_devlist) { +while (!list_empty (&vivi_devlist)) { + list = vivi_devlist.next; +list_del (list); h = list_entry(list, struct vivi_dev, vivi_devlist);kfree (h); }
PATCH 22/28 V4L/DVB (4995): Vivi: fix kthread_run() error check
In reply to Mauro Carvalho ChehabFrom: Akinobu Mita <[email protected]>
The return value of kthread_run() should be checked by IS_ERR().
---
drivers/media/video/vivi.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/video/vivi.c +2 -2
@@ -535,9 +535,9 @@ static int vivi_start_thread(struct vivi dma_q->kthread =kthread_run (vivi_thread, dma_q,"vivi" ); -if (dma_q->kthread ==NULL ) { +if (IS_ERR (dma_q->kthread)) {printk (KERN_ERR "vivi: kernel_thread() failed\n" ); -return -EINVAL ; +return PTR_ERR (dma_q->kthread); }dprintk (1 ,"returning from %s\n" ,__FUNCTION__);return 0 ;
PATCH 23/28 V4L/DVB (4996): Msp3400: fix kthread_run error check
In reply to Mauro Carvalho ChehabFrom: Akinobu Mita <[email protected]>
The return value of kthread_run() should be checked by IS_ERR().
---
drivers/media/video/msp3400-driver.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/video/msp3400-driver.c +1 -1
@@ -949,7 +949,7 @@ static int msp_attach(struct i2c_adapterif (thread_func) { state->kthread =kthread_run (thread_func, client,"msp34xx" ); -if (state->kthread ==NULL ) +if (IS_ERR (state->kthread))v4l_warn (client,"kernel_thread() failed\n" );msp_wake_thread (client); }
PATCH 24/28 V4L/DVB (4997): Bttv: delete duplicated ioremap()
In reply to Mauro Carvalho ChehabFrom: Akinobu Mita <[email protected]>
ioremap() is called twice to same resource. The returen value of first one is not error-checked. second one is complely ignored.
---
drivers/media/video/bt8xx/bttv-driver.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/video/bt8xx/bttv-driver.c +2 -2
@@ -4050,8 +4050,8 @@ static int __devinit bttv_probe(struct p (unsigned long long)pci_resource_start(dev,0));schedule (); - btv->bt848_mmio=ioremap (pci_resource_start (dev,0 ),0x1000 ); -if (NULL ==ioremap (pci_resource_start (dev,0 ),0x1000 )) { + btv->bt848_mmio =ioremap (pci_resource_start (dev,0 ),0x1000 ); +if (NULL == btv->bt848_mmio) {printk ("bttv%d: ioremap() failed\n" , btv->c.nr); result = -EIO ; goto fail1;
PATCH 25/28 V4L/DVB (5014): Allyesconfig build fixes on some non x86 arch
In reply to Mauro Carvalho ChehabFrom: David Brownell <[email protected]>
- CAFE_CCIC needs to depend on PCI, else "allyesconfig" breaks on systems without PCI
- em28xx-video can't udelay(2500) else "allyesconfig" breaks on systems that refuse to spin that long (I saw it on ARM)
---
drivers/media/video/Kconfig | 2 +- drivers/media/video/em28xx/em28xx-video.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/media/video/Kconfig +1 -1
@@ -668,7 +668,7 @@ config VIDEO_M32R_AR_M64278 config VIDEO_CAFE_CCIC tristate "Marvell 88ALP01 (Cafe) CMOS Camera Controller support" - depends on I2C && VIDEO_V4L2 + depends on PCI && I2C && VIDEO_V4L2 select VIDEO_OV7670 ---help--- This is a video4linux2 driver for the Marvell 88ALP01 integrated
drivers/media/video/em28xx/em28xx-video.c +2 -2
@@ -1674,9 +1674,9 @@ #endifif (dev->has_msp34xx) {/* Send a reset to other chips via gpio */ em28xx_write_regs_req (dev,0x00 ,0x08 ,"\xf7" ,1 ); -udelay (2500 ); +msleep (3 );em28xx_write_regs_req (dev,0x00 ,0x08 ,"\xff" ,1 ); -udelay (2500 ); +msleep (3 ); }video_mux (dev,0 );
PATCH 26/28 V4L/DVB (5001): Add two required headers on kernel 2.6.20-rc1
In reply to Mauro Carvalho ChehabFrom: Mauro Carvalho Chehab <[email protected]>
include/media/ir-common.h:78: error: field 'work' has incomplete type drivers/media/common/ir-functions.c: In function 'ir_rc5_timer_end':drivers/media/common/ir-functions.c:301: error: 'jiffies' undeclared (first use in this function) drivers/media/common/ir-functions.c:301: error: (Each undeclared identifier is reported only once) drivers/media/common/ir-functions.c:301: error: for each function it appears in.) drivers/media/common/ir-functions.c:347: error: 'HZ' undeclared (first use in this function)
---
drivers/media/common/ir-functions.c | 1 + include/media/ir-common.h | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
drivers/media/common/ir-functions.c +1 -0
@@ -23,6 +23,7 @@#include <linux/module.h> #include <linux/moduleparam.h> #include <linux/string.h> +#include <linux/jiffies.h> #include <media/ir-common.h> /* -------------------------------------------------------------------------- */
include/media/ir-common.h +1 -0
@@ -24,6 +24,7 @@ #ifndef _IR_COMMON#define _IR_COMMON#include <linux/input.h> +#include <linux/workqueue.h> #define IR_TYPE_RC5 1#define IR_TYPE_PD 2/* Pulse distance encoded IR */
PATCH 27/28 V4L/DVB (5012): Usbvision fix: It was using "&&" instead "&"
In reply to Mauro Carvalho ChehabFrom: Alexey Dobriyan <[email protected]>
---
drivers/media/video/usbvision/usbvision-core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/video/usbvision/usbvision-core.c +1 -1
@@ -2311,7 +2311,7 @@ int usbvision_restart_isoc(struct usb_us usbvision->Vin_Reg2_Preset)) < 0) return ret;/* TODO: schedule timeout */ -while ((usbvision_read_reg (usbvision,USBVISION_STATUS_REG ) &&0x01 ) !=1 ); +while ((usbvision_read_reg (usbvision,USBVISION_STATUS_REG ) &0x01 ) !=1 );return 0 ; }
PATCH 28/28 V4L/DVB (5010): Cx88: Fix leadtek_eeprom tagging
In reply to Mauro Carvalho ChehabFrom: Jean Delvare <[email protected]>
reference to .init.text: from .text between 'cx88_card_setup' (at offset 0x68c) and 'cx88_risc_field'
Caused by leadtek_eeprom() being declared __devinit and called from a non-devinit context.
---
drivers/media/video/cx88/cx88-cards.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/video/cx88/cx88-cards.c +1 -1
@@ -1632,7 +1632,7 @@ const unsigned int cx88_idcount = ARRAY_/* ----------------------------------------------------------------------- */ /* some leadtek specific stuff */ -static void __devinit leadtek_eeprom (struct cx88_core *core,u8 *eeprom_data) +static void leadtek_eeprom (struct cx88_core *core,u8 *eeprom_data) {/* This is just for the "Winfast 2000XP Expert" board ATM; I don't have data on * any others.