dvb-apps: hr-All update

2010-10-24 Thread Samuel Rakitničan

Hi,

Some channel changed, also added additional mux for all regions. Digital  
switch over was done for the whole country so channels should be changing  
less frequently now.



Best regards,
Samuel

hr-All.diff
Description: Binary data


Re: [RFC/PATCH 3/5] vpif_cap/disp: Added support for DV presets

2010-10-24 Thread Hans Verkuil
On Saturday, October 23, 2010 21:40:01 Hiremath, Vaibhav wrote:
 
  -Original Message-
  From: mats.randga...@tandberg.com [mailto:mats.randga...@tandberg.com]
  Sent: Friday, October 22, 2010 12:31 PM
  To: Hiremath, Vaibhav
  Cc: linux-media@vger.kernel.org; hans.verk...@tandberg.com; Mats Randgaard
  Subject: [RFC/PATCH 3/5] vpif_cap/disp: Added support for DV presets
  
  From: Mats Randgaard mats.randga...@tandberg.com
  
  Added functions to set/get/query/enum DV presets.
  
  Signed-off-by: Mats Randgaard mats.randga...@tandberg.com
  Signed-off-by: Hans Verkuil hans.verk...@tandberg.com
  ---
   drivers/media/video/davinci/vpif_capture.c |  143
  +++-
   drivers/media/video/davinci/vpif_capture.h |1 +
   drivers/media/video/davinci/vpif_display.c |  119 ++-
   drivers/media/video/davinci/vpif_display.h |1 +
   4 files changed, 255 insertions(+), 9 deletions(-)
  
  diff --git a/drivers/media/video/davinci/vpif_capture.c
  b/drivers/media/video/davinci/vpif_capture.c
  index 778af7e..bf1adea 100644
  --- a/drivers/media/video/davinci/vpif_capture.c
  +++ b/drivers/media/video/davinci/vpif_capture.c
  @@ -432,9 +432,18 @@ static int vpif_update_std_info(struct channel_obj
  *ch)
  
  for (index = 0; index  vpif_ch_params_count; index++) {
  config = ch_params[index];
  -   if (config-stdid  vid_ch-stdid) {
  -   memcpy(std_info, config, sizeof(*config));
  -   break;
  +   if (config-hd_sd == 0) {
  +   vpif_dbg(2, debug, SD format\n);
  +   if (config-stdid  vid_ch-stdid) {
  +   memcpy(std_info, config, sizeof(*config));
  +   break;
  +   }
  +   } else {
  +   vpif_dbg(2, debug, HD format\n);
  +   if (config-dv_preset == vid_ch-dv_preset) {
  +   memcpy(std_info, config, sizeof(*config));
  +   break;
  +   }
  }
  }
  
  @@ -1442,6 +1451,7 @@ static int vpif_s_std(struct file *file, void *priv,
  v4l2_std_id *std_id)
  return -ERESTARTSYS;
  
  ch-video.stdid = *std_id;
  +   ch-video.dv_preset = V4L2_DV_INVALID;
  
  /* Get the information about the standard */
  if (vpif_update_std_info(ch)) {
  @@ -1794,6 +1804,129 @@ static int vpif_cropcap(struct file *file, void
  *priv,
  return 0;
   }
  
  +/**
  + * vpif_enum_dv_presets() - ENUM_DV_PRESETS handler
  + * @file: file ptr
  + * @priv: file handle
  + * @preset: input preset
  + */
  +static int vpif_enum_dv_presets(struct file *file, void *priv,
  +   struct v4l2_dv_enum_preset *preset)
  +{
  +   struct vpif_fh *fh = priv;
  +   struct channel_obj *ch = fh-channel;
  +
  +   if (!vpif_obj.sd) {
  +   vpif_dbg(2, debug, No sub devices registered\n);
  +
  +   if (preset-index = vpif_ch_params_count)
  +   return -EINVAL;
  +
  +   /* dv-presets only */
  +   if (ch_params[preset-index].hd_sd == 0)
  +   return -EINVAL;
  +
  +   return v4l_fill_dv_preset_info(
  +   ch_params[preset-index].dv_preset, preset);
  +   }
  +
 [Hiremath, Vaibhav] I believe to completely work in non-subdev mode of 
 operation you might have to change some existing API's as well right? So I 
 think we should break this patch into two separate patches, 

Oops, that's a left-over from the earlier patch-series. We're not going to do
non-subdev mode (as per our discussions), so this 'if (!vpif_obj.sd)' condition
should be removed for the time being. Once we start work on the 'dummy' subdev
we probably will have to revisit this.

Regards,

Hans

 
 vpif_cap/disp: Added support for DV presets
 and
 vpif_cap/disp: Add support for non-subdev mode
 
 Rest looks ok to me.
 
 Thanks,
 Vaibhav
 
 
  +   return v4l2_subdev_call(vpif_obj.sd[ch-curr_sd_index],
  +   video, enum_dv_presets, preset);
  +}
  +
  +/**
  + * vpif_query_dv_presets() - QUERY_DV_PRESET handler
  + * @file: file ptr
  + * @priv: file handle
  + * @preset: input preset
  + */
  +static int vpif_query_dv_preset(struct file *file, void *priv,
  +   struct v4l2_dv_preset *preset)
  +{
  +   struct vpif_fh *fh = priv;
  +   struct channel_obj *ch = fh-channel;
  +
  +   if (!vpif_obj.sd) {
  +   vpif_dbg(2, debug, No sub devices registered\n);
  +   return -EINVAL;
  +   }
  +
  +   return v4l2_subdev_call(vpif_obj.sd[ch-curr_sd_index],
  +  video, query_dv_preset, preset);
  +}
  +/**
  + * vpif_s_dv_presets() - S_DV_PRESETS handler
  + * @file: file ptr
  + * @priv: file handle
  + * @preset: input preset
  + */
  +static int vpif_s_dv_preset(struct file *file, void *priv,
  +   struct v4l2_dv_preset *preset)
  +{
  +   struct vpif_fh *fh = priv;
  +   struct 

Re: linuxtv.org Wiki

2010-10-24 Thread Bjørn Mork
Mauro Carvalho Chehab mche...@redhat.com writes:

 It is a wiki for a community effort. If you found it outdated, please help us 
 on keeping it uptodated.

Yes, I know and I do wish I could write somethingmore up-to-date.

My problem with that is that I do not feel I know enough about your
requirements for driver submission to actually write anything on that.
I just know barely enough to see that the information in the wiki must
be outdated.



Bjørn
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: dvb-apps: hr-All update

2010-10-24 Thread Christoph Pfister
2010/10/24 Samuel Rakitničan samuel.rakitni...@gmail.com:
 Hi,

 Some channel changed, also added additional mux for all regions. Digital
 switch over was done for the whole country so channels should be changing
 less frequently now.

Updated, thanks!

 Best regards,
 Samuel

Christoph
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


s2-liplianin for kernel 2.6.36

2010-10-24 Thread David Kaplan
Does anyone have a version of s2-liplianin that compiles against 2.6.36?
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Hauppauge WinTV-HVR-1120 on Unbuntu 10.04

2010-10-24 Thread Albin Kauffmann
On Tuesday 19 October 2010 21:56:51 fabio tirapelle wrote:
 The WinTV did work correctly with ubuntu 9.10. In Ubuntu 9.10 the
 package linux-firmware-nonfree didn't include the dvb-fe-tda10048-1.0.fw. I
 remember that Ubuntu 9.10 used for my card the dvb-fe-tda10046.fw.
 
 Now, Ubuntu 10.04 loads for my card the dvb-fe-tda10048-1.0.fw
 Its seems that with the 9.10 version, the card is recognized as
 WinTV-HVR-1100 or 1110 and now as WinTV-HVR-1120.

This is actually strange because the Wiki states that the card is using an 
NXP TDA10048 digital demodulator 
(http://linuxtv.org/wiki/index.php/Hauppauge_WinTV-HVR-1120). Anyway, this may 
worth the cost to build an old kernel to see if this effectively works well ;)

 I wait until you recompile the kernel  with the v4l. Please tell me if this
 solves the problem

I have tried several scenarios :
 - the last 2.6.36 Linux kernel
 - the kernel 2.6.35 with sources from the HG repository 
(http://linuxtv.org/hg/v4l-dvb/)
 - the media tree git (http://git.linuxtv.org/media_tree.git)

In all situations, I get the same behaviour. After a random number of reboots, 
the TV (DVB-T) is not working and I get this message displayed in loop in 
`dmesg`:

tda18271_write_regs: [1-0060|M] ERROR: idx = 0x5, len = 1, i2c_transfer 
returned: -5
tda18271_init: [1-0060|M] error -5 on line 830
tda18271_tune: [1-0060|M] error -5 on line 908
tda18271_set_params: [1-0060|M] error -5 on line 989

Also, even when the TV is working, I get these error messages in `dmesg:

[...]
tda829x 1-004b: type set to tda8290
tda18271 1-0060: attaching existing instance
DVB: registering new adapter (saa7133[0])
DVB: registering adapter 0 frontend 0 (NXP TDA10048HN DVB-T)...
tda10048_firmware_upload: waiting for firmware upload (dvb-fe-
tda10048-1.0.fw)...
tda10048_firmware_upload: firmware read 24878 bytes.
tda10048_firmware_upload: firmware uploading
tda18271_write_regs: [1-0060|M] ERROR: idx = 0x13, len = 1, i2c_transfer 
returned: -5
tda18271_write_regs: [1-0060|M] ERROR: idx = 0x5, len = 1, i2c_transfer 
returned: -5
tda18271_set_analog_params: [1-0060|M] error -5 on line 1045
tda18271_write_regs: [1-0060|M] ERROR: idx = 0x13, len = 1, i2c_transfer 
returned: -5
tda10048_firmware_upload: firmware uploaded
saa7134 ALSA driver for DMA sound loaded
saa7133[0]/alsa: saa7133[0] at 0xeb20 irq 20 registered as card -1
tda18271_read_regs: [1-0060|M] ERROR: i2c_transfer returned: -5
tda18271_ir_cal_init: [1-0060|M] error -5 on line 811
tda18271_init: [1-0060|M] error -5 on line 835
tda18271_tune: [1-0060|M] error -5 on line 908
tda18271_set_analog_params: [1-0060|M] error -5 on line 1045


I may take a look at sources to understand what is happening. So, if someone 
have an idea, please tell me ;)

Thanks,

-- 
Albin Kauffmann
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC/PATCH 0/5] DaVinci VPIF: Support for DV preset and DV timings.

2010-10-24 Thread Muralidharan Karicheri
Thanks for the patch!

On Sun, Oct 24, 2010 at 9:38 AM, Muralidharan Karicheri
mkarich...@gmail.com wrote:

 On Fri, Oct 22, 2010 at 3:00 AM, mats.randga...@tandberg.com wrote:

 From: Mats Randgaard mats.randga...@tandberg.com

 Support for DV preset and timings added to vpif_capture and vpif_display 
 drivers.
 Functions for debugging are added and the code is improved as well.

 Mats Randgaard (5):
  vpif_cap/disp: Add debug functionality
  vpif: Move and extend ch_params[]
  vpif_cap/disp: Added support for DV presets
  vpif_cap/disp: Added support for DV timings
  vpif_cap/disp: Cleanup, improved comments

  drivers/media/video/davinci/vpif.c         |  178 +
  drivers/media/video/davinci/vpif.h         |   18 +-
  drivers/media/video/davinci/vpif_capture.c |  380 
 ++--
  drivers/media/video/davinci/vpif_capture.h |    2 +
  drivers/media/video/davinci/vpif_display.c |  370 
 +--
  drivers/media/video/davinci/vpif_display.h |    2 +
  6 files changed, 893 insertions(+), 57 deletions(-)

 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

 Thanks for the patch!

 --
 Murali Karicheri
 mkarich...@gmail.com



--
Murali Karicheri
mkarich...@gmail.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC/PATCH 1/5] vpif_cap/disp: Add debug functionality

2010-10-24 Thread Muralidharan Karicheri
My previous reply didn't make it to linuxtv server.

See comments below.

On Sun, Oct 24, 2010 at 10:04 AM, Muralidharan Karicheri
mkarich...@gmail.com wrote:
 Thanks for the patch. Please read below for my comments



 +/*
 + * vpif_g_chip_ident() - Identify the chip
 + * @file: file ptr
 + * @priv: file handle
 + * @chip: chip identity
 + *
 + * Returns zero or -EINVAL if read operations fails.
 + */
 +static int vpif_g_chip_ident(struct file *file, void *priv,
 +               struct v4l2_dbg_chip_ident *chip)
 +{
 +       int ret = 0;
 +
 +       chip-ident = V4L2_IDENT_NONE;
 +       chip-revision = 0;
 +       if (chip-match.type != V4L2_CHIP_MATCH_I2C_DRIVER 
 +                       chip-match.type != V4L2_CHIP_MATCH_I2C_ADDR) {
 +               vpif_dbg(2, debug, match_type is invalid.\n);
 +               return -EINVAL;
 +       }
 +
 +       if (vpif_obj.sd)
 +               ret = v4l2_device_call_until_err(vpif_obj.v4l2_dev, 0,
 core,
 +                               g_chip_ident, chip);

 I think the if check is unnecessary since probe() will fail and this device
 node will not be visible to user :)

 +       return ret;
 +}
 +
 +#ifdef CONFIG_VIDEO_ADV_DEBUG
 +/*
 + * vpif_dbg_g_register() - Read register
 + * @file: file ptr
 + * @priv: file handle
 + * @reg: register to be read
 + *
 + * Debugging only
 + * Returns zero or -EINVAL if read operations fails.
 + */
 +static int vpif_dbg_g_register(struct file *file, void *priv,
 +               struct v4l2_dbg_register *reg){
 +       struct vpif_fh *fh = priv;
 +       struct channel_obj *ch = fh-channel;
 +
 +       return v4l2_subdev_call(vpif_obj.sd[ch-curr_sd_index], core,
 +                       g_register, reg);

 +}
 +
 +/*
 + * vpif_dbg_s_register() - Write to register
 + * @file: file ptr
 + * @priv: file handle
 + * @reg: register to be modified
 + *
 + * Debugging only
 + * Returns zero or -EINVAL if write operations fails.
 + */
 +static int vpif_dbg_s_register(struct file *file, void *priv,
 +               struct v4l2_dbg_register *reg){
 +       struct vpif_fh *fh = priv;
 +       struct channel_obj *ch = fh-channel;
 +
 +       return v4l2_subdev_call(vpif_obj.sd[ch-curr_sd_index], core,
 +                       s_register, reg);
 +}
 +#endif
 +
 +/*
 + * vpif_log_status() - Status information
 + * @file: file ptr
 + * @priv: file handle
 + *
 + * Returns zero.
 + */
 +static int vpif_log_status(struct file *filep, void *priv)
 +{
 +       /* status for sub devices */
 +       v4l2_device_call_all(vpif_obj.v4l2_dev, 0, core, log_status);
 +
 +       return 0;
 +}
 +
  /* vpif capture ioctl operations */
  static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
        .vidioc_querycap                = vpif_querycap,
 @@ -1829,6 +1910,12 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops =
 {
        .vidioc_streamon                = vpif_streamon,
        .vidioc_streamoff               = vpif_streamoff,
        .vidioc_cropcap                 = vpif_cropcap,
 +       .vidioc_g_chip_ident            = vpif_g_chip_ident,
 +#ifdef CONFIG_VIDEO_ADV_DEBUG
 +       .vidioc_g_register              = vpif_dbg_g_register,
 +       .vidioc_s_register              = vpif_dbg_s_register,
 +#endif
 +       .vidioc_log_status              = vpif_log_status,
  };

  /* vpif file operations */
 diff --git a/drivers/media/video/davinci/vpif_display.c
 b/drivers/media/video/davinci/vpif_display.c
 index 8894af2..b56c53a 100644
 --- a/drivers/media/video/davinci/vpif_display.c
 +++ b/drivers/media/video/davinci/vpif_display.c
 @@ -38,6 +38,7 @@
  #include media/adv7343.h
  #include media/v4l2-device.h
  #include media/v4l2-ioctl.h
 +#include media/v4l2-chip-ident.h

  #include mach/dm646x.h

 @@ -1315,6 +1316,90 @@ static int vpif_s_priority(struct file *file, void
 *priv, enum v4l2_priority p)
        return v4l2_prio_change(ch-prio, fh-prio, p);
  }

 +
 +/*
 + * vpif_g_chip_ident() - Identify the chip
 + * @file: file ptr
 + * @priv: file handle
 + * @chip: chip identity
 + *
 + * Returns zero or -EINVAL if read operations fails.
 + */
 +static int vpif_g_chip_ident(struct file *file, void *priv,
 +               struct v4l2_dbg_chip_ident *chip)
 +{
 +       int ret = 0;
 +
 +       chip-ident = V4L2_IDENT_NONE;
 +       chip-revision = 0;
 +       if (chip-match.type != V4L2_CHIP_MATCH_I2C_DRIVER 
 +                       chip-match.type != V4L2_CHIP_MATCH_I2C_ADDR) {
 +               vpif_dbg(2, debug, match_type is invalid.\n);
 +               return -EINVAL;
 +       }
 +
 +       if (vpif_obj.sd)
 +               ret = v4l2_device_call_until_err(vpif_obj.v4l2_dev, 0,
 core,
 +                               g_chip_ident, chip);
 +

 Same comment as above



 +       return ret;
 +}
 +

 +#ifdef CONFIG_VIDEO_ADV_DEBUG

 +/*
 + * vpif_dbg_g_register() - Read register
 + * @file: file ptr
 + * @priv: file handle
 + * @reg: register to be read
 + *
 + * Debugging only
 + * Returns zero or -EINVAL if read operations fails.
 + */
 +static 

Re: [RFC/PATCH 2/5] vpif: Move and extend ch_params[]

2010-10-24 Thread Muralidharan Karicheri
On Sun, Oct 24, 2010 at 10:13 AM, Muralidharan Karicheri
mkarich...@gmail.com wrote:
 Acked-by : Murali Karicheri mkarich...@gmail.com

 On Fri, Oct 22, 2010 at 3:00 AM, mats.randga...@tandberg.com wrote:

 From: Mats Randgaard mats.randga...@tandberg.com

 - The ch_params tables in vpif_capture.c and vpif_display.c are moved to a
 common
  table in vpif.c. Then it is easier to maintain the table.
 - The new table is extended with all the DV formats supportet by TVP7002.
 - The field fps is removed from the struct vpif_channel_config_params
 because it
  is not used.
 - The field dv_preset is added to the struct vpif_channel_config_params
 to
  support DV formats.

 Signed-off-by: Mats Randgaard mats.randga...@tandberg.com
 Signed-off-by: Hans Verkuil hans.verk...@tandberg.com
 ---
  drivers/media/video/davinci/vpif.c         |  178
 
  drivers/media/video/davinci/vpif.h         |    5 +-
  drivers/media/video/davinci/vpif_capture.c |   18 +---
  drivers/media/video/davinci/vpif_display.c |   17 +--
  4 files changed, 187 insertions(+), 31 deletions(-)

 diff --git a/drivers/media/video/davinci/vpif.c
 b/drivers/media/video/davinci/vpif.c
 index 1f532e3..baa9462 100644
 --- a/drivers/media/video/davinci/vpif.c
 +++ b/drivers/media/video/davinci/vpif.c
 @@ -41,6 +41,184 @@ spinlock_t vpif_lock;

  void __iomem *vpif_base;

 +/**
 + * ch_params: video standard configuration parameters for vpif
 + * The table must include all presets from supported subdevices.
 + */
 +const struct vpif_channel_config_params ch_params[] = {
 +       /* HDTV formats */
 +       {
 +               .name = 480p59_94,
 +               .width = 720,
 +               .height = 480,
 +               .frm_fmt = 1,
 +               .ycmux_mode = 0,
 +               .eav2sav = 138-8,
 +               .sav2eav = 720,
 +               .l1 = 1,
 +               .l3 = 43,
 +               .l5 = 523,
 +               .vsize = 525,
 +               .capture_format = 0,
 +               .vbi_supported = 0,
 +               .hd_sd = 1,
 +               .dv_preset = V4L2_DV_480P59_94,
 +       },
 +       {
 +               .name = 576p50,
 +               .width = 720,
 +               .height = 576,
 +               .frm_fmt = 1,
 +               .ycmux_mode = 0,
 +               .eav2sav = 144-8,
 +               .sav2eav = 720,
 +               .l1 = 1,
 +               .l3 = 45,
 +               .l5 = 621,
 +               .vsize = 625,
 +               .capture_format = 0,
 +               .vbi_supported = 0,
 +               .hd_sd = 1,
 +               .dv_preset = V4L2_DV_576P50,
 +       },
 +       {
 +               .name = 720p50,
 +               .width = 1280,
 +               .height = 720,
 +               .frm_fmt = 1,
 +               .ycmux_mode = 0,
 +               .eav2sav = 700-8,
 +               .sav2eav = 1280,
 +               .l1 = 1,
 +               .l3 = 26,
 +               .l5 = 746,
 +               .vsize = 750,
 +               .capture_format = 0,
 +               .vbi_supported = 0,
 +               .hd_sd = 1,
 +               .dv_preset = V4L2_DV_720P50,
 +       },
 +       {
 +               .name = 720p60,
 +               .width = 1280,
 +               .height = 720,
 +               .frm_fmt = 1,
 +               .ycmux_mode = 0,
 +               .eav2sav = 370 - 8,
 +               .sav2eav = 1280,
 +               .l1 = 1,
 +               .l3 = 26,
 +               .l5 = 746,
 +               .vsize = 750,
 +               .capture_format = 0,
 +               .vbi_supported = 0,
 +               .hd_sd = 1,
 +               .dv_preset = V4L2_DV_720P60,
 +       },
 +       {
 +               .name = 1080I50,
 +               .width = 1920,
 +               .height = 1080,
 +               .frm_fmt = 0,
 +               .ycmux_mode = 0,
 +               .eav2sav = 720 - 8,
 +               .sav2eav = 1920,
 +               .l1 = 1,
 +               .l3 = 21,
 +               .l5 = 561,
 +               .l7 = 563,
 +               .l9 = 584,
 +               .l11 = 1124,
 +               .vsize = 1125,
 +               .capture_format = 0,
 +               .vbi_supported = 0,
 +               .hd_sd = 1,
 +               .dv_preset = V4L2_DV_1080I50,
 +       },
 +       {
 +               .name = 1080I60,
 +               .width = 1920,
 +               .height = 1080,
 +               .frm_fmt = 0,
 +               .ycmux_mode = 0,
 +               .eav2sav = 280 - 8,
 +               .sav2eav = 1920,
 +               .l1 = 1,
 +               .l3 = 21,
 +               .l5 = 561,
 +               .l7 = 563,
 +               .l9 = 584,
 +               .l11 = 1124,
 +               .vsize = 1125,
 +               .capture_format = 0,
 +               .vbi_supported = 0,
 +               .hd_sd = 1,
 +               .dv_preset = V4L2_DV_1080I60,
 +       },
 +       {
 +               .name = 1080p60,
 +               .width = 1920,
 +               .height = 1080,
 + 

Fwd: [RFC/PATCH 3/5] vpif_cap/disp: Added support for DV presets

2010-10-24 Thread Muralidharan Karicheri
-- Forwarded message --
From: Muralidharan Karicheri mkarich...@gmail.com
Date: Sun, Oct 24, 2010 at 10:24 AM
Subject: Re: [RFC/PATCH 3/5] vpif_cap/disp: Added support for DV presets
To: mats.randga...@tandberg.com




On Fri, Oct 22, 2010 at 3:00 AM, mats.randga...@tandberg.com wrote:

 From: Mats Randgaard mats.randga...@tandberg.com

 Added functions to set/get/query/enum DV presets.

 Signed-off-by: Mats Randgaard mats.randga...@tandberg.com
 Signed-off-by: Hans Verkuil hans.verk...@tandberg.com
 ---
  drivers/media/video/davinci/vpif_capture.c |  143 
 +++-
  drivers/media/video/davinci/vpif_capture.h |    1 +
  drivers/media/video/davinci/vpif_display.c |  119 ++-
  drivers/media/video/davinci/vpif_display.h |    1 +
  4 files changed, 255 insertions(+), 9 deletions(-)

 diff --git a/drivers/media/video/davinci/vpif_capture.c 
 b/drivers/media/video/davinci/vpif_capture.c
 index 778af7e..bf1adea 100644
 --- a/drivers/media/video/davinci/vpif_capture.c
 +++ b/drivers/media/video/davinci/vpif_capture.c
 @@ -432,9 +432,18 @@ static int vpif_update_std_info(struct channel_obj *ch)

        for (index = 0; index  vpif_ch_params_count; index++) {
                config = ch_params[index];
 -               if (config-stdid  vid_ch-stdid) {
 -                       memcpy(std_info, config, sizeof(*config));
 -                       break;
 +               if (config-hd_sd == 0) {
 +                       vpif_dbg(2, debug, SD format\n);
 +                       if (config-stdid  vid_ch-stdid) {
 +                               memcpy(std_info, config, sizeof(*config));
 +                               break;
 +                       }
 +               } else {
 +                       vpif_dbg(2, debug, HD format\n);
 +                       if (config-dv_preset == vid_ch-dv_preset) {
 +                               memcpy(std_info, config, sizeof(*config));
 +                               break;
 +                       }
                }
        }

 @@ -1442,6 +1451,7 @@ static int vpif_s_std(struct file *file, void *priv, 
 v4l2_std_id *std_id)
                return -ERESTARTSYS;

        ch-video.stdid = *std_id;
 +       ch-video.dv_preset = V4L2_DV_INVALID;

        /* Get the information about the standard */
        if (vpif_update_std_info(ch)) {
 @@ -1794,6 +1804,129 @@ static int vpif_cropcap(struct file *file, void *priv,
        return 0;
  }

 +/**
 + * vpif_enum_dv_presets() - ENUM_DV_PRESETS handler
 + * @file: file ptr
 + * @priv: file handle
 + * @preset: input preset
 + */
 +static int vpif_enum_dv_presets(struct file *file, void *priv,
 +               struct v4l2_dv_enum_preset *preset)
 +{
 +       struct vpif_fh *fh = priv;
 +       struct channel_obj *ch = fh-channel;
 +
 +       if (!vpif_obj.sd) {
 +               vpif_dbg(2, debug, No sub devices registered\n);
 +
 +               if (preset-index = vpif_ch_params_count)
 +                       return -EINVAL;
 +
 +               /* dv-presets only */
 +               if (ch_params[preset-index].hd_sd == 0)
 +                       return -EINVAL;
 +
 +               return v4l_fill_dv_preset_info(
 +                               ch_params[preset-index].dv_preset, preset);
 +       }


if (!vpif_obj.sd)  check is not needed since it is already checked in
probe() as mentioned in other patch.

 +
 +       return v4l2_subdev_call(vpif_obj.sd[ch-curr_sd_index],
 +                       video, enum_dv_presets, preset);
 +}
 +
 +/**
 + * vpif_query_dv_presets() - QUERY_DV_PRESET handler
 + * @file: file ptr
 + * @priv: file handle
 + * @preset: input preset
 + */
 +static int vpif_query_dv_preset(struct file *file, void *priv,
 +               struct v4l2_dv_preset *preset)
 +{
 +       struct vpif_fh *fh = priv;
 +       struct channel_obj *ch = fh-channel;
 +
 +       if (!vpif_obj.sd) {
 +               vpif_dbg(2, debug, No sub devices registered\n);
 +               return -EINVAL;
 +       }
 +

Ditto.


 +       return v4l2_subdev_call(vpif_obj.sd[ch-curr_sd_index],
 +                      video, query_dv_preset, preset);
 +}
 +/**
 + * vpif_s_dv_presets() - S_DV_PRESETS handler
 + * @file: file ptr
 + * @priv: file handle
 + * @preset: input preset
 + */
 +static int vpif_s_dv_preset(struct file *file, void *priv,
 +               struct v4l2_dv_preset *preset)
 +{
 +       struct vpif_fh *fh = priv;
 +       struct channel_obj *ch = fh-channel;
 +       struct common_obj *common = ch-common[VPIF_VIDEO_INDEX];
 +       int ret = 0;
 +
 +       if (common-started) {
 +               vpif_err(streaming in progress\n);
 +               return -EBUSY;
 +       }

Please replace vpif_err() with vpif_dbg() since we don't want to flood
the console with unwanted print messages. Also if possible please
update the vpif_capture and vpif_display for similar instances.


 +
 +       if ((VPIF_CHANNEL0_VIDEO == ch-channel_id) ||
 +           (VPIF_CHANNEL1_VIDEO == 

Fwd: [RFC/PATCH 4/5] vpif_cap/disp: Added support for DV timings

2010-10-24 Thread Muralidharan Karicheri
-- Forwarded message --
From: Muralidharan Karicheri mkarich...@gmail.com
Date: Sun, Oct 24, 2010 at 10:33 AM
Subject: Re: [RFC/PATCH 4/5] vpif_cap/disp: Added support for DV timings
To: mats.randga...@tandberg.com




On Fri, Oct 22, 2010 at 3:00 AM, mats.randga...@tandberg.com wrote:

 From: Mats Randgaard mats.randga...@tandberg.com

 Added functions to set and get custom DV timings.

 Signed-off-by: Mats Randgaard mats.randga...@tandberg.com
 Signed-off-by: Hans Verkuil hans.verk...@tandberg.com
 ---
  drivers/media/video/davinci/vpif_capture.c |  119 +++
  drivers/media/video/davinci/vpif_capture.h |    1 +
  drivers/media/video/davinci/vpif_display.c |  120 
 
  drivers/media/video/davinci/vpif_display.h |    1 +
  4 files changed, 241 insertions(+), 0 deletions(-)

 diff --git a/drivers/media/video/davinci/vpif_capture.c 
 b/drivers/media/video/davinci/vpif_capture.c
 index bf1adea..184fa3c 100644
 --- a/drivers/media/video/davinci/vpif_capture.c
 +++ b/drivers/media/video/davinci/vpif_capture.c
 @@ -1927,6 +1927,123 @@ static int vpif_g_dv_preset(struct file *file, void 
 *priv,
        return 0;
  }

 +/**
 + * vpif_s_dv_timings() - S_DV_TIMINGS handler
 + * @file: file ptr
 + * @priv: file handle
 + * @timings: digital video timings
 + */
 +static int vpif_s_dv_timings(struct file *file, void *priv,
 +               struct v4l2_dv_timings *timings)
 +{
 +       struct vpif_fh *fh = priv;
 +       struct channel_obj *ch = fh-channel;
 +       struct vpif_params *vpifparams = ch-vpifparams;
 +       struct vpif_channel_config_params *std_info = vpifparams-std_info;
 +       struct video_obj *vid_obj = ch-video;
 +       struct v4l2_bt_timings *bt = vid_obj-bt_timings;
 +       int ret;
 +
 +       if (timings-type != V4L2_DV_BT_656_1120) {
 +               vpif_dbg(2, debug, Timing type not defined\n);
 +               return -EINVAL;
 +       }
 +
 +       /* Configure subdevice timings, if any */
 +       ret = v4l2_subdev_call(vpif_obj.sd[ch-curr_sd_index],
 +                       video, s_dv_timings, timings);
 +       if (ret == -ENOIOCTLCMD) {
 +               vpif_dbg(2, debug, Custom DV timings not supported by 
 +                               subdevice\n);
 +               return -EINVAL;
 +       }
 +       if (ret  0) {
 +               vpif_dbg(2, debug, Error setting custom DV timings\n);
 +               return ret;
 +       }
 +
 +       if (!(timings-bt.width  timings-bt.height 
 +                               (timings-bt.hbackporch ||
 +                                timings-bt.hfrontporch ||
 +                                timings-bt.hsync) 
 +                               timings-bt.vfrontporch 
 +                               (timings-bt.vbackporch ||
 +                                timings-bt.vsync))) {
 +               vpif_dbg(2, debug, Timings for width, height, 
 +                               horizontal back porch, horizontal sync, 
 +                               horizontal front porch, vertical back porch, 
 
 +                               vertical sync and vertical back porch 
 +                               must be defined\n);
 +               return -EINVAL;
 +       }
 +
 +       *bt = timings-bt;
 +
 +       /* Configure videoport timings */



 video port ?



 +       std_info-eav2sav = bt-hbackporch + bt-hfrontporch +
 +               bt-hsync - 8;
 +       std_info-sav2eav = bt-width;
 +
 +       std_info-l1 = 1;
 +       std_info-l3 = bt-vsync + bt-vbackporch + 1;
 +
 +       if (bt-interlaced) {
 +               if (bt-il_vbackporch || bt-il_vfrontporch || bt-il_vsync) {
 +                       std_info-vsize = bt-height * 2 +
 +                               bt-vfrontporch + bt-vsync + bt-vbackporch +
 +                               bt-il_vfrontporch + bt-il_vsync +
 +                               bt-il_vbackporch;
 +                       std_info-l5 = std_info-vsize/2 -
 +                               (bt-vfrontporch - 1);
 +                       std_info-l7 = std_info-vsize/2 + 1;
 +                       std_info-l9 = std_info-l7 + bt-il_vsync +
 +                               bt-il_vbackporch + 1;
 +                       std_info-l11 = std_info-vsize -
 +                               (bt-il_vfrontporch - 1);
 +               } else {
 +                       vpif_dbg(2, debug, Required timing values for 
 +                                       interlaced BT format missing\n);
 +                       return -EINVAL;
 +               }
 +       } else {
 +               std_info-vsize = bt-height + bt-vfrontporch +
 +                       bt-vsync + bt-vbackporch;
 +               std_info-l5 = std_info-vsize - (bt-vfrontporch - 1);
 +       }

Is the calculation above generic? If not, better this be moved to vpif.c


 +       strncpy(std_info-name, Custom timings BT656/1120, VPIF_MAX_NAME);
 +       std_info-width = bt-width;
 +       std_info-height = 

Fwd: [RFC/PATCH 5/5] vpif_cap/disp: Cleanup, improved comments

2010-10-24 Thread Muralidharan Karicheri
-- Forwarded message --
From: Muralidharan Karicheri mkarich...@gmail.com
Date: Sun, Oct 24, 2010 at 10:36 AM
Subject: Re: [RFC/PATCH 5/5] vpif_cap/disp: Cleanup, improved comments
To: mats.randga...@tandberg.com


Acked-by: Murali Karicheri mkarich...@gmail.com

On Fri, Oct 22, 2010 at 3:00 AM, mats.randga...@tandberg.com wrote:

 From: Mats Randgaard mats.randga...@tandberg.com

 Signed-off-by: Mats Randgaard mats.randga...@tandberg.com
 Signed-off-by: Hans Verkuil hans.verk...@tandberg.com
 ---
  drivers/media/video/davinci/vpif.h         |   13 ++---
  drivers/media/video/davinci/vpif_capture.c |   13 ++---
  drivers/media/video/davinci/vpif_display.c |   23 ---
  3 files changed, 32 insertions(+), 17 deletions(-)

 diff --git a/drivers/media/video/davinci/vpif.h 
 b/drivers/media/video/davinci/vpif.h
 index b121683..aea7487 100644
 --- a/drivers/media/video/davinci/vpif.h
 +++ b/drivers/media/video/davinci/vpif.h
 @@ -577,11 +577,10 @@ struct vpif_channel_config_params {
        char name[VPIF_MAX_NAME];       /* Name of the mode */
        u16 width;                      /* Indicates width of the image */
        u16 height;                     /* Indicates height of the image */
 -       u8 frm_fmt;                     /* Indicates whether this is 
 interlaced
 -                                        * or progressive format */
 -       u8 ycmux_mode;                  /* Indicates whether this mode 
 requires
 -                                        * single or two channels */
 -       u16 eav2sav;                    /* length of sav 2 eav */
 +       u8 frm_fmt;                     /* Interlaced (0) or progressive (1) 
 */
 +       u8 ycmux_mode;                  /* This mode requires one (0) or two 
 (1)
 +                                          channels */
 +       u16 eav2sav;                    /* length of eav 2 sav */
        u16 sav2eav;                    /* length of sav 2 eav */
        u16 l1, l3, l5, l7, l9, l11;    /* Other parameter configurations */
        u16 vsize;                      /* Vertical size of the image */
 @@ -589,8 +588,8 @@ struct vpif_channel_config_params {
                                         * is in BT or in CCD/CMOS */
        u8  vbi_supported;              /* Indicates whether this mode
                                         * supports capturing vbi or not */
 -       u8 hd_sd;
 -       v4l2_std_id stdid;
 +       u8 hd_sd;                       /* HDTV (1) or SDTV (0) format */
 +       v4l2_std_id stdid;              /* SDTV format */
        u32 dv_preset;                  /* HDTV format */
  };

 diff --git a/drivers/media/video/davinci/vpif_capture.c 
 b/drivers/media/video/davinci/vpif_capture.c
 index 184fa3c..3acc081 100644
 --- a/drivers/media/video/davinci/vpif_capture.c
 +++ b/drivers/media/video/davinci/vpif_capture.c
 @@ -329,7 +329,7 @@ static void vpif_schedule_next_buffer(struct common_obj 
 *common)
  * @dev_id: dev_id ptr
  *
  * It changes status of the captured buffer, takes next buffer from the queue
 - * and sets its address in VPIF  registers
 + * and sets its address in VPIF registers
  */
  static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
  {
 @@ -422,14 +422,12 @@ static int vpif_update_std_info(struct channel_obj *ch)
        struct common_obj *common = ch-common[VPIF_VIDEO_INDEX];
        struct vpif_params *vpifparams = ch-vpifparams;
        const struct vpif_channel_config_params *config;
 -       struct vpif_channel_config_params *std_info;
 +       struct vpif_channel_config_params *std_info = vpifparams-std_info;
        struct video_obj *vid_ch = ch-video;
        int index;

        vpif_dbg(2, debug, vpif_update_std_info\n);

 -       std_info = vpifparams-std_info;
 -
        for (index = 0; index  vpif_ch_params_count; index++) {
                config = ch_params[index];
                if (config-hd_sd == 0) {
 @@ -458,6 +456,7 @@ static int vpif_update_std_info(struct channel_obj *ch)
        common-fmt.fmt.pix.bytesperline = std_info-width;
        vpifparams-video_params.hpitch = std_info-width;
        vpifparams-video_params.storage_mode = std_info-frm_fmt;
 +
        return 0;
  }

 @@ -1691,7 +1690,7 @@ static int vpif_s_fmt_vid_cap(struct file *file, void 
 *priv,
        struct v4l2_pix_format *pixfmt;
        int ret = 0;

 -       vpif_dbg(2, debug, VIDIOC_S_FMT\n);
 +       vpif_dbg(2, debug, %s\n, __func__);

        /* If streaming is started, return error */
        if (common-started) {
 @@ -2356,9 +2355,9 @@ static __init int vpif_probe(struct platform_device 
 *pdev)
                if (vpif_obj.sd[i])
                        vpif_obj.sd[i]-grp_id = 1  i;
        }
 -       v4l2_info(vpif_obj.v4l2_dev, DM646x VPIF Capture driver
 -                  initialized\n);

 +       v4l2_info(vpif_obj.v4l2_dev,
 +                       DM646x VPIF capture driver initialized\n);
        return 0;

  probe_subdev_out:
 diff --git 

Fwd: [RFC/PATCH 2/5] vpif: Move and extend ch_params[]

2010-10-24 Thread Muralidharan Karicheri
Sorry for the duplicate.


-- Forwarded message --
From: Muralidharan Karicheri mkarich...@gmail.com
Date: Sun, Oct 24, 2010 at 10:13 AM
Subject: Re: [RFC/PATCH 2/5] vpif: Move and extend ch_params[]
To: mats.randga...@tandberg.com


Acked-by : Murali Karicheri mkarich...@gmail.com

On Fri, Oct 22, 2010 at 3:00 AM, mats.randga...@tandberg.com wrote:

 From: Mats Randgaard mats.randga...@tandberg.com

 - The ch_params tables in vpif_capture.c and vpif_display.c are moved to a 
 common
  table in vpif.c. Then it is easier to maintain the table.
 - The new table is extended with all the DV formats supportet by TVP7002.
 - The field fps is removed from the struct vpif_channel_config_params 
 because it
  is not used.
 - The field dv_preset is added to the struct vpif_channel_config_params to
  support DV formats.

 Signed-off-by: Mats Randgaard mats.randga...@tandberg.com
 Signed-off-by: Hans Verkuil hans.verk...@tandberg.com
 ---
  drivers/media/video/davinci/vpif.c         |  178 
 
  drivers/media/video/davinci/vpif.h         |    5 +-
  drivers/media/video/davinci/vpif_capture.c |   18 +---
  drivers/media/video/davinci/vpif_display.c |   17 +--
  4 files changed, 187 insertions(+), 31 deletions(-)

 diff --git a/drivers/media/video/davinci/vpif.c 
 b/drivers/media/video/davinci/vpif.c
 index 1f532e3..baa9462 100644
 --- a/drivers/media/video/davinci/vpif.c
 +++ b/drivers/media/video/davinci/vpif.c
 @@ -41,6 +41,184 @@ spinlock_t vpif_lock;

  void __iomem *vpif_base;

 +/**
 + * ch_params: video standard configuration parameters for vpif
 + * The table must include all presets from supported subdevices.
 + */
 +const struct vpif_channel_config_params ch_params[] = {
 +       /* HDTV formats */
 +       {
 +               .name = 480p59_94,
 +               .width = 720,
 +               .height = 480,
 +               .frm_fmt = 1,
 +               .ycmux_mode = 0,
 +               .eav2sav = 138-8,
 +               .sav2eav = 720,
 +               .l1 = 1,
 +               .l3 = 43,
 +               .l5 = 523,
 +               .vsize = 525,
 +               .capture_format = 0,
 +               .vbi_supported = 0,
 +               .hd_sd = 1,
 +               .dv_preset = V4L2_DV_480P59_94,
 +       },
 +       {
 +               .name = 576p50,
 +               .width = 720,
 +               .height = 576,
 +               .frm_fmt = 1,
 +               .ycmux_mode = 0,
 +               .eav2sav = 144-8,
 +               .sav2eav = 720,
 +               .l1 = 1,
 +               .l3 = 45,
 +               .l5 = 621,
 +               .vsize = 625,
 +               .capture_format = 0,
 +               .vbi_supported = 0,
 +               .hd_sd = 1,
 +               .dv_preset = V4L2_DV_576P50,
 +       },
 +       {
 +               .name = 720p50,
 +               .width = 1280,
 +               .height = 720,
 +               .frm_fmt = 1,
 +               .ycmux_mode = 0,
 +               .eav2sav = 700-8,
 +               .sav2eav = 1280,
 +               .l1 = 1,
 +               .l3 = 26,
 +               .l5 = 746,
 +               .vsize = 750,
 +               .capture_format = 0,
 +               .vbi_supported = 0,
 +               .hd_sd = 1,
 +               .dv_preset = V4L2_DV_720P50,
 +       },
 +       {
 +               .name = 720p60,
 +               .width = 1280,
 +               .height = 720,
 +               .frm_fmt = 1,
 +               .ycmux_mode = 0,
 +               .eav2sav = 370 - 8,
 +               .sav2eav = 1280,
 +               .l1 = 1,
 +               .l3 = 26,
 +               .l5 = 746,
 +               .vsize = 750,
 +               .capture_format = 0,
 +               .vbi_supported = 0,
 +               .hd_sd = 1,
 +               .dv_preset = V4L2_DV_720P60,
 +       },
 +       {
 +               .name = 1080I50,
 +               .width = 1920,
 +               .height = 1080,
 +               .frm_fmt = 0,
 +               .ycmux_mode = 0,
 +               .eav2sav = 720 - 8,
 +               .sav2eav = 1920,
 +               .l1 = 1,
 +               .l3 = 21,
 +               .l5 = 561,
 +               .l7 = 563,
 +               .l9 = 584,
 +               .l11 = 1124,
 +               .vsize = 1125,
 +               .capture_format = 0,
 +               .vbi_supported = 0,
 +               .hd_sd = 1,
 +               .dv_preset = V4L2_DV_1080I50,
 +       },
 +       {
 +               .name = 1080I60,
 +               .width = 1920,
 +               .height = 1080,
 +               .frm_fmt = 0,
 +               .ycmux_mode = 0,
 +               .eav2sav = 280 - 8,
 +               .sav2eav = 1920,
 +               .l1 = 1,
 +               .l3 = 21,
 +               .l5 = 561,
 +               .l7 = 563,
 +               .l9 = 584,
 +               .l11 = 1124,
 +               .vsize = 1125,
 +               .capture_format = 0,
 +               .vbi_supported = 0,
 +               .hd_sd = 1,
 +    

To slow libv4l MJPEG decoding with HD cameras

2010-10-24 Thread Mitar
Hi!

Logitech HD Pro Webcam C910 supports 2592x1944 at 10 FPS MJPEG stream.
This is really great but the problem is that libv4l decoding of MJPEG
is too slow for real-time on the fly decoding at this framerate. I use
2.6.36-rc6-amd64 and Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz and
0.8.1 v4l-utils.

For example, with libv4l decoding of one pixel of MJPEG to BGR24 takes
around 0.025 microseconds on my machine. This is nothing important
with for example 640x480 resolution, it takes around 7680
microseconds, that is 8 milliseconds. But with 2592x1944 this becomes
around 125 milliseconds. So it is impossible to decode stream on the
fly in real-time with 10 FPS.

In comparison YUYV decoding takes 0.005 microseconds per pixel on
average. Those measurements per pixel (both for MJPEG and YUYV) are
quite consistent even for different framerates and frame sizes.

So maybe there is some room for improvement here? For example by using
ffmpeg MJPEG decoder instead of tinyjpeg? They argue (not really
kindly) that it has better performance:

https://roundup.ffmpeg.org/issue1816

Has anybody tried to improve MJPEG support in libv4l? With newer
cameras this becomes important.

And by the way, it would be useful to increase those hardcoded limits
in ib/libv4lconvert/tinyjpeg-internal.h to for example:

#define JPEG_MAX_WIDTH 4096
#define JPEG_MAX_HEIGHT2048

Now we have affordable cameras which have bigger frame sizes than
those currently hardcoded. ;-)


Mitar
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] media/video/gspca: fix error check

2010-10-24 Thread Nicolas Kaiser
It looks to me like it was intended to check the return value
at this point.

Signed-off-by: Nicolas Kaiser ni...@nikai.net
---
 drivers/media/video/gspca/cpia1.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/gspca/cpia1.c 
b/drivers/media/video/gspca/cpia1.c
index 9b12168..58325db 100644
--- a/drivers/media/video/gspca/cpia1.c
+++ b/drivers/media/video/gspca/cpia1.c
@@ -829,7 +829,7 @@ static int goto_low_power(struct gspca_dev *gspca_dev)
if (ret)
return ret;
 
-   do_command(gspca_dev, CPIA_COMMAND_GetCameraStatus, 0, 0, 0, 0);
+   ret = do_command(gspca_dev, CPIA_COMMAND_GetCameraStatus, 0, 0, 0, 0);
if (ret)
return ret;
 
-- 
1.7.2.2
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/8] v4l: Add EBUSY error description for VIDIOC_STREAMON

2010-10-24 Thread Pawel Osciak
On Fri, Oct 22, 2010 at 17:18, Mauro Carvalho Chehab mche...@redhat.com wrote:
 Em 06-09-2010 03:53, Marek Szyprowski escreveu:
 From: Pawel Osciak p.osc...@samsung.com

 VIDIOC_STREAMON should return EBUSY if streaming is already active.

 Signed-off-by: Pawel Osciak p.osc...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
 ---
  Documentation/DocBook/v4l/vidioc-streamon.xml |    7 +++
  1 files changed, 7 insertions(+), 0 deletions(-)

 diff --git a/Documentation/DocBook/v4l/vidioc-streamon.xml 
 b/Documentation/DocBook/v4l/vidioc-streamon.xml
 index e42bff1..fdbd8d8 100644
 --- a/Documentation/DocBook/v4l/vidioc-streamon.xml
 +++ b/Documentation/DocBook/v4l/vidioc-streamon.xml
 @@ -93,6 +93,13 @@ synchronize with other events./para
  been allocated (memory mapping) or enqueued (output) yet./para
       /listitem
        /varlistentry
 +      varlistentry
 +     termerrorcodeEBUSY/errorcode/term
 +     listitem
 +       paraconstantVIDIOC_STREAMON/constant called, but
 +       streaming I/O already active./para
 +     /listitem
 +      /varlistentry
      /variablelist
    /refsect1
  /refentry

 I'm in doubt about this patch. I don't see any problem on just return 0 if
 stream is active.

 Actually, I think that this patch may break some applications, as there are
 some cases where stream may start even without streamon (like via read() 
 method).


A quick grep over the media directory reveals that many drivers
(including videobuf_streamon) return EBUSY for some cases. This patch
was not intended to introduce something new to the API. I just wanted
to document an undocumented return value. How should the EBUSY return
be interpreted? Or should we get rid of it?

-- 
Best regards,
Pawel Osciak
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Guard a divide in v4l1 compat layer

2010-10-24 Thread Dr. David Alan Gilbert
Hi,
  I managed to trigger a divide by 0 in the v4l compat code
with the mem2mem test module; I suspect perhaps it shouldn't
have been returning a 0 pixel wide picture, but either way it seems
right to guard this divide by 0 in the compatibility layer.

Tested on 2.6.36 (ubuntu build, but the code in this is the same as upstream), 
but ***not tested with a real video device***.

Signed-off-by: Dr. David Alan Gilbert li...@treblig.org
--
diff --git a/drivers/media/video/v4l1-compat.c 
b/drivers/media/video/v4l1-compat.c
index 0c2105c..d4ac751 100644
--- a/drivers/media/video/v4l1-compat.c
+++ b/drivers/media/video/v4l1-compat.c
@@ -645,9 +645,16 @@ static noinline long v4l1_compat_get_picture(
goto done;
}
 
-   pict-depth   = ((fmt-fmt.pix.bytesperline  3)
-+ (fmt-fmt.pix.width - 1))
-/ fmt-fmt.pix.width;
+   if (fmt-fmt.pix.width)
+   {
+   pict-depth   = ((fmt-fmt.pix.bytesperline  3)
++ (fmt-fmt.pix.width - 1))
+/ fmt-fmt.pix.width;
+   } else {
+   err = -EINVAL;
+   goto done;
+   }
+
pict-palette = pixelformat_to_palette(
fmt-fmt.pix.pixelformat);
 done:

-- 
 -Open up your eyes, open up your mind, open up your code ---   
/ Dr. David Alan Gilbert|   Running GNU/Linux   | Happy  \ 
\ gro.gilbert @ treblig.org |   | In Hex /
 \ _|_ http://www.treblig.org   |___/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: dvb-apps: hr-All update

2010-10-24 Thread Samuel Rakitničan
On Sun, 24 Oct 2010 13:50:02 +0200, Christoph Pfister  
christophpfis...@gmail.com wrote:



2010/10/24 Samuel Rakitničan samuel.rakitni...@gmail.com:

Hi,

Some channel changed, also added additional mux for all regions. Digital
switch over was done for the whole country so channels should be  
changing

less frequently now.


Updated, thanks!


Realized that didn't edit parameters for this on copy paste :
T 76200 8MHz 2/3 NONE QAM64 8k 1/8 NONE # Tusti Vrh MUXD

Sorry, diff attached


Best regards,
Samuel

hr-All.diff
Description: Binary data


Re: Wintv-HVR-1120 woes

2010-10-24 Thread Albin Kauffmann
On Thursday 21 October 2010 23:25:29 Sasha Sirotkin wrote:
 I'm having all sorts of troubles with Wintv-HVR-1120 on Ubuntu 10.10
 (kernel 2.6.35-22). Judging from what I've seen on the net, including
 this mailing list, I'm not the only one not being able to use this
 card and no solution seem to exist.
 
 Problems:
 1. The driver yells various cryptic error messages
 (tda18271_write_regs: [1-0060|M] ERROR: idx = 0x5, len = 1,
 i2c_transfer returned: -5, tda18271_set_analog_params: [1-0060|M]
 error -5 on line 1045, etc)

yes, indeed :(
(cf Hauppauge WinTV-HVR-1120 on Unbuntu 10.04 thread)

 2. DVB-T scan (using w_scan) produces no results

Is this happening after each reboot? As far as I'm concerned, I've never had 
problems with DVB-T scans.

 3. Analog seems to work, but with very poor quality

I just tried to use Analog TV in order to confirm the problem but I cannot get 
any picture. Maybe I just don't know how to use it. I'm using commands like 
(I'm located in France):

mplayer tv:// -tv driver=v4l2:norm=SECAM:chanlist=france -tvscan autostart

... and just get some snow on scanned channels.
As I might have a problem with my antenna (an interior one), I am going to 
test it under Windows and report back my experience.

Cheers,

-- 
Albin Kauffmann
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[cron job] v4l-dvb daily build 2.6.26 and up: ERRORS

2010-10-24 Thread Hans Verkuil
This message is generated daily by a cron job that builds v4l-dvb for
the kernels and architectures in the list below.

Results of the daily build of v4l-dvb:

date:Sun Oct 24 19:00:28 CEST 2010
path:http://www.linuxtv.org/hg/v4l-dvb
changeset:   15167:abd3aac6644e
git master:   3e6dce76d99b328716b43929b9195adfee1de00c
git media-master: a348e9110ddb5d494e060d989b35dd1f35359d58
gcc version:  i686-linux-gcc (GCC) 4.5.1
host hardware:x86_64
host os:  2.6.32.5

linux-git-armv5: WARNINGS
linux-git-armv5-davinci: WARNINGS
linux-git-armv5-ixp: WARNINGS
linux-git-armv5-omap2: WARNINGS
linux-git-i686: WARNINGS
linux-git-m32r: WARNINGS
linux-git-mips: WARNINGS
linux-git-powerpc64: WARNINGS
linux-git-x86_64: WARNINGS
linux-2.6.32.6-armv5: WARNINGS
linux-2.6.33-armv5: WARNINGS
linux-2.6.34-armv5: WARNINGS
linux-2.6.35.3-armv5: WARNINGS
linux-2.6.32.6-armv5-davinci: ERRORS
linux-2.6.33-armv5-davinci: ERRORS
linux-2.6.34-armv5-davinci: ERRORS
linux-2.6.35.3-armv5-davinci: ERRORS
linux-2.6.32.6-armv5-ixp: ERRORS
linux-2.6.33-armv5-ixp: ERRORS
linux-2.6.34-armv5-ixp: ERRORS
linux-2.6.35.3-armv5-ixp: ERRORS
linux-2.6.32.6-armv5-omap2: ERRORS
linux-2.6.33-armv5-omap2: ERRORS
linux-2.6.34-armv5-omap2: ERRORS
linux-2.6.35.3-armv5-omap2: ERRORS
linux-2.6.26.8-i686: WARNINGS
linux-2.6.27.44-i686: WARNINGS
linux-2.6.28.10-i686: WARNINGS
linux-2.6.29.1-i686: WARNINGS
linux-2.6.30.10-i686: WARNINGS
linux-2.6.31.12-i686: WARNINGS
linux-2.6.32.6-i686: WARNINGS
linux-2.6.33-i686: WARNINGS
linux-2.6.34-i686: WARNINGS
linux-2.6.35.3-i686: WARNINGS
linux-2.6.32.6-m32r: WARNINGS
linux-2.6.33-m32r: WARNINGS
linux-2.6.34-m32r: WARNINGS
linux-2.6.35.3-m32r: WARNINGS
linux-2.6.32.6-mips: WARNINGS
linux-2.6.33-mips: WARNINGS
linux-2.6.34-mips: WARNINGS
linux-2.6.35.3-mips: WARNINGS
linux-2.6.32.6-powerpc64: WARNINGS
linux-2.6.33-powerpc64: WARNINGS
linux-2.6.34-powerpc64: WARNINGS
linux-2.6.35.3-powerpc64: WARNINGS
linux-2.6.26.8-x86_64: WARNINGS
linux-2.6.27.44-x86_64: WARNINGS
linux-2.6.28.10-x86_64: WARNINGS
linux-2.6.29.1-x86_64: WARNINGS
linux-2.6.30.10-x86_64: WARNINGS
linux-2.6.31.12-x86_64: WARNINGS
linux-2.6.32.6-x86_64: WARNINGS
linux-2.6.33-x86_64: WARNINGS
linux-2.6.34-x86_64: WARNINGS
linux-2.6.35.3-x86_64: WARNINGS
spec-git: OK
sparse: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.tar.bz2

The V4L-DVB specification from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/8] v4l: Add EBUSY error description for VIDIOC_STREAMON

2010-10-24 Thread Laurent Pinchart
On Sunday 24 October 2010 18:52:09 Pawel Osciak wrote:
 On Fri, Oct 22, 2010 at 17:18, Mauro Carvalho Chehab mche...@redhat.com 
wrote:
  Em 06-09-2010 03:53, Marek Szyprowski escreveu:
  From: Pawel Osciak p.osc...@samsung.com
  
  VIDIOC_STREAMON should return EBUSY if streaming is already active.
  
  Signed-off-by: Pawel Osciak p.osc...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
  ---
   Documentation/DocBook/v4l/vidioc-streamon.xml |7 +++
   1 files changed, 7 insertions(+), 0 deletions(-)
  
  diff --git a/Documentation/DocBook/v4l/vidioc-streamon.xml
  b/Documentation/DocBook/v4l/vidioc-streamon.xml index e42bff1..fdbd8d8
  100644
  --- a/Documentation/DocBook/v4l/vidioc-streamon.xml
  +++ b/Documentation/DocBook/v4l/vidioc-streamon.xml
  @@ -93,6 +93,13 @@ synchronize with other events./para
   been allocated (memory mapping) or enqueued (output) yet./para
/listitem
 /varlistentry
  +  varlistentry
  + termerrorcodeEBUSY/errorcode/term
  + listitem
  +   paraconstantVIDIOC_STREAMON/constant called, but
  +   streaming I/O already active./para
  + /listitem
  +  /varlistentry
   /variablelist
 /refsect1
   /refentry
  
  I'm in doubt about this patch. I don't see any problem on just return 0
  if stream is active.
  
  Actually, I think that this patch may break some applications, as there
  are some cases where stream may start even without streamon (like via
  read() method).
 
 A quick grep over the media directory reveals that many drivers
 (including videobuf_streamon) return EBUSY for some cases. This patch
 was not intended to introduce something new to the API. I just wanted
 to document an undocumented return value. How should the EBUSY return
 be interpreted? Or should we get rid of it?

I think the patch makes sense. As you mention many drivers already implement 
this behaviour, so this mostly clarifies the API. Calling VIDIOC_STREAMON on 
an already streaming file handle isn't something applications should do in the 
first place anyway.

-- 
Regards,

Laurent Pinchart
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/8] v4l: Add EBUSY error description for VIDIOC_STREAMON

2010-10-24 Thread Devin Heitmueller
On Sun, Oct 24, 2010 at 3:50 PM, Laurent Pinchart
laurent.pinch...@ideasonboard.com wrote:
 I think the patch makes sense. As you mention many drivers already implement
 this behaviour, so this mostly clarifies the API. Calling VIDIOC_STREAMON on
 an already streaming file handle isn't something applications should do in the
 first place anyway.

I don't disagree with this behavior in principle, but Pawel should
really try this out with some of the common applications to ensure it
doesn't cause breakage (e.g. tvtime, xawtv, mythtv).

Despite the fact that some drivers already do this, that doesn't mean
that those drivers are necessarily the ones commonly used with these
applications.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Wintv-HVR-1120 woes

2010-10-24 Thread Sasha Sirotkin
On Sun, Oct 24, 2010 at 8:55 PM, Albin Kauffmann
albin.kauffm...@gmail.com wrote:
 On Thursday 21 October 2010 23:25:29 Sasha Sirotkin wrote:
 I'm having all sorts of troubles with Wintv-HVR-1120 on Ubuntu 10.10
 (kernel 2.6.35-22). Judging from what I've seen on the net, including
 this mailing list, I'm not the only one not being able to use this
 card and no solution seem to exist.

 Problems:
 1. The driver yells various cryptic error messages
 (tda18271_write_regs: [1-0060|M] ERROR: idx = 0x5, len = 1,
 i2c_transfer returned: -5, tda18271_set_analog_params: [1-0060|M]
 error -5 on line 1045, etc)

 yes, indeed :(
 (cf Hauppauge WinTV-HVR-1120 on Unbuntu 10.04 thread)

 2. DVB-T scan (using w_scan) produces no results

 Is this happening after each reboot? As far as I'm concerned, I've never had
 problems with DVB-T scans.


Almost always. I think I had a lucky reboot or two, but most of the
time DVB-T scan produces nothing.

 3. Analog seems to work, but with very poor quality

 I just tried to use Analog TV in order to confirm the problem but I cannot get
 any picture. Maybe I just don't know how to use it. I'm using commands like
 (I'm located in France):

 mplayer tv:// -tv driver=v4l2:norm=SECAM:chanlist=france -tvscan autostart

 ... and just get some snow on scanned channels.
 As I might have a problem with my antenna (an interior one), I am going to
 test it under Windows and report back my experience.

I'm using tvtime-scanner

 Cheers,

 --
 Albin Kauffmann



I'm trying to downgrade the kernel now to see if it helps
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Wintv-HVR-1120 woes

2010-10-24 Thread Sasha Sirotkin
On Sun, Oct 24, 2010 at 10:22 PM, Sasha Sirotkin demi...@femtolinux.com wrote:
 On Sun, Oct 24, 2010 at 8:55 PM, Albin Kauffmann
 albin.kauffm...@gmail.com wrote:
 On Thursday 21 October 2010 23:25:29 Sasha Sirotkin wrote:
 I'm having all sorts of troubles with Wintv-HVR-1120 on Ubuntu 10.10
 (kernel 2.6.35-22). Judging from what I've seen on the net, including
 this mailing list, I'm not the only one not being able to use this
 card and no solution seem to exist.

 Problems:
 1. The driver yells various cryptic error messages
 (tda18271_write_regs: [1-0060|M] ERROR: idx = 0x5, len = 1,
 i2c_transfer returned: -5, tda18271_set_analog_params: [1-0060|M]
 error -5 on line 1045, etc)

 yes, indeed :(
 (cf Hauppauge WinTV-HVR-1120 on Unbuntu 10.04 thread)

 2. DVB-T scan (using w_scan) produces no results

 Is this happening after each reboot? As far as I'm concerned, I've never had
 problems with DVB-T scans.


 Almost always. I think I had a lucky reboot or two, but most of the
 time DVB-T scan produces nothing.

 3. Analog seems to work, but with very poor quality

 I just tried to use Analog TV in order to confirm the problem but I cannot 
 get
 any picture. Maybe I just don't know how to use it. I'm using commands like
 (I'm located in France):

 mplayer tv:// -tv driver=v4l2:norm=SECAM:chanlist=france -tvscan autostart

 ... and just get some snow on scanned channels.
 As I might have a problem with my antenna (an interior one), I am going to
 test it under Windows and report back my experience.

 I'm using tvtime-scanner

 Cheers,

 --
 Albin Kauffmann



 I'm trying to downgrade the kernel now to see if it helps


I went back as far as 2.6.30 and I still have this problem. 2.6.29
does not recognize this card at all.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/7] v4l: videobuf2: add read() emulator

2010-10-24 Thread Pawel Osciak
Hi Marek,
This is a pretty crafty patch, you've managed to make it nice and
clean, without adding complexity to streaming code. Nice job. A few of
my comments below.

On Tue, Oct 19, 2010 at 23:41, Marek Szyprowski
m.szyprow...@samsung.com wrote:
 Add a generic read() emulator for videobuf2. It uses MMAP memory type
 buffers and generic vb2 calls: req_bufs, qbuf and dqbuf. Video date is
 being copied from mmap buffers to userspace with standard copy_to_user()
 function. To add read() support to the driver, only one additional
 structure should be provides which defines the default number of buffers
 used by emulator and detemines the style of read() emulation
 ('streaming' or 'one shot').

 Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 CC: Pawel Osciak pa...@osciak.com
 ---
  drivers/media/video/videobuf2-core.c |  322 
 --
  include/media/videobuf2-core.h       |   21 +++
  2 files changed, 325 insertions(+), 18 deletions(-)

 diff --git a/drivers/media/video/videobuf2-core.c 
 b/drivers/media/video/videobuf2-core.c
 index 4a29c49..ab00246 100644
 --- a/drivers/media/video/videobuf2-core.c
 +++ b/drivers/media/video/videobuf2-core.c
 @@ -471,7 +471,7 @@ static bool __buffers_in_use(struct vb2_queue *q)
  * The return values from this function are intended to be directly returned
  * from vidioc_reqbufs handler in driver.
  */
 -int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
 +static int __vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers 
 *req)
  {
        unsigned int num_buffers, num_planes;
        int ret = 0;
 @@ -482,8 +482,6 @@ int vb2_reqbufs(struct vb2_queue *q, struct 
 v4l2_requestbuffers *req)
                return -EINVAL;
        }

 -       mutex_lock(q-vb_lock);
 -
        if (req-type != q-type) {
                dprintk(1, reqbufs: queue type invalid\n);
                ret = -EINVAL;
 @@ -567,6 +565,15 @@ end:
        mutex_unlock(q-vb_lock);
        return ret;
  }
 +
 +int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
 +{
 +       int ret = 0;
 +       mutex_lock(q-vb_lock);
 +       ret = (q-read_data) ? -EBUSY : __vb2_reqbufs(q, req);
 +       mutex_unlock(q-vb_lock);
 +       return ret;
 +}
  EXPORT_SYMBOL_GPL(vb2_reqbufs);

  /**
 @@ -821,14 +828,11 @@ static void __enqueue_in_driver(struct vb2_buffer *vb)
  * The return values from this function are intended to be directly returned
  * from vidioc_qbuf handler in driver.
  */
 -int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b)
 +static int __vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b)
  {
        struct vb2_buffer *vb;
 -       int ret;
 -
 -       mutex_lock(q-vb_lock);
 +       int ret = -EINVAL;

 -       ret = -EINVAL;
        if (b-type != q-type) {
                dprintk(1, qbuf: invalid buffer type\n);
                goto done;
 @@ -887,6 +891,14 @@ int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b)
        dprintk(1, qbuf of buffer %d succeeded\n, vb-v4l2_buf.index);
        ret = 0;
  done:
 +       return ret;
 +}
 +
 +int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b)
 +{
 +       int ret = 0;
 +       mutex_lock(q-vb_lock);
 +       ret = (q-read_data) ? -EBUSY : __vb2_qbuf(q, b);
        mutex_unlock(q-vb_lock);
        return ret;
  }
 @@ -996,13 +1008,11 @@ end:
  * The return values from this function are intended to be directly returned
  * from vidioc_dqbuf handler in driver.
  */
 -int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking)
 +static int __vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool 
 nonblocking)
  {
        struct vb2_buffer *vb = NULL;
        int ret;

 -       mutex_lock(q-vb_lock);
 -
        if (b-type != q-type) {
                dprintk(1, dqbuf: invalid buffer type\n);
                ret = -EINVAL;
 @@ -1047,6 +1057,14 @@ int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer 
 *b, bool nonblocking)
        vb-state = VB2_BUF_STATE_DEQUEUED;

  done:
 +       return ret;
 +}
 +
 +int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking)
 +{
 +       int ret;
 +       mutex_lock(q-vb_lock);
 +       ret = (q-read_data) ? -EBUSY : __vb2_dqbuf(q, b, nonblocking);
        mutex_unlock(q-vb_lock);
        return ret;
  }
 @@ -1065,13 +1083,11 @@ EXPORT_SYMBOL_GPL(vb2_dqbuf);
  * The return values from this function are intended to be directly returned
  * from vidioc_streamon handler in the driver.
  */
 -int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type)
 +static int __vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type)
  {
        struct vb2_buffer *vb;
        int ret = 0;

 -       mutex_lock(q-vb_lock);
 -
        if (type != q-type) {
                dprintk(1, streamon: invalid stream type\n);
                ret = -EINVAL;
 @@ -1113,6 +1129,14 @@ int vb2_streamon(struct vb2_queue *q, enum 
 v4l2_buf_type type)

        dprintk(3, 

Re: [PATCH 1/7] v4l: add videobuf2 Video for Linux 2 driver framework

2010-10-24 Thread Pawel Osciak
Hi Marek,
Thanks for your patches, I went through your changes. Minor comments below.

On Tue, Oct 19, 2010 at 23:41, Marek Szyprowski
m.szyprow...@samsung.com wrote:
 From: Pawel Osciak p.osc...@samsung.com

 +/**
 + * __vb2_queue_cancel() - cancel and stop (pause) streaming
 + *
 + * Removes all queued buffers from driver's queue and all buffers queued by
 + * userspace from videobuf's queue. Returns to state after reqbufs.
 + */
 +static void __vb2_queue_cancel(struct vb2_queue *q)
 +{
 +       /*
 +        * Tell driver to stop all dma transactions and release all queued
 +        * buffers
 +        */

Just being picky, but those doesn't neccesarily are dma transactions.

 +       if (q-streaming  q-ops-stop_streaming)
 +               q-ops-stop_streaming(q);
 +       q-streaming = 0;
 +
 +       /*
 +        * Remove all buffers from videobuf's list...
 +        */
 +       INIT_LIST_HEAD(q-queued_list);
 +       /*
 +        * ...and done list; userspace will not receive any buffers it
 +        * has not already dequeued before initiating cancel.
 +        */
 +       INIT_LIST_HEAD(q-done_list);
 +       wake_up_all(q-done_wq);

Any reason for replacing wake_up_interruptible_all with wake_up_all?



-- 
Best regards,
Pawel Osciak
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] IR: initialize ir_raw_event in few more drivers

2010-10-24 Thread Maxim Levitsky
Few drivers still have assumption that ir_raw_event
consists of duration and pulse flag.
Fix that.

Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
---
 drivers/media/dvb/siano/smsir.c  |2 +-
 drivers/media/video/cx23885/cx23888-ir.c |1 +
 drivers/media/video/cx25840/cx25840-ir.c |1 +
 3 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/siano/smsir.c b/drivers/media/dvb/siano/smsir.c
index d0e4639..a27c44a 100644
--- a/drivers/media/dvb/siano/smsir.c
+++ b/drivers/media/dvb/siano/smsir.c
@@ -40,7 +40,7 @@ void sms_ir_event(struct smscore_device_t *coredev, const 
char *buf, int len)
const s32 *samples = (const void *)buf;
 
for (i = 0; i  len  2; i++) {
-   struct ir_raw_event ev;
+   DEFINE_IR_RAW_EVENT(ev);
 
ev.duration = abs(samples[i]) * 1000; /* Convert to ns */
ev.pulse = (samples[i]  0) ? false : true;
diff --git a/drivers/media/video/cx23885/cx23888-ir.c 
b/drivers/media/video/cx23885/cx23888-ir.c
index 2502a0a..e78e3e4 100644
--- a/drivers/media/video/cx23885/cx23888-ir.c
+++ b/drivers/media/video/cx23885/cx23888-ir.c
@@ -704,6 +704,7 @@ static int cx23888_ir_rx_read(struct v4l2_subdev *sd, u8 
*buf, size_t count,
if (v  IR_MAX_DURATION)
v = IR_MAX_DURATION;
 
+   init_ir_raw_event(p-ir_core_data);
p-ir_core_data.pulse = u;
p-ir_core_data.duration = v;
 
diff --git a/drivers/media/video/cx25840/cx25840-ir.c 
b/drivers/media/video/cx25840/cx25840-ir.c
index c2b4c14..97a4e9b 100644
--- a/drivers/media/video/cx25840/cx25840-ir.c
+++ b/drivers/media/video/cx25840/cx25840-ir.c
@@ -706,6 +706,7 @@ static int cx25840_ir_rx_read(struct v4l2_subdev *sd, u8 
*buf, size_t count,
if (v  IR_MAX_DURATION)
v = IR_MAX_DURATION;
 
+   init_ir_raw_event(p-ir_core_data);
p-ir_core_data.pulse = u;
p-ir_core_data.duration = v;
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html