Re: Volunteers needed: BKL removal: replace .ioctl by .unlocked_ioctl

2010-12-18 Thread Muralidharan Karicheri
Hans,

For davinci drivers, I will be able to do this for vpfe_capture driver
(DM355/6446/365). For DM6467, will someone from your company be able
to take care of this?

Murali

On Sat, Dec 18, 2010 at 6:31 AM, Hans Verkuil hverk...@xs4all.nl wrote:
 Hi all,

 Now that the BKL patch series has been merged in 2.6.37 it is time to work
 on replacing .ioctl by .unlocked_ioctl in all v4l drivers.

 I've made an inventory of all drivers that still use .ioctl and I am looking
 for volunteers to tackle one or more drivers.

 I have CCed this email to the maintainers of the various drivers (if I know
 who it is) in the hope that we can get this conversion done as quickly as
 possible.

 If I have added your name to a driver, then please confirm if you are able to
 work on it or not. If you can't work on it, but you know someone else, then
 let me know as well.

 There is also a list of drivers where I do not know who can do the conversion.
 If you can tackle one or more of those, please respond. Unfortunately, those
 are among the hardest to convert :-(

 It would be great if we can tackle most of these drivers for 2.6.38. I think
 we should finish all drivers for 2.6.39 at the latest.

 There are two ways of doing the conversion: one is to do all the locking 
 within
 the driver, the other is to use core-assisted locking. How to do the 
 core-assisted
 locking is described in Documentation/video4linux/v4l2-framework.txt, but I'll
 repeat the relevant part here:

 v4l2_file_operations and locking
 

 You can set a pointer to a mutex_lock in struct video_device. Usually this
 will be either a top-level mutex or a mutex per device node. If you want
 finer-grained locking then you have to set it to NULL and do you own locking.

 If a lock is specified then all file operations will be serialized on that
 lock. If you use videobuf then you must pass the same lock to the videobuf
 queue initialize function: if videobuf has to wait for a frame to arrive, then
 it will temporarily unlock the lock and relock it afterwards. If your driver
 also waits in the code, then you should do the same to allow other processes
 to access the device node while the first process is waiting for something.

 The implementation of a hotplug disconnect should also take the lock before
 calling v4l2_device_disconnect.


 Driver list:

 saa7146 (Hans Verkuil)
 mem2mem_testdev (Pawel Osciak or Marek Szyprowski)
 cx23885 (Steve Toth)
 cx18-alsa (Andy Walls)
 omap24xxcam (Sakari Ailus or David Cohen)
 au0828 (Janne Grunau)
 cpia2 (Andy Walls or Hans Verkuil)
 cx231xx (Mauro Carvalho Chehab)
 davinci (Muralidharan Karicheri)
 saa6588 (Hans Verkuil)
 pvrusb2 (Mike Isely)
 usbvision (Hans Verkuil)
 s5p-fimc (Sylwester Nawrocki)
 fsl-viu (Anatolij Gustschin)
 tlg2300 (Mauro Carvalho Chehab)
 zr364xx (Hans de Goede)
 soc_camera (Guennadi Liakhovetski)
 usbvideo/vicam (Hans de Goede)
 s2255drv (Pete Eberlein)
 bttv (Mauro Carvalho Chehab)
 stk-webcam (Hans de Goede)
 se401 (Hans de Goede)
 si4713-i2c (Hans Verkuil)
 dsbr100 (Hans Verkuil)

 Staging driver list:

 go7007 (Pete Eberlein)
 tm6000 (Mauro Carvalho Chehab)
 (stradis/cpia: will be removed in 2.6.38, so no need to do anything)

 Unassigned drivers:

 saa7134
 em28xx
 cx88
 solo6x10 (staging driver)

 Regards,

        Hans

 --
 Hans Verkuil - video4linux developer - sponsored by Cisco
 --
 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




-- 
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: [PATCH v2 0/6] davinci vpbe: display driver for DM644X

2010-11-27 Thread Muralidharan Karicheri
Manjunath,

Could you re-send the patch 1/6? I can't find it either at my inbox or
mailing list.

On Wed, Nov 24, 2010 at 9:08 AM, Manjunath Hadli manjunath.ha...@ti.com wrote:
 This driver is written for Texas Instruments's DM644X VPBE IP.
 This SoC supports 2 video planes and 2 OSD planes as part of its
 OSD (On Screen Display) block.

 At present, the patches conatin the basic support of DM644X V4L2
 driver, and subsequent patch sets would add support for external
 encoders,other DMXXX family SoC and fbdev support.

               VPBE V4L2 driver design
 ==

 File partitioning
 -
 V4L2 display device driver
        drivers/media/video/davinci/vpbe_display.c
        drivers/media/video/davinci/vpbe_display.h

 VPBE display controller
        drivers/media/video/davinci/vpbe.c
        drivers/media/video/davinci/vpbe.h

 VPBE venc sub device driver
        drivers/media/video/davinci/vpbe_venc.c
        drivers/media/video/davinci/vpbe_venc.h
        drivers/media/video/davinci/vpbe_venc_regs.h

 VPBE osd driver
        drivers/media/video/davinci/vpbe_osd.c
        drivers/media/video/davinci/vpbe_osd.h
        drivers/media/video/davinci/vpbe_osd_regs.h

 Functional partitioning
 ---

 Consists of following (in the same order as the list under file
 partitioning):-

 1. V4L2 display driver
   Implements video2 and video3 device nodes and
   provides v4l2 device interface to manage VID0 and VID1 layers.

 2. Display controller
   Loads up venc, osd and external encoders such as ths8200. It provides
   a set of API calls to V4L2 drivers to set the output/standards
   in the venc or external sub devices. It also provides
   a device object to access the services from osd sub device
   using sub device ops. The connection of external encoders to venc LCD
   controller port is done at init time based on default output and standard
   selection or at run time when application change the output through
   V4L2 IOCTLs.

   When connetected to an external encoder, vpbe controller is also responsible
   for setting up the interface between venc and external encoders based on
   board specific settings (specified in board-xxx-evm.c). This allowes
   interfacing external encoders such as ths8200. The setup_if_config()
   is implemented for this as well as configure_venc() (part of the next patch)
   API to set timings in venc for a specific display resolution.As of this
   patch series, the interconnection and enabling ans setting of the external
   encoders is not present, and would be a part of the next patch series.

 3. Venc sub device
   Responsible for setting outputs provides through internal dacs and also
   setting timings at LCD controller port when external encoders are connected
   at the port or LCD panel timings required. When external encoder/LCD panel
   is connected, the timings for a specific standard/preset is retrieved from
   the board specific table and the values are used to set the timings in
   venc using non-standard timing mode.

   Support LCD Panel displays using the venc. For example to support a Logic
   PD display, it requires setting up the LCD controller port with a set of
   timings for the resolution supported and setting the dot clock. So we could
   add the available outputs as a board specific entry ( i.e add the LogicPD
   output name to board-xxx-evm.c). A table of timings for various LCDs
   supported cab be maintained in the board specific setup file to support
   various LCD displays.

 4. osd sub device
   Osd sub device implements all osd layer management and hardware specific
   features. In the legacy drivers (LSPxxx), the hardware specific features
   are configured through proprietary IOCTLs at the fb device interface. Since
   sub devices are going to support device nodes, application will be able
   to configure the hardware feayture directly by opening the osd sub device
   node and by calling the related IOCTL. So these proprietary IOCTLs are
   to be removed from the FB Device driver when doing up port of these drivers 
 to
   mainline kernel. The V4L2 and FB device nodes supports only IOCTLS as per
   the associated spec. The rest of the IOCTLs are to be moved to osd and
   venc sub devices.

 Current status:-

 A build tested version of vpbe controller is available.

 Following are TBDs.

 vpbe display controller
   - review and modify the handling of external encoders.
   - add support for selecting external encoder as default at probe time.

 vpbe venc sub device
   - add timings for supporting ths8200
   - add support for LogicPD LCD.

 v4l2 driver
   - A version is already developed which is to be cleaned up and unit tested

 FB drivers
   - Add support for fbdev drivers.- Ready and part of subsequent patches.

 Manjunath Hadli (6):
  davinci vpbe: V4L2 display driver for DM644X SoC
  davinci vpbe: VPBE display driver
  davinci vpbe: OSD(On Screen 

Re: [PATCH v2 5/6] davinci vpbe: platform specific additions

2010-11-27 Thread Muralidharan Karicheri
 +static int dm644x_set_if_config(enum v4l2_mbus_pixelcode pixcode)
 +{
 +       unsigned int val = 0;
 +       int ret = 0;
 +
 +       switch (pixcode) {
 +       case V4L2_MBUS_FMT_FIXED:
 +             /* Analog out.do nothing */
 +             break;
 +       case V4L2_MBUS_FMT_YUYV8_2X8:
 +               /* BT656 */
 +               val = (112);
 +               /*set VDMD in VMOD */
 +               dm644x_reg_modify(venc_vmod_reg, val, (7  12));
 +               /* Set YCCTL */
 +               dm644x_reg_modify(venc_ycctl_reg, 1, 1);
 +               break;
 +       case V4L2_MBUS_FMT_YUYV10_1X20:
 +       /* This was VPBE_DIGITAL_IF_YCC16.BT656.Replace the enum accordingly
 +       * when the right one gets into open source */
 +               val = 0  12;
 +               dm644x_reg_modify(venc_vmod_reg, val, (7  12));
 +               dm644x_reg_modify(venc_ycctl_reg, 1, 1);
 +               break;
 +       case V4L2_MBUS_FMT_SGRBG8_1X8:
 +       /* This was VPBE_DIGITAL_IF_PRGB/SRGB.Replace the enum accordingly
 +       * when the right one gets into open source */
 +               val = 2  12;
 +               dm644x_reg_modify(venc_vmod_reg, val, (7  12));
 +               break;
 +       default:
 +               ret = -EINVAL;
 +               break;
 +       }
 +       return ret;
 +}

The media bus format was added to sub device interface sometime back
to configure the media data format (8 bit, 16 bit etc) and there is
also a set of APIs to set the pad configuration (done by Laurent)
which is being reviewed. In the context of that, I believe the venc
VMOD configuration can be handled by implementing s_mbus_fmt() sub
device API at venc. Currently OSD sub device has set_layer_config()
which consists of setting the pixel format, frame format and
sub-frame(crop). I think this can be replaced by s_mbus_fmt(). So on a
board file, we could define the pad configuration which will include
the mbus code such as V4L2_MBUS_FMT_YUYV8_2X8 + addition pad
configurations such as embedded sync enabled etc. So once sub device
is selected, vpbe controller will set the pad configuration (obtained
from board file for each of the ?). The pad in this case is the link
between venc lcd port to external encoder. When S_FMT/S_CROP is called
on the video node, the controller calls s_mbus_fmt() on the osd and
venc sub device to set the mbus formats.

Since the external encoder support is a TBD, I  am okay if you
implement this after this patch series is merged to the tree.

Murali
 +
 +static u64 vpbe_display_dma_mask = DMA_BIT_MASK(32);
 +
 +static struct resource dm644x_v4l2_disp_resources[] = {
 +       {
 +               .start  = IRQ_VENCINT,
 +               .end    = IRQ_VENCINT,
 +               .flags  = IORESOURCE_IRQ,
 +       },
 +       {
 +               .start  = 0x01C72400,
 +               .end    = 0x01C72400 + 0x180,
 +               .flags  = IORESOURCE_MEM,
 +       },
 +
 +};
 +static struct platform_device vpbe_v4l2_display = {
 +       .name           = vpbe-v4l2,
 +       .id             = -1,
 +       .num_resources  = ARRAY_SIZE(dm644x_v4l2_disp_resources),
 +       .resource       = dm644x_v4l2_disp_resources,
 +       .dev = {
 +               .dma_mask               = vpbe_display_dma_mask,
 +               .coherent_dma_mask      = DMA_BIT_MASK(32),
 +       },
 +};
 +struct venc_platform_data dm644x_venc_pdata = {
 +       .venc_type = DM644X_VPBE,
 +       .setup_pinmux = dm644x_vpbe_setup_pinmux,
 +       .setup_clock = dm644x_venc_setup_clock,
 +       .setup_if_config = dm644x_set_if_config,
 +};
 +
 +static struct platform_device dm644x_venc_dev = {
 +       .name           = VPBE_VENC_SUBDEV_NAME,
 +       .id             = -1,
 +       .num_resources  = ARRAY_SIZE(dm644x_venc_resources),
 +       .resource       = dm644x_venc_resources,
 +       .dev = {
 +               .dma_mask               = dm644x_venc_dma_mask,
 +               .coherent_dma_mask      = DMA_BIT_MASK(32),
 +               .platform_data          = (void *)dm644x_venc_pdata,
 +       },
 +};
 +
 +static u64 dm644x_vpbe_dma_mask = DMA_BIT_MASK(32);
 +
 +static struct platform_device dm644x_vpbe_dev = {
 +       .name           = vpbe_controller,
 +       .id             = -1,
 +       .dev = {
 +               .dma_mask               = dm644x_vpbe_dma_mask,
 +               .coherent_dma_mask      = DMA_BIT_MASK(32),
 +       },
 +};
 +
 +void dm644x_set_vpbe_display_config(struct vpbe_display_config *cfg)
 +{
 +       dm644x_vpbe_dev.dev.platform_data = cfg;
 +}
 +
  /*--*/

  static struct map_desc dm644x_io_desc[] = {
 @@ -767,20 +977,36 @@ void __init dm644x_init(void)
        davinci_common_init(davinci_soc_info_dm644x);
  }

 +static struct platform_device *dm644x_video_devices[] __initdata = {
 +       dm644x_vpss_device,
 +       dm644x_ccdc_dev,
 +       vpfe_capture_dev,
 +       dm644x_osd_dev,
 +       dm644x_venc_dev,
 +       

Re: [PATCH v2 5/6] davinci vpbe: platform specific additions

2010-11-27 Thread Muralidharan Karicheri
Just want to add one more point. Probably it is a good idea to keep
this function in venc. Why this function has to be platform specific?

On Sat, Nov 27, 2010 at 10:22 AM, Muralidharan Karicheri
mkarich...@gmail.com wrote:
 +static int dm644x_set_if_config(enum v4l2_mbus_pixelcode pixcode)
 +{
 +       unsigned int val = 0;
 +       int ret = 0;
 +
 +       switch (pixcode) {
 +       case V4L2_MBUS_FMT_FIXED:
 +             /* Analog out.do nothing */
 +             break;
 +       case V4L2_MBUS_FMT_YUYV8_2X8:
 +               /* BT656 */
 +               val = (112);
 +               /*set VDMD in VMOD */
 +               dm644x_reg_modify(venc_vmod_reg, val, (7  12));
 +               /* Set YCCTL */
 +               dm644x_reg_modify(venc_ycctl_reg, 1, 1);
 +               break;
 +       case V4L2_MBUS_FMT_YUYV10_1X20:
 +       /* This was VPBE_DIGITAL_IF_YCC16.BT656.Replace the enum accordingly
 +       * when the right one gets into open source */
 +               val = 0  12;
 +               dm644x_reg_modify(venc_vmod_reg, val, (7  12));
 +               dm644x_reg_modify(venc_ycctl_reg, 1, 1);
 +               break;
 +       case V4L2_MBUS_FMT_SGRBG8_1X8:
 +       /* This was VPBE_DIGITAL_IF_PRGB/SRGB.Replace the enum accordingly
 +       * when the right one gets into open source */
 +               val = 2  12;
 +               dm644x_reg_modify(venc_vmod_reg, val, (7  12));
 +               break;
 +       default:
 +               ret = -EINVAL;
 +               break;
 +       }
 +       return ret;
 +}

 The media bus format was added to sub device interface sometime back
 to configure the media data format (8 bit, 16 bit etc) and there is
 also a set of APIs to set the pad configuration (done by Laurent)
 which is being reviewed. In the context of that, I believe the venc
 VMOD configuration can be handled by implementing s_mbus_fmt() sub
 device API at venc. Currently OSD sub device has set_layer_config()
 which consists of setting the pixel format, frame format and
 sub-frame(crop). I think this can be replaced by s_mbus_fmt(). So on a
 board file, we could define the pad configuration which will include
 the mbus code such as V4L2_MBUS_FMT_YUYV8_2X8 + addition pad
 configurations such as embedded sync enabled etc. So once sub device
 is selected, vpbe controller will set the pad configuration (obtained
 from board file for each of the ?). The pad in this case is the link
 between venc lcd port to external encoder. When S_FMT/S_CROP is called
 on the video node, the controller calls s_mbus_fmt() on the osd and
 venc sub device to set the mbus formats.

 Since the external encoder support is a TBD, I  am okay if you
 implement this after this patch series is merged to the tree.

 Murali
 +
 +static u64 vpbe_display_dma_mask = DMA_BIT_MASK(32);
 +
 +static struct resource dm644x_v4l2_disp_resources[] = {
 +       {
 +               .start  = IRQ_VENCINT,
 +               .end    = IRQ_VENCINT,
 +               .flags  = IORESOURCE_IRQ,
 +       },
 +       {
 +               .start  = 0x01C72400,
 +               .end    = 0x01C72400 + 0x180,
 +               .flags  = IORESOURCE_MEM,
 +       },
 +
 +};
 +static struct platform_device vpbe_v4l2_display = {
 +       .name           = vpbe-v4l2,
 +       .id             = -1,
 +       .num_resources  = ARRAY_SIZE(dm644x_v4l2_disp_resources),
 +       .resource       = dm644x_v4l2_disp_resources,
 +       .dev = {
 +               .dma_mask               = vpbe_display_dma_mask,
 +               .coherent_dma_mask      = DMA_BIT_MASK(32),
 +       },
 +};
 +struct venc_platform_data dm644x_venc_pdata = {
 +       .venc_type = DM644X_VPBE,
 +       .setup_pinmux = dm644x_vpbe_setup_pinmux,
 +       .setup_clock = dm644x_venc_setup_clock,
 +       .setup_if_config = dm644x_set_if_config,
 +};
 +
 +static struct platform_device dm644x_venc_dev = {
 +       .name           = VPBE_VENC_SUBDEV_NAME,
 +       .id             = -1,
 +       .num_resources  = ARRAY_SIZE(dm644x_venc_resources),
 +       .resource       = dm644x_venc_resources,
 +       .dev = {
 +               .dma_mask               = dm644x_venc_dma_mask,
 +               .coherent_dma_mask      = DMA_BIT_MASK(32),
 +               .platform_data          = (void *)dm644x_venc_pdata,
 +       },
 +};
 +
 +static u64 dm644x_vpbe_dma_mask = DMA_BIT_MASK(32);
 +
 +static struct platform_device dm644x_vpbe_dev = {
 +       .name           = vpbe_controller,
 +       .id             = -1,
 +       .dev = {
 +               .dma_mask               = dm644x_vpbe_dma_mask,
 +               .coherent_dma_mask      = DMA_BIT_MASK(32),
 +       },
 +};
 +
 +void dm644x_set_vpbe_display_config(struct vpbe_display_config *cfg)
 +{
 +       dm644x_vpbe_dev.dev.platform_data = cfg;
 +}
 +
  /*--*/

  static struct map_desc dm644x_io_desc[] = {
 @@ -767,20 +977,36 @@ void __init dm644x_init(void)
        davinci_common_init

Re: [PATCH 0/6] davinci vpbe: V4L2 Display driver for DM644X

2010-11-10 Thread Muralidharan Karicheri
Hans,

Is it possible to extend the sub device ops to include SoC ip sub
device specific ops? I remember I had posted this question some time
back and you had proposed to add something like this. Just want to
check if that is still valid. This would make this driver
implementation little more cleaner.

struct vpbe_osd_ops;

struct v4l2_subdev_ops {
const struct v4l2_subdev_core_ops   *core;
const struct v4l2_subdev_tuner_ops  *tuner;
const struct v4l2_subdev_audio_ops  *audio;
const struct v4l2_subdev_video_ops  *video;
const struct v4l2_subdev_vbi_ops*vbi;
const struct v4l2_subdev_ir_ops *ir;
const struct v4l2_subdev_sensor_ops *sensor;
/* SoC IP specific ops */
const struct vpbe_osd_ops  *vpbe_osd;
 };

The struct vpbe_osd_ops will be defined in the osd sub device header
file. This will allow the host/bridge driver to call osd specific
operations like standard sub dev ops.

Any comments?

On Wed, Nov 10, 2010 at 8:05 AM, Muralidharan Karicheri
mkarich...@gmail.com wrote:
 Manjunath,

 Thank you for putting up this patch together. I didn't see the 1/6 of
 this series in the mailing list. Also it appears as if the patch came
 from me. Please add my sign-off as second, you being the first.

 Murali
 On Mon, Nov 8, 2010 at 9:54 AM, Manjunath Hadli manjunath.ha...@ti.com 
 wrote:
 This driver is written for Texas Instruments's DM644X VPBE IP.
 This SoC supports 2 video planes and 2 OSD planes as part of its
 OSD (On Screen Display) block. The OSD lanes predminantly support
 RGB space and the Video planes support YUV data. Out of these 4,
 the 2 video planes are supported as part of the V4L2 driver. These
 would be enumerated as video2 and video3 dev nodes.
 The blending and video timing generator unit (VENC- for Video Encoder)
 is the unit which combines/blends the output of these 4 planes
 into a single stream and this output is given to Video input devices
 like TV and other digital LCDs. The software for VENC is designed as
 a subdevice with support for SD(NTSC and PAL) modes and 2 outputs.
 This SoC forms the iniial implementation of its later additions
 like DM355 and DM365.

 Muralidharan Karicheri (6):
  davinci vpbe: V4L2 display driver for DM644X SoC
  davinci vpbe: VPBE display driver
  davinci vpbe: OSD(On Screen Display ) block
  davinci vpbe: VENC( Video Encoder) implementation
  davinci vpbe: platform specific additions
  davinci vpbe: Build infrastructure for VPBE driver

  arch/arm/mach-davinci/board-dm644x-evm.c     |   85 +-
  arch/arm/mach-davinci/dm644x.c               |  181 ++-
  arch/arm/mach-davinci/include/mach/dm644x.h  |    4 +
  drivers/media/video/davinci/Kconfig          |   22 +
  drivers/media/video/davinci/Makefile         |    2 +
  drivers/media/video/davinci/vpbe.c           |  861 ++
  drivers/media/video/davinci/vpbe_display.c   | 2283 
 ++
  drivers/media/video/davinci/vpbe_osd.c       | 1208 ++
  drivers/media/video/davinci/vpbe_osd_regs.h  |  389 +
  drivers/media/video/davinci/vpbe_venc.c      |  617 +++
  drivers/media/video/davinci/vpbe_venc_regs.h |  189 +++
  include/media/davinci/vpbe.h                 |  187 +++
  include/media/davinci/vpbe_display.h         |  144 ++
  include/media/davinci/vpbe_osd.h             |  397 +
  include/media/davinci/vpbe_types.h           |  170 ++
  include/media/davinci/vpbe_venc.h            |   70 +
  16 files changed, 6790 insertions(+), 19 deletions(-)
  create mode 100644 drivers/media/video/davinci/vpbe.c
  create mode 100644 drivers/media/video/davinci/vpbe_display.c
  create mode 100644 drivers/media/video/davinci/vpbe_osd.c
  create mode 100644 drivers/media/video/davinci/vpbe_osd_regs.h
  create mode 100644 drivers/media/video/davinci/vpbe_venc.c
  create mode 100644 drivers/media/video/davinci/vpbe_venc_regs.h
  create mode 100644 include/media/davinci/vpbe.h
  create mode 100644 include/media/davinci/vpbe_display.h
  create mode 100644 include/media/davinci/vpbe_osd.h
  create mode 100644 include/media/davinci/vpbe_types.h
  create mode 100644 include/media/davinci/vpbe_venc.h

 --
 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




 --
 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 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 == ch

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 = bt-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 a/drivers

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

Re: [RFC/PATCH 02/10] media: Media device

2010-07-18 Thread Muralidharan Karicheri
Hi Laurent,

 +++ b/Documentation/media-framework.txt
 @@ -0,0 +1,68 @@
 +Linux kernel media framework
 +
 +
snip

I felt more details needed in this media-framework.txt for information
such as which driver call this
register() /unregister() function, details on link management etc. I
have not seen other patches yet.
If it is discussed elsewhere, please ignore this. For the first part
of the question, will the v4l2 core
calls this for video devices drivers? For other drivers such as audio,
IR etc which are related to
the video devices, how this is handled. I think such details are
required in this documentation.

 +       /* If dev == NULL, then name must be filled in by the caller */
 +       if (mdev-dev == NULL  WARN_ON(!mdev-name[0]))
 +               return 0;
 +
 +       /* Set name to driver name + device name if it is empty. */
 +       if (!mdev-name[0])
 +               snprintf(mdev-name, sizeof(mdev-name), %s %s,
 +                       mdev-dev-driver-name, dev_name(mdev-dev));
 +
 +       /* Register the device node. */
 +       mdev-devnode.fops = media_device_fops;
 +       mdev-devnode.parent = mdev-dev;
 +       strlcpy(mdev-devnode.name, mdev-name, sizeof(mdev-devnode.name));
 +       mdev-devnode.release = media_device_release;
 +       return media_devnode_register(mdev-devnode, MEDIA_TYPE_DEVICE);
 +}
 +EXPORT_SYMBOL_GPL(media_device_register);
 +
 +/**
 + * media_device_unregister - unregister a media device
 + * @mdev:      The media device
 + *
 + */
 +void media_device_unregister(struct media_device *mdev)
 +{
 +       media_devnode_unregister(mdev-devnode);
 +}
 +EXPORT_SYMBOL_GPL(media_device_unregister);
 diff --git a/include/media/media-device.h b/include/media/media-device.h
 new file mode 100644
 index 000..6c1fc4a
 --- /dev/null
 +++ b/include/media/media-device.h
 @@ -0,0 +1,53 @@
 +/*
 + *  Media device support header.
 + *
 + *  Copyright (C) 2010  Laurent Pinchart laurent.pinch...@ideasonboard.com
 + *
 + *  This program is free software; you can redistribute it and/or modify
 + *  it under the terms of the GNU General Public License as published by
 + *  the Free Software Foundation; either version 2 of the License, or
 + *  (at your option) any later version.
 + *
 + *  This program is distributed in the hope that it will be useful,
 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + *  GNU General Public License for more details.
 + *
 + *  You should have received a copy of the GNU General Public License
 + *  along with this program; if not, write to the Free Software
 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 + */
 +
 +#ifndef _MEDIA_DEVICE_H
 +#define _MEDIA_DEVICE_H
 +
 +#include linux/device.h
 +#include linux/list.h
 +
 +#include media/media-devnode.h
 +
 +/* Each instance of a media device should create the media_device struct,
 + * either stand-alone or embedded in a larger struct.
 + *
 + * It allows easy access to sub-devices (see v4l2-subdev.h) and provides
 + * basic media device-level support.
 + */
 +
 +#define MEDIA_DEVICE_NAME_SIZE (20 + 16)
 +
 +struct media_device {
 +       /* dev-driver_data points to this struct.
 +        * Note: dev might be NULL if there is no parent device
 +        * as is the case with e.g. ISA devices.
 +        */
 +       struct device *dev;
 +       struct media_devnode devnode;
 +
 +       /* unique device name, by default the driver name + bus ID */
 +       char name[MEDIA_DEVICE_NAME_SIZE];
 +};
 +
 +int __must_check media_device_register(struct media_device *mdev);
 +void media_device_unregister(struct media_device *mdev);
 +
 +#endif
 --
 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




-- 
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


[GIT FIXES FOR 2.6.36] - fixes for vpfe/vpif drivers

2010-06-12 Thread Muralidharan Karicheri
Mauro,

Please pull from ...

The following changes since commit 41c5f984b67b331064e69acc9fca5e99bf73d400:
  Mauro Carvalho Chehab (1):
Merge tag 'v2.6.35-rc2' into HEAD

are available in the git repository at:

  git://linuxtv.org/mkaricheri/vpfe-vpbe-video.git for_2.6.36

Murali Karicheri (1):
  vpif: removing VPIF config variables

Vaibhav Hiremath (1):
  vpfe_capture: Create separate Kconfig file for davinci devices

 drivers/media/video/Kconfig |   94 +--
 drivers/media/video/Makefile|2 +-
 drivers/media/video/davinci/Kconfig |   93 ++
 3 files changed, 95 insertions(+), 94 deletions(-)
 create mode 100644 drivers/media/video/davinci/Kconfig

-- 
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


[GIT FIXES FOR 2.6.35] - fixes for OMAP vout driver

2010-06-12 Thread Muralidharan Karicheri
Mauro,

Please pull from ...

The following changes since commit ed8c030bde28fc675aae7687a535436579298f06:
  Mauro Carvalho Chehab (1):
stv090x: Fix merge conflict caused by changeset f2b3c6d2

are available in the git repository at:

  git://linuxtv.org/mkaricheri/vpfe-vpbe-video.git for_2.6.35

Vaibhav Hiremath (3):
  OMAP_VOUT:Build FIX: Rebased against latest DSS2 changes
  OMAP_VOUT:FIX:Replaced dma-sg with dma-contig
  OMAP_VOUT:FIX: Module params were not working through bootargs

 drivers/media/video/omap/Kconfig |4 +-
 drivers/media/video/omap/Makefile|4 +-
 drivers/media/video/omap/omap_vout.c |   81 ++---

-- 
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


[GIT PATCHES FOR 2.6.35] - Adding OMAP2/3 V4l2 display driver

2010-04-11 Thread Muralidharan Karicheri
Hi Mauro,

Please pull from:-

The following changes since commit 184b7c85f31583632ad00c062a295b622759eef3:
  Mauro Carvalho Chehab (1):
ir-core: Fix the delete logic

are available in the git repository at:

  git://linuxtv.org/mkaricheri/vpfe-vpbe-video.git for_upstream_04_11

Vaibhav Hiremath (2):
  V4L2: Add support for OMAP2/3 V4L2 display driver on top of DSS2
  omap_vout:V4L2 Display: Changed enum return type to int

 drivers/media/video/Kconfig |2 +
 drivers/media/video/Makefile|2 +
 drivers/media/video/omap/Kconfig|   11 +
 drivers/media/video/omap/Makefile   |7 +
 drivers/media/video/omap/omap_vout.c| 2643 +++
 drivers/media/video/omap/omap_voutdef.h |  147 ++
 drivers/media/video/omap/omap_voutlib.c |  293 
 drivers/media/video/omap/omap_voutlib.h |   34 +
 8 files changed, 3139 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/omap/Kconfig
 create mode 100644 drivers/media/video/omap/Makefile
 create mode 100644 drivers/media/video/omap/omap_vout.c
 create mode 100644 drivers/media/video/omap/omap_voutdef.h
 create mode 100644 drivers/media/video/omap/omap_voutlib.c
 create mode 100644 drivers/media/video/omap/omap_voutlib.h

-- 
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


[GIT PATCHES FOR 2.6.35] - vpfe capture enhancements to support AM3517

2010-03-27 Thread Muralidharan Karicheri
Mauro,

Please pull from the following:-

The following changes since commit 975b06b6c01ba2da4d26a7ba6ea783d5f670aa7d:
  Jonathan Corbet (1):
V4L/DVB: ov7670: silence some compiler warnings

are available in the git repository at:

  git://linuxtv.org/mkaricheri/vpfe-vpbe-video.git for_upstream_03_27

Vaibhav Hiremath (7):
  V4L: dm644x_ccdc: Debug register read prints removed
  V4L: vpfe_capture: Add call back function for interrupt clear for vpfe_cfg
  V4L: dm644x_ccdc: Add 10bit BT support
  V4L: vpfe_capture: Return 0 from suspend/resume
  V4L: dm644x_ccdc: Add Suspend/Resume Support
  V4L: vpfe_capture: Add support for USERPTR mode of operation
  V4L: tvp514x: Add Powerup sequence during s_input to lock the
signal properly

 drivers/media/video/davinci/dm644x_ccdc.c  |  131 +++-
 drivers/media/video/davinci/dm644x_ccdc_regs.h |   10 ++-
 drivers/media/video/davinci/vpfe_capture.c |   78 ++-
 drivers/media/video/tvp514x.c  |   13 +++
 include/media/davinci/vpfe_capture.h   |2 +
 5 files changed, 203 insertions(+), 31 deletions(-)

--
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: [GIT FIX for 2.6.34] V4L - vpfe capture - fix for kernel crash on DM365

2010-03-27 Thread Muralidharan Karicheri
Mauro,

When I had last replied to your email, I didn't check if the patch is
actually applied to your v4l_for_linux branch of fixes.git tree. But
Today I checked and I can't find the patch merged to this tree as you
had mentioned..

So if you haven't merged it for some reason, please merge my updated patch
available at https://patchwork.kernel.org/patch/86731/

Murali

On Wed, Mar 24, 2010 at 3:50 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 Hi Murali,

 Karicheri, Muralidharan wrote:
 Please discard this patch. I have sent an updated version to the list.

 The patch were already added at the fixes tree. I can't just discard, since 
 this
 would break any other tree based on it. If the patch is so deadly broken, then
 we can add a rollback patch, making our and upstream tree dirty. Another 
 alternative
 would be to add just a diff between the two patches.

 Btw, please send me a patchwork ID when you want to refer to a patch sent
 to the mailing list, especially when there are two patches with the same name.
 Is this the one you're referring?
        X-Patchwork-Id: 86729

 Cheers,
 Mauro.
 --
 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




-- 
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


[GIT FIXES FOR 2.6.34] Fixes for vpfe capture driver

2010-03-13 Thread Muralidharan Karicheri
Mauro,

The following changes since commit 9178a7c062ff0c43e95d826419f9e9454c52ef15:
  Mauro Carvalho Chehab (1):
V4L/DVB: Fix bad whitespacing

are available in the git repository at:

  git://linuxtv.org/mkaricheri/vpfe-vpbe-video.git fixes_for_upstream

Murali Karicheri (1):
  V4L: vpfe_capture - free ccdc_lock when memory allocation fails

Vaibhav Hiremath (1):
  V4L - Makfile:Removed duplicate entry of davinci

 drivers/media/video/Makefile   |2 --
 drivers/media/video/davinci/vpfe_capture.c |5 +++--
 2 files changed, 3 insertions(+), 4 deletions(-)


-- 
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: More videobuf and streaming I/O questions

2010-02-26 Thread Muralidharan Karicheri
On Fri, Feb 26, 2010 at 7:04 AM, Mauro Carvalho Chehab
mche...@infradead.org wrote:
 Pawel Osciak wrote:
 On Tuesday 23 February 2010 08:41:49 Pawel Osciak wrote:
 On Mon, 22 Feb 2010 00:12:18 +0100
 Laurent Pinchart laurent.pinch...@ideasonboard.com wrote:
 As for the REQBUF, I've always thought it'd be nice to be able to ask the
 driver for the recommended number of buffers that should be used by
 issuing a REQBUF with count=0...
 How would the driver come up with the number of recommended buffers ?

 From the top of my head: when encoding a video stream, a codec driver could
 decide on the minimum number of input frames required (including reference
 frames, etc.).

 Or maybe I am missing something, what is your opinion on that?

 There are some cases where this feature could be useful. For example, there 
 are
 some devices used for surveillance that have one decoder connected to several
 inputs. For example, several bttv boards have one bt848 chip for each 8 
 inputs.
 Each input is connected to one camera. The minimum recommended number of 
 buffers
 is 16 (2 per each input). This is poorly documented, on some wikis for some of
 the boards with such usage.

 That's said, there's currently a few missing features for surveillance: the 
 user
 software need to manually switch from one input to another, and the video 
 buffer
 metadata doesn't indicate the input.

 The better would be to provide a way to let the driver to switch to the next 
 camera
 just after the reception of a new buffer (generally at the IRQ time), instead 
 of
 letting the userspace software to do it at the DQBUF.

This is an interesting use case and I would like to know some details
on this use case.
When you say application manually switch the input, Is it implementing
some kind of
input multiplexing during the session (open, stream on - stream off,
close) ? We have
encountered a similar use case and I was wondering how this can be implemented
in v4l2 driver. In my understanding, a v4l2 device is not allowed to
switch input while
streaming. Does it require 2 buffers per input because every frame
period, you have multiple
frames to queue from the different inputs? Usually a minimum of 3
buffers are typically
required in a SoC case to do streaming. Could you share the details if possible?

Murali
 --

 Cheers,
 Mauro
 --
 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




-- 
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


support for device node for sub devices

2010-02-26 Thread Muralidharan Karicheri
Hello Laurent,

I see that you have added support for sub device device nodes in your
media controller development tree. This is an important feature for
SoC devices since this will allow application to configure the sub
device nodes like that on VPFE/VPBE of a DMxxx device. Shouldn't we
add this feature right away perhaps in 2.6.35 so that drivers can make
use of it?
-- 
Murali Karicheri
--
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-V1 09/10] VPFE Capture: Add support for USERPTR mode of operation

2010-02-24 Thread Muralidharan Karicheri
On Wed, Feb 24, 2010 at 12:37 AM, Hiremath, Vaibhav hvaib...@ti.com wrote:

 -Original Message-
 From: Muralidharan Karicheri [mailto:mkarich...@gmail.com]
 Sent: Wednesday, February 24, 2010 4:53 AM
 To: Hiremath, Vaibhav
 Cc: linux-media@vger.kernel.org; linux-o...@vger.kernel.org;
 hverk...@xs4all.nl; Karicheri, Muralidharan
 Subject: Re: [PATCH-V1 09/10] VPFE Capture: Add support for USERPTR mode of
 operation

 Vaibhav,

 There are changes to vpfe capture on Arago tree on top of this. For
 example, vpfe_uservirt_to_phys() is removed and is replaced with
 videobuf_iolock(). So please get the latest changes to upstream.

 [Hiremath, Vaibhav] No, the Arago version doesn't support USERPTR mode at all,

Probably you are referring to the wrong tree. This code has gone
through test cycles and I prefer re-using the code as much as
possible. Check out below...

http://arago-project.org/git/people/sneha/linux-davinci-staging.git

My linux-davinci-video.git tree just track the upstream...

Murali


 1386            if (V4L2_MEMORY_USERPTR == req_buf-memory) {
 1386                 /* we don't support user ptr IO */
 1387                 v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, vpfe_reqbufs:
 1388                           USERPTR IO not supported\n);
 1389                 return  -EINVAL;
 1390         }

 And also, I have received important comment from Mauro, which expects some 
 code tobe moved to generic VideoBuf layer. I will be submitting patch for the 
 same separately.



 Thanks,
 Vaibhav

 Murali

 On Tue, Feb 23, 2010 at 3:34 AM,  hvaib...@ti.com wrote:
  From: Vaibhav Hiremath hvaib...@ti.com
 
 
  Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
  Signed-off-by: Muralidharan Karicheri m-kariche...@ti.com
  ---
   drivers/media/video/ti-media/vpfe_capture.c |   94
 ++
   1 files changed, 79 insertions(+), 15 deletions(-)
 
  diff --git a/drivers/media/video/ti-media/vpfe_capture.c
 b/drivers/media/video/ti-media/vpfe_capture.c
  index cece265..7d4ab44 100644
  --- a/drivers/media/video/ti-media/vpfe_capture.c
  +++ b/drivers/media/video/ti-media/vpfe_capture.c
  @@ -538,7 +538,24 @@ static void vpfe_schedule_next_buffer(struct
 vpfe_device *vpfe_dev)
                                         struct videobuf_buffer, queue);
         list_del(vpfe_dev-next_frm-queue);
         vpfe_dev-next_frm-state = VIDEOBUF_ACTIVE;
  -       addr = videobuf_to_dma_contig(vpfe_dev-next_frm);
  +       if (V4L2_MEMORY_USERPTR == vpfe_dev-memory)
  +               addr = vpfe_dev-cur_frm-boff;
  +       else
  +               addr = videobuf_to_dma_contig(vpfe_dev-next_frm);
  +
  +       ccdc_dev-hw_ops.setfbaddr(addr);
  +}
  +
  +static void vpfe_schedule_bottom_field(struct vpfe_device *vpfe_dev)
  +{
  +       unsigned long addr;
  +
  +       if (V4L2_MEMORY_USERPTR == vpfe_dev-memory)
  +               addr = vpfe_dev-cur_frm-boff;
  +       else
  +               addr = videobuf_to_dma_contig(vpfe_dev-cur_frm);
  +
  +       addr += vpfe_dev-field_off;
         ccdc_dev-hw_ops.setfbaddr(addr);
   }
 
  @@ -559,7 +576,6 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
   {
         struct vpfe_device *vpfe_dev = dev_id;
         enum v4l2_field field;
  -       unsigned long addr;
         int fid;
 
         v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, \nStarting
 vpfe_isr...\n);
  @@ -604,10 +620,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
                          * the CCDC memory address
                          */
                         if (field == V4L2_FIELD_SEQ_TB) {
  -                               addr =
  -                                 videobuf_to_dma_contig(vpfe_dev-
 cur_frm);
  -                               addr += vpfe_dev-field_off;
  -                               ccdc_dev-hw_ops.setfbaddr(addr);
  +                               vpfe_schedule_bottom_field(vpfe_dev);
                         }
                         goto clear_intr;
                 }
  @@ -1234,7 +1247,10 @@ static int vpfe_videobuf_setup(struct
 videobuf_queue *vq,
         struct vpfe_device *vpfe_dev = fh-vpfe_dev;
 
         v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, vpfe_buffer_setup\n);
  -       *size = config_params.device_bufsize;
  +       *size = vpfe_dev-fmt.fmt.pix.sizeimage;
  +       if (vpfe_dev-memory == V4L2_MEMORY_MMAP 
  +               vpfe_dev-fmt.fmt.pix.sizeimage 
 config_params.device_bufsize)
  +               *size = config_params.device_bufsize;
 
         if (*count  config_params.min_numbuffers)
                 *count = config_params.min_numbuffers;
  @@ -1243,6 +1259,46 @@ static int vpfe_videobuf_setup(struct
 videobuf_queue *vq,
         return 0;
   }
 
  +/*
  + * vpfe_uservirt_to_phys: This function is used to convert user
  + * space virtual address to physical address.
  + */
  +static u32 vpfe_uservirt_to_phys(struct vpfe_device *vpfe_dev, u32 virtp)
  +{
  +       struct mm_struct *mm = current-mm;
  +       unsigned long physp = 0

Re: [PATCH-V1 09/10] VPFE Capture: Add support for USERPTR mode of operation

2010-02-23 Thread Muralidharan Karicheri
Vaibhav,

There are changes to vpfe capture on Arago tree on top of this. For
example, vpfe_uservirt_to_phys() is removed and is replaced with
videobuf_iolock(). So please get the latest changes to upstream.

Murali

On Tue, Feb 23, 2010 at 3:34 AM,  hvaib...@ti.com wrote:
 From: Vaibhav Hiremath hvaib...@ti.com


 Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
 Signed-off-by: Muralidharan Karicheri m-kariche...@ti.com
 ---
  drivers/media/video/ti-media/vpfe_capture.c |   94 ++
  1 files changed, 79 insertions(+), 15 deletions(-)

 diff --git a/drivers/media/video/ti-media/vpfe_capture.c 
 b/drivers/media/video/ti-media/vpfe_capture.c
 index cece265..7d4ab44 100644
 --- a/drivers/media/video/ti-media/vpfe_capture.c
 +++ b/drivers/media/video/ti-media/vpfe_capture.c
 @@ -538,7 +538,24 @@ static void vpfe_schedule_next_buffer(struct vpfe_device 
 *vpfe_dev)
                                        struct videobuf_buffer, queue);
        list_del(vpfe_dev-next_frm-queue);
        vpfe_dev-next_frm-state = VIDEOBUF_ACTIVE;
 -       addr = videobuf_to_dma_contig(vpfe_dev-next_frm);
 +       if (V4L2_MEMORY_USERPTR == vpfe_dev-memory)
 +               addr = vpfe_dev-cur_frm-boff;
 +       else
 +               addr = videobuf_to_dma_contig(vpfe_dev-next_frm);
 +
 +       ccdc_dev-hw_ops.setfbaddr(addr);
 +}
 +
 +static void vpfe_schedule_bottom_field(struct vpfe_device *vpfe_dev)
 +{
 +       unsigned long addr;
 +
 +       if (V4L2_MEMORY_USERPTR == vpfe_dev-memory)
 +               addr = vpfe_dev-cur_frm-boff;
 +       else
 +               addr = videobuf_to_dma_contig(vpfe_dev-cur_frm);
 +
 +       addr += vpfe_dev-field_off;
        ccdc_dev-hw_ops.setfbaddr(addr);
  }

 @@ -559,7 +576,6 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
  {
        struct vpfe_device *vpfe_dev = dev_id;
        enum v4l2_field field;
 -       unsigned long addr;
        int fid;

        v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, \nStarting vpfe_isr...\n);
 @@ -604,10 +620,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
                         * the CCDC memory address
                         */
                        if (field == V4L2_FIELD_SEQ_TB) {
 -                               addr =
 -                                 videobuf_to_dma_contig(vpfe_dev-cur_frm);
 -                               addr += vpfe_dev-field_off;
 -                               ccdc_dev-hw_ops.setfbaddr(addr);
 +                               vpfe_schedule_bottom_field(vpfe_dev);
                        }
                        goto clear_intr;
                }
 @@ -1234,7 +1247,10 @@ static int vpfe_videobuf_setup(struct videobuf_queue 
 *vq,
        struct vpfe_device *vpfe_dev = fh-vpfe_dev;

        v4l2_dbg(1, debug, vpfe_dev-v4l2_dev, vpfe_buffer_setup\n);
 -       *size = config_params.device_bufsize;
 +       *size = vpfe_dev-fmt.fmt.pix.sizeimage;
 +       if (vpfe_dev-memory == V4L2_MEMORY_MMAP 
 +               vpfe_dev-fmt.fmt.pix.sizeimage  
 config_params.device_bufsize)
 +               *size = config_params.device_bufsize;

        if (*count  config_params.min_numbuffers)
                *count = config_params.min_numbuffers;
 @@ -1243,6 +1259,46 @@ static int vpfe_videobuf_setup(struct videobuf_queue 
 *vq,
        return 0;
  }

 +/*
 + * vpfe_uservirt_to_phys: This function is used to convert user
 + * space virtual address to physical address.
 + */
 +static u32 vpfe_uservirt_to_phys(struct vpfe_device *vpfe_dev, u32 virtp)
 +{
 +       struct mm_struct *mm = current-mm;
 +       unsigned long physp = 0;
 +       struct vm_area_struct *vma;
 +
 +       vma = find_vma(mm, virtp);
 +
 +       /* For kernel direct-mapped memory, take the easy way */
 +       if (virtp = PAGE_OFFSET)
 +               physp = virt_to_phys((void *)virtp);
 +       else if (vma  (vma-vm_flags  VM_IO)  (vma-vm_pgoff))
 +               /* this will catch, kernel-allocated, mmaped-to-usermode addr 
 */
 +               physp = (vma-vm_pgoff  PAGE_SHIFT) + (virtp - 
 vma-vm_start);
 +       else {
 +               /* otherwise, use get_user_pages() for general userland pages 
 */
 +               int res, nr_pages = 1;
 +               struct page *pages;
 +               down_read(current-mm-mmap_sem);
 +
 +               res = get_user_pages(current, current-mm,
 +                                    virtp, nr_pages, 1, 0, pages, NULL);
 +               up_read(current-mm-mmap_sem);
 +
 +               if (res == nr_pages)
 +                       physp = __pa(page_address(pages[0]) +
 +                                    (virtp  ~PAGE_MASK));
 +               else {
 +                       v4l2_dbg(1, debug, vpfe_dev-v4l2_dev,
 +                               get_user_pages failed\n);
 +                       return 0;
 +               }
 +       }
 +       return physp;
 +}
 +
  static int vpfe_videobuf_prepare(struct videobuf_queue *vq,
                                struct videobuf_buffer *vb

Re: [PATCH 3/9] tvp514x: add YUYV format support

2010-02-23 Thread Muralidharan Karicheri
Vaibhav,


On Mon, Jan 4, 2010 at 9:02 AM,  hvaib...@ti.com wrote:
 From: Vaibhav Hiremath hvaib...@ti.com


 Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
 ---
  drivers/media/video/tvp514x.c |    7 +++
  1 files changed, 7 insertions(+), 0 deletions(-)

 diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c
 index 4cf3593..b344b58 100644
 --- a/drivers/media/video/tvp514x.c
 +++ b/drivers/media/video/tvp514x.c
 @@ -212,6 +212,13 @@ static const struct v4l2_fmtdesc tvp514x_fmt_list[] = {
         .description = 8-bit UYVY 4:2:2 Format,
         .pixelformat = V4L2_PIX_FMT_UYVY,
        },
 +       {
 +        .index = 1,
 +        .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
 +        .flags = 0,
 +        .description = 8-bit YUYV 4:2:2 Format,
 +        .pixelformat = V4L2_PIX_FMT_YUYV,
 +       },
  };

As per data sheet I can see only CbYCrY format output from the tvp5146
which translate to UYVY. How are you configuring tvp to output YUYV? I
don;t see any change to the code to configure this format.

CCDC can switch the CbCr order and also can swap Y/C order. So if you
are achieving
this via ccdc configuration, there is no need to add this format to tvp5146 IMO.

-Murali


  /**
 --
 1.6.2.4

 --
 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




-- 
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


[GIT PATCHES FOR 2.6.34] - vpfe capture support on DM365

2010-02-21 Thread Muralidharan Karicheri
Mauro,

I have removed the IOCTL handling and also dropped a patch that is
related to ioctl handling relative to last pull request. This is based
on our discussion since then.

The following changes since commit d142708594fd5a0828371b31721a8289800d015a:
  Mauro Carvalho Chehab (1):
V4L/DVB: tuner-xc2028: Fix demod breakage for XC3028L

are available in the git repository at:

  git://linuxtv.org/mkaricheri/vpfe-vpbe-video.git for_upstream_02_21

Murali Karicheri (5):
  DaVinci - Adding platform  board changes for vpfe capture on DM365
  V4L - vpfe capture - header files for ISIF driver
  V4L - vpfe capture - source for ISIF driver on DM365
  V4L - vpfe capture - vpss driver enhancements for DM365
  V4L - vpfe capture - build environment for isif driver

 arch/arm/mach-davinci/board-dm365-evm.c|   71 ++
 arch/arm/mach-davinci/dm365.c  |  102 +++-
 arch/arm/mach-davinci/include/mach/dm365.h |2 +
 drivers/media/video/Kconfig|   14 +-
 drivers/media/video/davinci/Makefile   |1 +
 drivers/media/video/davinci/isif.c | 1172 
 drivers/media/video/davinci/isif_regs.h|  269 +++
 drivers/media/video/davinci/vpss.c |  289 ++--
 include/media/davinci/isif.h   |  531 +
 include/media/davinci/vpss.h   |   41 +-
 10 files changed, 2435 insertions(+), 57 deletions(-)
 create mode 100644 drivers/media/video/davinci/isif.c
 create mode 100644 drivers/media/video/davinci/isif_regs.h
 create mode 100644 include/media/davinci/isif.h

-- 
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


[GIT PATCHES FOR 2.6.34] Support for vpfe-capture on DM365

2010-02-05 Thread Muralidharan Karicheri
Mauro,

Please pull from the following:-

The following changes since commit 84b74782ace1ae091c1b0e14ae2ee9bb720532ba:
  Douglas Schilling Landgraf (1):
V4L/DVB: Fix logic for Leadtek winfast tv usbii deluxe

are available in the git repository at:

  git://linuxtv.org/mkaricheri/vpfe-vpbe-video.git for_upstream

Murali Karicheri (6):
  DaVinci - Adding platform  board changes for vpfe capture on DM365
  V4L - vpfe capture - header files for ISIF driver
  V4L - vpfe capture - source for ISIF driver on DM365
  V4L - vpfe capture - vpss driver enhancements for DM365
  V4L - vpfe_capture - bug fixes and enhancements
  V4L - vpfe capture - build environment for isif driver

 arch/arm/mach-davinci/board-dm365-evm.c|   71 ++
 arch/arm/mach-davinci/dm365.c  |  102 ++-
 arch/arm/mach-davinci/include/mach/dm365.h |2 +
 drivers/media/video/Kconfig|   14 +-
 drivers/media/video/davinci/Makefile   |1 +
 drivers/media/video/davinci/isif.c | 1513 
 drivers/media/video/davinci/isif_regs.h|  269 +
 drivers/media/video/davinci/vpfe_capture.c |  118 ++-
 drivers/media/video/davinci/vpss.c |  289 +-
 include/media/davinci/isif.h   |  531 ++
 include/media/davinci/vpfe_capture.h   |   11 +-
 include/media/davinci/vpss.h   |   41 +-
 12 files changed, 2853 insertions(+), 109 deletions(-)
 create mode 100644 drivers/media/video/davinci/isif.c
 create mode 100644 drivers/media/video/davinci/isif_regs.h
 create mode 100644 include/media/davinci/isif.h


--
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


test - please ignore

2010-02-05 Thread Muralidharan Karicheri
-- 
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: [GIT PATCHES FOR 2.6.34] Support for vpfe-capture on DM365

2010-02-05 Thread Muralidharan Karicheri
Mauro,


On Fri, Feb 5, 2010 at 4:52 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 Muralidharan Karicheri wrote:
 Mauro,

 Please pull from the following:-

 The following changes since commit 84b74782ace1ae091c1b0e14ae2ee9bb720532ba:
   Douglas Schilling Landgraf (1):
         V4L/DVB: Fix logic for Leadtek winfast tv usbii deluxe

 are available in the git repository at:

   git://linuxtv.org/mkaricheri/vpfe-vpbe-video.git for_upstream

 Murali Karicheri (6):
       DaVinci - Adding platform  board changes for vpfe capture on DM365
       V4L - vpfe capture - header files for ISIF driver
       V4L - vpfe capture - source for ISIF driver on DM365

 Hmm...
 +static int isif_get_params(void __user *params)
 +{
 +       /* only raw module parameters can be set through the IOCTL */
 +       if (isif_cfg.if_type != VPFE_RAW_BAYER)
 +               return -EINVAL;
 +
 +       if (copy_to_user(params,
 +                       isif_cfg.bayer.config_params,
 +                       sizeof(isif_cfg.bayer.config_params))) {

 +/* Parameter operations */
 +static int isif_set_params(void __user *params)
 +{
 +       struct isif_config_params_raw *isif_raw_params;
 +       int ret = -EINVAL;
 +
 +       /* only raw module parameters can be set through the IOCTL */
 +       if (isif_cfg.if_type != VPFE_RAW_BAYER)
 +               return ret;
 +
 +       isif_raw_params = kzalloc(sizeof(*isif_raw_params), GFP_KERNEL);
 +       if (NULL == isif_raw_params)
 +               return -ENOMEM;
 +
 +       ret = copy_from_user(isif_raw_params,


 It seems that you're defining some undocumented new userspace API here.

Yes. This supports an experimental, but necessary API that configures
the ISIF (Image sensor Interface) image tuning parameters from
User Space. These parameters are used when converting Bayer RGB image
to UYVY format when capturing from sensors such as MT9T031.
For SoCs like TI's DMxxx series, the user needs to have full control
over these parameters to get desired image quality.
This had been discussed during the initial version of vpfe-capture
driver discussion and it was decided to keep them as experimental. So
no
documentation is provided at this time. The ioctls are defined in the
vpfe_capture.h header file and the user space structures are under
ccdc.h and isif.h under include/media/davinci and are marked as
experimental.  This was also discussed  in this mailing list before
and the decision taken at that time was to do it properly as part of
media soc framework. In this framework, isif and other similar SoC
hardware IPs will have a device node to configure these parameters
and therefore will have to be re-worked once media soc framework is
available.  Until then vpfe-capture users need to have a way to
configure the ISIF or such hardware IPs.

Regards,

Murali
 Cheers,
 Mauro




-- 
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: building v4l-dvb - compilation error

2010-01-10 Thread Muralidharan Karicheri
Mauro,

I ran the build using my ubunto linux box at home and it has succeeded
the build.

 make[2]: Leaving directory `/usr/src/kernels/2.6.9-55.0.12.EL-smp-i686'

 The minimum supported version by the backport is 2.6.16.
Hmm. Does that means, the build is using the kernel source code
natively available at /usr/src/kernel. Is there a way to force it use
a specific kernel source code?

-- 
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


Test email. Please ignore

2009-12-30 Thread Muralidharan Karicheri
--
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