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  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 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
 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 = (1<<12);
>> +               /*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),
>> +         

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
 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 = (1<<12);
>> +               /*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),
>> +         

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 = (1<<12);
> +               /*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

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 = (1<<12);
> +               /*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

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

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

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

2010-11-10 Thread Muralidharan Karicheri
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  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
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


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

2010-11-10 Thread Muralidharan Karicheri
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  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
--
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


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

On Fri, Oct 22, 2010 at 3:00 AM,  wrote:
>
> From: Mats Randgaard 
>
> - 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 
> Signed-off-by: Hans Verkuil 
> ---
>  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",
> +               .wi

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

2010-10-24 Thread Muralidharan Karicheri
-- Forwarded message --
From: Muralidharan Karicheri 
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 

On Fri, Oct 22, 2010 at 3:00 AM,  wrote:
>
> From: Mats Randgaard 
>
> Signed-off-by: Mats Randgaard 
> Signed-off-by: Hans Verkuil 
> ---
>  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)
&

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

2010-10-24 Thread Muralidharan Karicheri
-- Forwarded message --
From: Muralidharan Karicheri 
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,  wrote:
>
> From: Mats Randgaard 
>
> Added functions to set and get custom DV timings.
>
> Signed-off-by: Mats Randgaard 
> Signed-off-by: Hans Verkuil 
> ---
>  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);
> + 

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

2010-10-24 Thread Muralidharan Karicheri
-- Forwarded message --
From: Muralidharan Karicheri 
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,  wrote:
>
> From: Mats Randgaard 
>
> Added functions to set/get/query/enum DV presets.
>
> Signed-off-by: Mats Randgaard 
> Signed-off-by: Hans Verkuil 
> ---
>  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

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
 wrote:
> Acked-by : Murali Karicheri 
>
> On Fri, Oct 22, 2010 at 3:00 AM,  wrote:
>>
>> From: Mats Randgaard 
>>
>> - 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 
>> Signed-off-by: Hans Verkuil 
>> ---
>>  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,
>> +               

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
 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 
>>  #include 
>>  #include 
>> +#include 
>>
>>  #include 
>>
>> @@ -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
>>

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
 wrote:
>
> On Fri, Oct 22, 2010 at 3:00 AM,  wrote:
>>
>> From: Mats Randgaard 
>>
>> 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 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
> +
> +


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 
> + *
> + *  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 
> +#include 
> +
> +#include 
> +
> +/* 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.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 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
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[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
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


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


Re: [PATCH 1/2] OMAP2/3 V4L2: Add support for OMAP2/3 V4L2 driver on top of DSS2

2010-04-02 Thread Muralidharan Karicheri
Vaibhav,

I have some comments on this patch. Please address them.

> +
> +#include 

Add a line here??

> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "omap_voutlib.h"
> +#include "omap_voutdef.h"
> +
> +MODULE_AUTHOR("Texas Instruments");
> +MODULE_DESCRIPTION("OMAP Video for Linux Video out driver");
> +MODULE_LICENSE("GPL");
> +
> +
> +/* Driver Configuration macros */
> +#define VOUT_NAME              "omap_vout"
> +
> +enum omap_vout_channels {
> +       OMAP_VIDEO1 = 0,
Why do we have to initialize this to 0. It always start with a value 0
by default.

> +       OMAP_VIDEO2,
> +};
> +
> +enum dma_channel_state {
> +       DMA_CHAN_NOT_ALLOTED = 0,

Ditto.

> +       DMA_CHAN_ALLOTED,
> +};
> +
> +#define QQVGA_WIDTH            160
> +#define QQVGA_HEIGHT           120
> +
> +/* Max Resolution supported by the driver */
> +#define VID_MAX_WIDTH          1280    /* Largest width */
> +#define VID_MAX_HEIGHT         720     /* Largest height */
> +

-

> +
> +module_param(debug, bool, S_IRUGO);
> +MODULE_PARM_DESC(debug, "Debug level (0-1)");
> +
> +/* Local Helper functions */
> +static void omap_vout_isr(void *arg, unsigned int irqstatus);
> +static void omap_vout_cleanup_device(struct omap_vout_device *vout);
> +

Is there a reason why you need these prototypes? I think we could
remove these prototypes and move the function ahead in the file before
it is called.

> +/* list of image formats supported by OMAP2 video pipelines */
> +const static struct v4l2_fmtdesc omap_formats[] = {
> +       {
> +               /* Note:  V4L2 defines RGB565 as:
> +                *
> +                *      Byte 0                    Byte 1
> +                *      g2 g1 g0 r4 r3 r2 r1 r0   b4 b3 b2 b1 b0 g5 g4 g3
> +                *
> +                * We interpret RGB565 as:
> +                *
> +                *      Byte 0                    Byte 1
> +                *      g2 g1 g0 b4 b3 b2 b1 b0   r4 r3 r2 r1 r0 g5 g4 g3
> +                */
> +               .description = "RGB565, le",
> +               .pixelformat = V4L2_PIX_FMT_RGB565,
> +       },
> +       {
> +               /* Note:  V4L2 defines RGB32 as: RGB-8-8-8-8  we use
> +                *  this for RGB24 unpack mode, the last 8 bits are ignored
> +                * */
> +               .description = "RGB32, le",
> +               .pixelformat = V4L2_PIX_FMT_RGB32,
> +       },
> +       {
> +               /* Note:  V4L2 defines RGB24 as: RGB-8-8-8  we use
> +                *        this for RGB24 packed mode
> +                *
> +                */
> +               .description = "RGB24, le",
> +               .pixelformat = V4L2_PIX_FMT_RGB24,
> +       },
> +       {
> +               .description = "YUYV (YUV 4:2:2), packed",
> +               .pixelformat = V4L2_PIX_FMT_YUYV,
> +       },
> +       {
> +               .description = "UYVY, packed",
> +               .pixelformat = V4L2_PIX_FMT_UYVY,
> +       },
> +};
> +
> +#define NUM_OUTPUT_FORMATS (ARRAY_SIZE(omap_formats))
> +
> +/*
> + * Allocate buffers
> + */

--

> +
> +/*
> + * omap_vout_uservirt_to_phys: This inline function is used to convert user
> + * space virtual address to physical address.
> + */
> +static u32 omap_vout_uservirt_to_phys(u32 virtp)
> +{
> +       unsigned long physp = 0;
> +       struct vm_area_struct *vma;
> +       struct mm_struct *mm = current->mm;
> +
> +       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 addresses */
> +               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(¤t->mm->mmap_sem);
> +
> +               res = get_user_pages(current, current->mm, virtp, nr_pages,
> +                               1, 0, &pages, NULL);
> +               up_read(¤t->mm->mmap_sem);
> +
> +               if (res == nr_pages) {
> +                       physp =  __pa(page_address(&pages[0]) +
> +                                       (virtp & ~PAGE_MASK));
> +               } else {
> +                       printk(KERN_WARNING VOUT_NAME
> +                                       "get_user_pages failed\n");
> +                       return 0;
> +               }
> +       }
> +
> +       return physp;
> +}

Shouldn't we remove omap_vout_uservirt_to_phys() and use videobuf_iolock()
instead as we have done in vpfe_capture.c?

-


> +
> +/*
> + * Convert

Re: [PATCH 1/2] OMAP2/3 V4L2: Add support for OMAP2/3 V4L2 driver on top of DSS2

2010-04-02 Thread Muralidharan Karicheri
Vaibhav,

I have some comments on this patch. Please address them.

> +
> +#include 

Add a line here??

> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "omap_voutlib.h"
> +#include "omap_voutdef.h"
> +
> +MODULE_AUTHOR("Texas Instruments");
> +MODULE_DESCRIPTION("OMAP Video for Linux Video out driver");
> +MODULE_LICENSE("GPL");
> +
> +
> +/* Driver Configuration macros */
> +#define VOUT_NAME              "omap_vout"
> +
> +enum omap_vout_channels {
> +       OMAP_VIDEO1 = 0,
Why do we have to initialize this to 0. It always start with a value 0
by default.

> +       OMAP_VIDEO2,
> +};
> +
> +enum dma_channel_state {
> +       DMA_CHAN_NOT_ALLOTED = 0,

Ditto.

> +       DMA_CHAN_ALLOTED,
> +};
> +
> +#define QQVGA_WIDTH            160
> +#define QQVGA_HEIGHT           120
> +
> +/* Max Resolution supported by the driver */
> +#define VID_MAX_WIDTH          1280    /* Largest width */
> +#define VID_MAX_HEIGHT         720     /* Largest height */
> +

-

> +
> +module_param(debug, bool, S_IRUGO);
> +MODULE_PARM_DESC(debug, "Debug level (0-1)");
> +
> +/* Local Helper functions */
> +static void omap_vout_isr(void *arg, unsigned int irqstatus);
> +static void omap_vout_cleanup_device(struct omap_vout_device *vout);
> +

Is there a reason why you need these prototypes? I think we could
remove these prototypes and move the function ahead in the file before
it is called.

> +/* list of image formats supported by OMAP2 video pipelines */
> +const static struct v4l2_fmtdesc omap_formats[] = {
> +       {
> +               /* Note:  V4L2 defines RGB565 as:
> +                *
> +                *      Byte 0                    Byte 1
> +                *      g2 g1 g0 r4 r3 r2 r1 r0   b4 b3 b2 b1 b0 g5 g4 g3
> +                *
> +                * We interpret RGB565 as:
> +                *
> +                *      Byte 0                    Byte 1
> +                *      g2 g1 g0 b4 b3 b2 b1 b0   r4 r3 r2 r1 r0 g5 g4 g3
> +                */
> +               .description = "RGB565, le",
> +               .pixelformat = V4L2_PIX_FMT_RGB565,
> +       },
> +       {
> +               /* Note:  V4L2 defines RGB32 as: RGB-8-8-8-8  we use
> +                *  this for RGB24 unpack mode, the last 8 bits are ignored
> +                * */
> +               .description = "RGB32, le",
> +               .pixelformat = V4L2_PIX_FMT_RGB32,
> +       },
> +       {
> +               /* Note:  V4L2 defines RGB24 as: RGB-8-8-8  we use
> +                *        this for RGB24 packed mode
> +                *
> +                */
> +               .description = "RGB24, le",
> +               .pixelformat = V4L2_PIX_FMT_RGB24,
> +       },
> +       {
> +               .description = "YUYV (YUV 4:2:2), packed",
> +               .pixelformat = V4L2_PIX_FMT_YUYV,
> +       },
> +       {
> +               .description = "UYVY, packed",
> +               .pixelformat = V4L2_PIX_FMT_UYVY,
> +       },
> +};
> +
> +#define NUM_OUTPUT_FORMATS (ARRAY_SIZE(omap_formats))
> +
> +/*
> + * Allocate buffers
> + */

--

> +
> +/*
> + * omap_vout_uservirt_to_phys: This inline function is used to convert user
> + * space virtual address to physical address.
> + */
> +static u32 omap_vout_uservirt_to_phys(u32 virtp)
> +{
> +       unsigned long physp = 0;
> +       struct vm_area_struct *vma;
> +       struct mm_struct *mm = current->mm;
> +
> +       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 addresses */
> +               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(¤t->mm->mmap_sem);
> +
> +               res = get_user_pages(current, current->mm, virtp, nr_pages,
> +                               1, 0, &pages, NULL);
> +               up_read(¤t->mm->mmap_sem);
> +
> +               if (res == nr_pages) {
> +                       physp =  __pa(page_address(&pages[0]) +
> +                                       (virtp & ~PAGE_MASK));
> +               } else {
> +                       printk(KERN_WARNING VOUT_NAME
> +                                       "get_user_pages failed\n");
> +                       return 0;
> +               }
> +       }
> +
> +       return physp;
> +}

Shouldn't we remove omap_vout_uservirt_to_phys() and use videobuf_iolock()
instead as we have done in vpfe_capture.c?

-


> +
> +/*
> + * Convert

Re: [GIT FIX for 2.6.34] V4L - vpfe capture - fix for kernel crash on DM365

2010-03-29 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
 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
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


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


[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


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


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  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,   wrote:
>> > From: Vaibhav Hiremath 
>> >
>> >
>> > Signed-off-by: Vaibhav Hiremath 
>> > Signed-off-by: Muralidharan Karicheri 
>> > ---
>> >  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;
>>

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  wrote:
>
>> -Original Message-
>> From: Muralidharan Karicheri [mailto:mkarich...@gmail.com]
>> Sent: Wednesday, February 24, 2010 4:53 AM
>> To: Hiremath, Vaibhav
>> Cc: linux-me...@vger.kernel.org; linux-omap@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,   wrote:
>> > From: Vaibhav Hiremath 
>> >
>> >
>> > Signed-off-by: Vaibhav Hiremath 
>> > Signed-off-by: Muralidharan Karicheri 
>> > ---
>> >  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;
>>

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,   wrote:
> From: Vaibhav Hiremath 
>
>
> Signed-off-by: Vaibhav Hiremath 
> ---
>  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


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,   wrote:
> From: Vaibhav Hiremath 
>
>
> Signed-off-by: Vaibhav Hiremath 
> ---
>  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-omap" 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-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,   wrote:
> From: Vaibhav Hiremath 
>
>
> Signed-off-by: Vaibhav Hiremath 
> Signed-off-by: Muralidharan Karicheri 
> ---
>  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(¤t->mm->mmap_sem);
> +
> +               res = get_user_pages(current, current->mm,
> +                                    virtp, nr_pages, 1,

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,   wrote:
> From: Vaibhav Hiremath 
>
>
> Signed-off-by: Vaibhav Hiremath 
> Signed-off-by: Muralidharan Karicheri 
> ---
>  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(¤t->mm->mmap_sem);
> +
> +               res = get_user_pages(current, current->mm,
> +                                    virtp, nr_pages, 1,

[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


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


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


[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


[linuxtv-commits] [hg:v4l-dvb] vpfe-capture - converting dm355 ccdc driver to a platform driver

2010-01-25 Thread Patch from Muralidharan Karicheri
The patch number 14053 was added via Douglas Schilling Landgraf 

to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
vpfe-capture - converting dm355 ccdc driver to a platform driver


1) clocks are configured using generic clock names;
2) converts the driver to a platform driver;
3) cleanup - consolidate all static variables inside a structure, ccdc_cfg;

The ccdc now uses a generic name for clocks. "master" and "slave". On 
individual platforms
these clocks will inherit from the platform specific clock. This will allow 
re-use of
the driver for the same IP across different SoCs.

Updated based on Kevin's comments on clock configuration and error code (v3, 
v4).

Priority: normal

Reviewed-by: Kevin Hilman 
Reviewed-by: Vaibhav Hiremath 
Reviewed-by: Hans Verkuil 
Signed-off-by: Hans Verkuil 
Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Mauro Carvalho Chehab 
Signed-off-by: Douglas Schilling Landgraf 


---

 linux/drivers/media/video/davinci/dm355_ccdc.c |  412 ++---
 1 file changed, 258 insertions(+), 154 deletions(-)

diff -r b243d500be35 -r 875b7a109e47 
linux/drivers/media/video/davinci/dm355_ccdc.c
--- a/linux/drivers/media/video/davinci/dm355_ccdc.cMon Jan 25 11:50:15 
2010 -0200
+++ b/linux/drivers/media/video/davinci/dm355_ccdc.cMon Jan 25 11:52:10 
2010 -0200
@@ -37,8 +37,12 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+
 #include 
 #include 
+
 #include "dm355_ccdc_regs.h"
 #include "ccdc_hw_device.h"
 
@@ -46,67 +50,75 @@
 MODULE_DESCRIPTION("CCDC Driver for DM355");
 MODULE_AUTHOR("Texas Instruments");
 
-static struct device *dev;
-
-/* Object for CCDC raw mode */
-static struct ccdc_params_raw ccdc_hw_params_raw = {
-   .pix_fmt = CCDC_PIXFMT_RAW,
-   .frm_fmt = CCDC_FRMFMT_PROGRESSIVE,
-   .win = CCDC_WIN_VGA,
-   .fid_pol = VPFE_PINPOL_POSITIVE,
-   .vd_pol = VPFE_PINPOL_POSITIVE,
-   .hd_pol = VPFE_PINPOL_POSITIVE,
-   .gain = {
-   .r_ye = 256,
-   .gb_g = 256,
-   .gr_cy = 256,
-   .b_mg = 256
+static struct ccdc_oper_config {
+   struct device *dev;
+   /* CCDC interface type */
+   enum vpfe_hw_if_type if_type;
+   /* Raw Bayer configuration */
+   struct ccdc_params_raw bayer;
+   /* YCbCr configuration */
+   struct ccdc_params_ycbcr ycbcr;
+   /* Master clock */
+   struct clk *mclk;
+   /* slave clock */
+   struct clk *sclk;
+   /* ccdc base address */
+   void __iomem *base_addr;
+} ccdc_cfg = {
+   /* Raw configurations */
+   .bayer = {
+   .pix_fmt = CCDC_PIXFMT_RAW,
+   .frm_fmt = CCDC_FRMFMT_PROGRESSIVE,
+   .win = CCDC_WIN_VGA,
+   .fid_pol = VPFE_PINPOL_POSITIVE,
+   .vd_pol = VPFE_PINPOL_POSITIVE,
+   .hd_pol = VPFE_PINPOL_POSITIVE,
+   .gain = {
+   .r_ye = 256,
+   .gb_g = 256,
+   .gr_cy = 256,
+   .b_mg = 256
+   },
+   .config_params = {
+   .datasft = 2,
+   .mfilt1 = CCDC_NO_MEDIAN_FILTER1,
+   .mfilt2 = CCDC_NO_MEDIAN_FILTER2,
+   .alaw = {
+   .gama_wd = 2,
+   },
+   .blk_clamp = {
+   .sample_pixel = 1,
+   .dc_sub = 25
+   },
+   .col_pat_field0 = {
+   .olop = CCDC_GREEN_BLUE,
+   .olep = CCDC_BLUE,
+   .elop = CCDC_RED,
+   .elep = CCDC_GREEN_RED
+   },
+   .col_pat_field1 = {
+   .olop = CCDC_GREEN_BLUE,
+   .olep = CCDC_BLUE,
+   .elop = CCDC_RED,
+   .elep = CCDC_GREEN_RED
+   },
+   },
},
-   .config_params = {
-   .datasft = 2,
-   .data_sz = CCDC_DATA_10BITS,
-   .mfilt1 = CCDC_NO_MEDIAN_FILTER1,
-   .mfilt2 = CCDC_NO_MEDIAN_FILTER2,
-   .alaw = {
-   .gama_wd = 2,
-   },
-   .blk_clamp = {
-   .sample_pixel = 1,
-   .dc_sub = 25
-   },
-   .col_pat_field0 = {
-

[linuxtv-commits] [hg:v4l-dvb] vpfe-capture: converting dm644x ccdc driver to a platform driver

2010-01-25 Thread Patch from Muralidharan Karicheri
The patch number 14054 was added via Douglas Schilling Landgraf 

to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
vpfe-capture: converting dm644x ccdc driver to a platform driver


1) clocks are configured using generic clock names
2) converting the driver to a platform driver
3) cleanup - consolidate all static variables inside a structure, ccdc_cfg

The ccdc driver now uses generic names for clocks - master and slave. On 
individual platforms
these clocks will inherit from the platform specific clock. This will allow 
re-use of
the driver for the same IP across different SoCs.

Priority: normal

Reviewed-by: Kevin Hilman 
Reviewed-by: Vaibhav Hiremath 
Reviewed-by: Hans Verkuil 
Signed-off-by: Hans Verkuil 
Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Mauro Carvalho Chehab 
Signed-off-by: Douglas Schilling Landgraf 


---

 linux/drivers/media/video/davinci/dm644x_ccdc.c |  361 +---
 1 file changed, 225 insertions(+), 136 deletions(-)

diff -r 875b7a109e47 -r 43740e95c911 
linux/drivers/media/video/davinci/dm644x_ccdc.c
--- a/linux/drivers/media/video/davinci/dm644x_ccdc.c   Mon Jan 25 11:52:10 
2010 -0200
+++ b/linux/drivers/media/video/davinci/dm644x_ccdc.c   Mon Jan 25 11:54:27 
2010 -0200
@@ -37,8 +37,12 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+
 #include 
 #include 
+
 #include "dm644x_ccdc_regs.h"
 #include "ccdc_hw_device.h"
 
@@ -46,32 +50,44 @@
 MODULE_DESCRIPTION("CCDC Driver for DM6446");
 MODULE_AUTHOR("Texas Instruments");
 
-static struct device *dev;
-
-/* Object for CCDC raw mode */
-static struct ccdc_params_raw ccdc_hw_params_raw = {
-   .pix_fmt = CCDC_PIXFMT_RAW,
-   .frm_fmt = CCDC_FRMFMT_PROGRESSIVE,
-   .win = CCDC_WIN_VGA,
-   .fid_pol = VPFE_PINPOL_POSITIVE,
-   .vd_pol = VPFE_PINPOL_POSITIVE,
-   .hd_pol = VPFE_PINPOL_POSITIVE,
-   .config_params = {
-   .data_sz = CCDC_DATA_10BITS,
+static struct ccdc_oper_config {
+   struct device *dev;
+   /* CCDC interface type */
+   enum vpfe_hw_if_type if_type;
+   /* Raw Bayer configuration */
+   struct ccdc_params_raw bayer;
+   /* YCbCr configuration */
+   struct ccdc_params_ycbcr ycbcr;
+   /* Master clock */
+   struct clk *mclk;
+   /* slave clock */
+   struct clk *sclk;
+   /* ccdc base address */
+   void __iomem *base_addr;
+} ccdc_cfg = {
+   /* Raw configurations */
+   .bayer = {
+   .pix_fmt = CCDC_PIXFMT_RAW,
+   .frm_fmt = CCDC_FRMFMT_PROGRESSIVE,
+   .win = CCDC_WIN_VGA,
+   .fid_pol = VPFE_PINPOL_POSITIVE,
+   .vd_pol = VPFE_PINPOL_POSITIVE,
+   .hd_pol = VPFE_PINPOL_POSITIVE,
+   .config_params = {
+   .data_sz = CCDC_DATA_10BITS,
+   },
},
-};
-
-/* Object for CCDC ycbcr mode */
-static struct ccdc_params_ycbcr ccdc_hw_params_ycbcr = {
-   .pix_fmt = CCDC_PIXFMT_YCBCR_8BIT,
-   .frm_fmt = CCDC_FRMFMT_INTERLACED,
-   .win = CCDC_WIN_PAL,
-   .fid_pol = VPFE_PINPOL_POSITIVE,
-   .vd_pol = VPFE_PINPOL_POSITIVE,
-   .hd_pol = VPFE_PINPOL_POSITIVE,
-   .bt656_enable = 1,
-   .pix_order = CCDC_PIXORDER_CBYCRY,
-   .buf_type = CCDC_BUFTYPE_FLD_INTERLEAVED
+   .ycbcr = {
+   .pix_fmt = CCDC_PIXFMT_YCBCR_8BIT,
+   .frm_fmt = CCDC_FRMFMT_INTERLACED,
+   .win = CCDC_WIN_PAL,
+   .fid_pol = VPFE_PINPOL_POSITIVE,
+   .vd_pol = VPFE_PINPOL_POSITIVE,
+   .hd_pol = VPFE_PINPOL_POSITIVE,
+   .bt656_enable = 1,
+   .pix_order = CCDC_PIXORDER_CBYCRY,
+   .buf_type = CCDC_BUFTYPE_FLD_INTERLEAVED
+   },
 };
 
 #define CCDC_MAX_RAW_YUV_FORMATS   2
@@ -84,25 +100,15 @@
 static u32 ccdc_raw_yuv_pix_formats[] =
{V4L2_PIX_FMT_UYVY, V4L2_PIX_FMT_YUYV};
 
-static void *__iomem ccdc_base_addr;
-static int ccdc_addr_size;
-static enum vpfe_hw_if_type ccdc_if_type;
-
 /* register access routines */
 static inline u32 regr(u32 offset)
 {
-   return __raw_readl(ccdc_base_addr + offset);
+   return __raw_readl(ccdc_cfg.base_addr + offset);
 }
 
 static inline void regw(u32 val, u32 offset)
 {
-   __raw_writel(val, ccdc_base_addr + offset);
-}
-
-static void ccdc_set_ccdc_base(void *addr, int size)
-{
-   ccdc_base_addr = addr;
-   ccdc_addr_size = size;
+   __raw_writel(val, ccdc_cfg.base_addr + offset);
 }
 
 static void ccdc_enable(int flag)
@@ -132,7 +138,7 @@
int vert_start, vert_nr_lines;
int val

[linuxtv-commits] [hg:v4l-dvb] vpfe_capture: remove clock and platform code

2010-01-25 Thread Patch from Muralidharan Karicheri
The patch number 14052 was added via Douglas Schilling Landgraf 

to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
vpfe_capture: remove clock and platform code


1) removed the platform code and clk configuration. They are now
   part of ccdc driver (part of the ccdc patches and platform patches 2-4);

2) Added proper error codes for ccdc register function.

Priority: normal

Reviewed-by: Vaibhav Hiremath 
Reviewed-by: Kevin Hilman 
Reviewed-by: Hans Verkuil 
Signed-off-by: Hans Verkuil 
Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Mauro Carvalho Chehab 
Signed-off-by: Douglas Schilling Landgraf 


---

 linux/drivers/media/video/davinci/vpfe_capture.c |  131 +--
 1 file changed, 13 insertions(+), 118 deletions(-)

diff -r 0c65b190e7d7 -r b243d500be35 
linux/drivers/media/video/davinci/vpfe_capture.c
--- a/linux/drivers/media/video/davinci/vpfe_capture.c  Mon Jan 25 11:47:42 
2010 -0200
+++ b/linux/drivers/media/video/davinci/vpfe_capture.c  Mon Jan 25 11:50:15 
2010 -0200
@@ -107,9 +107,6 @@
int vpfe_probed;
/* name of ccdc device */
char name[32];
-   /* for storing mem maps for CCDC */
-   int ccdc_addr_size;
-   void *__iomem ccdc_addr;
 };
 
 /* data structures */
@@ -229,7 +226,6 @@
BUG_ON(!dev->hw_ops.set_image_window);
BUG_ON(!dev->hw_ops.get_image_window);
BUG_ON(!dev->hw_ops.get_line_length);
-   BUG_ON(!dev->hw_ops.setfbaddr);
BUG_ON(!dev->hw_ops.getfid);
 
mutex_lock(&ccdc_lock);
@@ -240,25 +236,23 @@
 * walk through it during vpfe probe
 */
printk(KERN_ERR "vpfe capture not initialized\n");
-   ret = -1;
+   ret = -EFAULT;
goto unlock;
}
 
if (strcmp(dev->name, ccdc_cfg->name)) {
/* ignore this ccdc */
-   ret = -1;
+   ret = -EINVAL;
goto unlock;
}
 
if (ccdc_dev) {
printk(KERN_ERR "ccdc already registered\n");
-   ret = -1;
+   ret = -EINVAL;
goto unlock;
}
 
ccdc_dev = dev;
-   dev->hw_ops.set_ccdc_base(ccdc_cfg->ccdc_addr,
- ccdc_cfg->ccdc_addr_size);
 unlock:
mutex_unlock(&ccdc_lock);
return ret;
@@ -1786,61 +1780,6 @@
return vpfe_dev;
 }
 
-static void vpfe_disable_clock(struct vpfe_device *vpfe_dev)
-{
-   struct vpfe_config *vpfe_cfg = vpfe_dev->cfg;
-
-   clk_disable(vpfe_cfg->vpssclk);
-   clk_put(vpfe_cfg->vpssclk);
-   clk_disable(vpfe_cfg->slaveclk);
-   clk_put(vpfe_cfg->slaveclk);
-   v4l2_info(vpfe_dev->pdev->driver,
-"vpfe vpss master & slave clocks disabled\n");
-}
-
-static int vpfe_enable_clock(struct vpfe_device *vpfe_dev)
-{
-   struct vpfe_config *vpfe_cfg = vpfe_dev->cfg;
-   int ret = -ENOENT;
-
-   vpfe_cfg->vpssclk = clk_get(vpfe_dev->pdev, "vpss_master");
-   if (NULL == vpfe_cfg->vpssclk) {
-   v4l2_err(vpfe_dev->pdev->driver, "No clock defined for"
-"vpss_master\n");
-   return ret;
-   }
-
-   if (clk_enable(vpfe_cfg->vpssclk)) {
-   v4l2_err(vpfe_dev->pdev->driver,
-   "vpfe vpss master clock not enabled\n");
-   goto out;
-   }
-   v4l2_info(vpfe_dev->pdev->driver,
-"vpfe vpss master clock enabled\n");
-
-   vpfe_cfg->slaveclk = clk_get(vpfe_dev->pdev, "vpss_slave");
-   if (NULL == vpfe_cfg->slaveclk) {
-   v4l2_err(vpfe_dev->pdev->driver,
-   "No clock defined for vpss slave\n");
-   goto out;
-   }
-
-   if (clk_enable(vpfe_cfg->slaveclk)) {
-   v4l2_err(vpfe_dev->pdev->driver,
-"vpfe vpss slave clock not enabled\n");
-   goto out;
-   }
-   v4l2_info(vpfe_dev->pdev->driver, "vpfe vpss slave clock enabled\n");
-   return 0;
-out:
-   if (vpfe_cfg->vpssclk)
-   clk_put(vpfe_cfg->vpssclk);
-   if (vpfe_cfg->slaveclk)
-   clk_put(vpfe_cfg->slaveclk);
-
-   return -1;
-}
-
 /*
  * vpfe_probe : This function creates device entries by register
  * itself to the V4L2 driver and initializes fields of each
@@ -1870,7 +1809,7 @@
 

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


Re: i2c bus multiplexing (Version 2).

2009-12-14 Thread Muralidharan Karicheri

> This patch set adds to the I2C core the ability to handle multiplexed
> I2C bus topologies by presenting each multiplexed segment as a I2C
> adapter.

Hi Rodolfo,

Thanks for this patch. I learned about this patch through linux-media
mailing list. 

1)I have a sensor board header that uses pca9543a i2c switch
which is addressed by this patch. In my board, I have another
i2c chip that share the same i2c address with the sensor.
Currently I cannot have both these drivers co-exists due to
this. Please let me know if this can work once I use this patch.

2)Which kernel version you use for this patch?

3) Where can I download your patch so that I can give it a
shot. Is there any platform data I need to setup in my arch/
folder to use this patch?

4) When do you think this will be merged to mainline kernel?

Thanks

Murali




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


[linuxtv-commits] [hg:v4l-dvb] v4l2: Adding helper function to get dv preset description

2009-12-12 Thread Patch from Muralidharan Karicheri
The patch number 13618 was added via Hans Verkuil 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
v4l2: Adding helper function to get dv preset description


This patch adds a helper function to get description of a digital
video preset added by the video timing API. This will be useful for drivers
implementing the above API.

Priority: normal

Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Hans Verkuil 


---

 linux/drivers/media/video/v4l2-common.c |   47 
 linux/include/media/v4l2-common.h   |2 -
 2 files changed, 48 insertions(+), 1 deletion(-)

diff -r 065f9e34e07b -r 776c8b602a6a linux/drivers/media/video/v4l2-common.c
--- a/linux/drivers/media/video/v4l2-common.c   Mon Dec 07 10:08:33 2009 -0200
+++ b/linux/drivers/media/video/v4l2-common.c   Thu Dec 10 13:09:47 2009 +0530
@@ -1142,3 +1142,50 @@
}
 }
 EXPORT_SYMBOL_GPL(v4l_bound_align_image);
+
+/**
+ * v4l_fill_dv_preset_info - fill description of a digital video preset
+ * @preset - preset value
+ * @info - pointer to struct v4l2_dv_enum_preset
+ *
+ * drivers can use this helper function to fill description of dv preset
+ * in info.
+ */
+int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info)
+{
+   static const struct v4l2_dv_preset_info {
+   u16 width;
+   u16 height;
+   const char *name;
+   } dv_presets[] = {
+   { 0, 0, "Invalid" },/* V4L2_DV_INVALID */
+   { 720,  480, "4...@59.94" },/* V4L2_DV_480P59_94 */
+   { 720,  576, "5...@50" },   /* V4L2_DV_576P50 */
+   { 1280, 720, "7...@24" },   /* V4L2_DV_720P24 */
+   { 1280, 720, "7...@25" },   /* V4L2_DV_720P25 */
+   { 1280, 720, "7...@30" },   /* V4L2_DV_720P30 */
+   { 1280, 720, "7...@50" },   /* V4L2_DV_720P50 */
+   { 1280, 720, "7...@59.94" },/* V4L2_DV_720P59_94 */
+   { 1280, 720, "7...@60" },   /* V4L2_DV_720P60 */
+   { 1920, 1080, "10...@29.97" },  /* V4L2_DV_1080I29_97 */
+   { 1920, 1080, "10...@30" }, /* V4L2_DV_1080I30 */
+   { 1920, 1080, "10...@25" }, /* V4L2_DV_1080I25 */
+   { 1920, 1080, "10...@50" }, /* V4L2_DV_1080I50 */
+   { 1920, 1080, "10...@60" }, /* V4L2_DV_1080I60 */
+   { 1920, 1080, "10...@24" }, /* V4L2_DV_1080P24 */
+   { 1920, 1080, "10...@25" }, /* V4L2_DV_1080P25 */
+   { 1920, 1080, "10...@30" }, /* V4L2_DV_1080P30 */
+   { 1920, 1080, "10...@50" }, /* V4L2_DV_1080P50 */
+   { 1920, 1080, "10...@60" }, /* V4L2_DV_1080P60 */
+   };
+
+   if (info == NULL || preset >= ARRAY_SIZE(dv_presets))
+   return -EINVAL;
+
+   info->preset = preset;
+   info->width = dv_presets[preset].width;
+   info->height = dv_presets[preset].height;
+   strlcpy(info->name, dv_presets[preset].name, sizeof(info->name));
+   return 0;
+}
+EXPORT_SYMBOL_GPL(v4l_fill_dv_preset_info);
diff -r 065f9e34e07b -r 776c8b602a6a linux/include/media/v4l2-common.h
--- a/linux/include/media/v4l2-common.h Mon Dec 07 10:08:33 2009 -0200
+++ b/linux/include/media/v4l2-common.h Thu Dec 10 13:09:47 2009 +0530
@@ -219,5 +219,5 @@
   unsigned int *h, unsigned int hmin,
   unsigned int hmax, unsigned int halign,
   unsigned int salign);
-
+int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info);
 #endif /* V4L2_COMMON_H_ */


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/776c8b602a6afe016e26bf61a13c5313911bf2a6

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] v4l2-spec: Adds EBUSY error code for S_STD and QUERYSTD ioctls

2009-12-12 Thread Patch from Muralidharan Karicheri
The patch number 13619 was added via Hans Verkuil 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
v4l2-spec: Adds EBUSY error code for S_STD and QUERYSTD ioctls


During review of Video Timing API documentation, Hans Verkuil had a comment
on adding EBUSY error code for VIDIOC_S_STD and VIDIOC_QUERYSTD ioctls. This
patch updates the document for this.

Priority: normal

Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Hans Verkuil 


---

 linux/Documentation/DocBook/v4l/vidioc-g-std.xml|6 ++
 linux/Documentation/DocBook/v4l/vidioc-querystd.xml |6 ++
 2 files changed, 12 insertions(+)

diff -r 776c8b602a6a -r ce9c9043c055 
linux/Documentation/DocBook/v4l/vidioc-g-std.xml
--- a/linux/Documentation/DocBook/v4l/vidioc-g-std.xml  Thu Dec 10 13:09:47 
2009 +0530
+++ b/linux/Documentation/DocBook/v4l/vidioc-g-std.xml  Thu Dec 10 19:01:44 
2009 +0530
@@ -86,6 +86,12 @@
 VIDIOC_S_STD parameter was unsuitable.

   
+  
+   EBUSY
+   
+ The device is busy and therefore can not change the 
standard
+   
+  
 
   
 
diff -r 776c8b602a6a -r ce9c9043c055 
linux/Documentation/DocBook/v4l/vidioc-querystd.xml
--- a/linux/Documentation/DocBook/v4l/vidioc-querystd.xml   Thu Dec 10 
13:09:47 2009 +0530
+++ b/linux/Documentation/DocBook/v4l/vidioc-querystd.xml   Thu Dec 10 
19:01:44 2009 +0530
@@ -70,6 +70,12 @@
  This ioctl is not supported.

   
+  
+   EBUSY
+   
+ The device is busy and therefore can not detect the 
standard
+   
+  
 
   
 


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/ce9c9043c055abd8ec0a2c5b38e168167cb03cb1

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] videobuf_dma_contig_user_get() for non-aligned offsets

2009-12-10 Thread Patch from Muralidharan Karicheri
The patch number 13598 was added via Mauro Carvalho Chehab 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
videobuf_dma_contig_user_get() for non-aligned offsets


If a USERPTR address that is not aligned to page boundary is passed to the
videobuf_dma_contig_user_get() function, it saves a page aligned address to
the dma_handle. This is not correct. This issue is observed when using USERPTR
IO machism for buffer exchange.

Updates from last version:-

Adding offset for size calculation as per comment from Magnus Damm. This
ensures the last page is also included for checking if memory is
contiguous.

Priority: normal

Signed-off-by: Muralidharan Karicheri 
Acked-by: Magnus Damm 
Signed-off-by: Douglas Schilling Landgraf 
Signed-off-by: Mauro Carvalho Chehab 


---

 linux/drivers/media/video/videobuf-dma-contig.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff -r 4fd0e5035ba2 -r d4292fa68a42 
linux/drivers/media/video/videobuf-dma-contig.c
--- a/linux/drivers/media/video/videobuf-dma-contig.c   Thu Dec 10 17:46:06 
2009 -0200
+++ b/linux/drivers/media/video/videobuf-dma-contig.c   Thu Dec 10 17:47:48 
2009 -0200
@@ -146,9 +146,11 @@
struct vm_area_struct *vma;
unsigned long prev_pfn, this_pfn;
unsigned long pages_done, user_address;
+   unsigned int offset;
int ret;
 
-   mem->size = PAGE_ALIGN(vb->size);
+   offset = vb->baddr & ~PAGE_MASK;
+   mem->size = PAGE_ALIGN(vb->size + offset);
mem->is_userptr = 0;
ret = -EINVAL;
 
@@ -171,7 +173,7 @@
break;
 
if (pages_done == 0)
-   mem->dma_handle = this_pfn << PAGE_SHIFT;
+   mem->dma_handle = (this_pfn << PAGE_SHIFT) + offset;
else if (this_pfn != (prev_pfn + 1))
ret = -EFAULT;
 


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/d4292fa68a422fcfe4e7846bf73388a497a494c3

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] v4l: Adding Digital Video Timings APIs

2009-12-05 Thread Patch from Muralidharan Karicheri
The patch number 13571 was added via Hans Verkuil 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
v4l: Adding Digital Video Timings APIs


This adds the above APIs to the v4l2 core. This is based on version v1.2
of the RFC titled "V4L - Support for video timings at the input/output 
interface"
Following new ioctls are added:-

- VIDIOC_ENUM_DV_PRESETS
- VIDIOC_S_DV_PRESET
- VIDIOC_G_DV_PRESET
- VIDIOC_QUERY_DV_PRESET
- VIDIOC_S_DV_TIMINGS
- VIDIOC_G_DV_TIMINGS

Please refer to the RFC for the details. This code was tested using vpfe
capture driver on TI's DM365. Following is the test configuration used :-

Blu-Ray HD DVD source -> TVP7002 -> DM365 (VPFE) ->DDR

A draft version of the TVP7002 driver (currently being reviewed in the mailing
list) was used that supports V4L2_DV_1080I60 & V4L2_DV_720P60 presets.

A loopback video capture application was used for testing these APIs. This calls
following IOCTLS :-

 -  verify the new v4l2_input capabilities flag added
 -  Enumerate available presets using VIDIOC_ENUM_DV_PRESETS
 -  Set one of the supported preset using VIDIOC_S_DV_PRESET
 -  Get current preset using VIDIOC_G_DV_PRESET
 -  Detect current preset using VIDIOC_QUERY_DV_PRESET
 -  Using stub functions in tvp7002, verify VIDIOC_S_DV_TIMINGS
and VIDIOC_G_DV_TIMINGS ioctls are received at the sub device.
 -  Tested on 64bit platform by Hans Verkuil

Priority: normal

Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Hans Verkuil 
Reviewed-by: Randy Dunlap 


---

 linux/drivers/media/video/v4l2-compat-ioctl32.c |6 
 linux/drivers/media/video/v4l2-ioctl.c  |  147 
 linux/include/linux/videodev2.h |  116 
 linux/include/media/v4l2-ioctl.h|   15 +
 linux/include/media/v4l2-subdev.h   |   21 ++
 5 files changed, 303 insertions(+), 2 deletions(-)

diff -r e0cd9a337600 -r 2cdba6c81caf 
linux/drivers/media/video/v4l2-compat-ioctl32.c
--- a/linux/drivers/media/video/v4l2-compat-ioctl32.c   Sun Nov 29 12:08:02 
2009 -0200
+++ b/linux/drivers/media/video/v4l2-compat-ioctl32.c   Thu Nov 19 16:00:31 
2009 +0100
@@ -1082,6 +1082,12 @@
case VIDIOC_DBG_G_REGISTER:
case VIDIOC_DBG_G_CHIP_IDENT:
case VIDIOC_S_HW_FREQ_SEEK:
+   case VIDIOC_ENUM_DV_PRESETS:
+   case VIDIOC_S_DV_PRESET:
+   case VIDIOC_G_DV_PRESET:
+   case VIDIOC_QUERY_DV_PRESET:
+   case VIDIOC_S_DV_TIMINGS:
+   case VIDIOC_G_DV_TIMINGS:
ret = do_video_ioctl(file, cmd, arg);
break;
 
diff -r e0cd9a337600 -r 2cdba6c81caf linux/drivers/media/video/v4l2-ioctl.c
--- a/linux/drivers/media/video/v4l2-ioctl.cSun Nov 29 12:08:02 2009 -0200
+++ b/linux/drivers/media/video/v4l2-ioctl.cThu Nov 19 16:00:31 2009 +0100
@@ -285,6 +285,12 @@
[_IOC_NR(VIDIOC_DBG_G_CHIP_IDENT)] = "VIDIOC_DBG_G_CHIP_IDENT",
[_IOC_NR(VIDIOC_S_HW_FREQ_SEEK)]   = "VIDIOC_S_HW_FREQ_SEEK",
 #endif
+   [_IOC_NR(VIDIOC_ENUM_DV_PRESETS)]  = "VIDIOC_ENUM_DV_PRESETS",
+   [_IOC_NR(VIDIOC_S_DV_PRESET)]  = "VIDIOC_S_DV_PRESET",
+   [_IOC_NR(VIDIOC_G_DV_PRESET)]  = "VIDIOC_G_DV_PRESET",
+   [_IOC_NR(VIDIOC_QUERY_DV_PRESET)]  = "VIDIOC_QUERY_DV_PRESET",
+   [_IOC_NR(VIDIOC_S_DV_TIMINGS)] = "VIDIOC_S_DV_TIMINGS",
+   [_IOC_NR(VIDIOC_G_DV_TIMINGS)] = "VIDIOC_G_DV_TIMINGS",
 };
 #define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls)
 
@@ -1136,6 +1142,19 @@
{
struct v4l2_input *p = arg;
 
+   /*
+* We set the flags for CAP_PRESETS, CAP_CUSTOM_TIMINGS &
+* CAP_STD here based on ioctl handler provided by the
+* driver. If the driver doesn't support these
+* for a specific input, it must override these flags.
+*/
+   if (ops->vidioc_s_std)
+   p->capabilities |= V4L2_IN_CAP_STD;
+   if (ops->vidioc_s_dv_preset)
+   p->capabilities |= V4L2_IN_CAP_PRESETS;
+   if (ops->vidioc_s_dv_timings)
+   p->capabilities |= V4L2_IN_CAP_CUSTOM_TIMINGS;
+
if (!ops->vidioc_enum_input)
break;
 
@@ -1180,6 +1199,19 @@
if (!ops->vidioc_enum_output)
break;
 
+   /*
+* We set the flags for CAP_PRESETS, CAP_CUSTOM_TIMINGS &
+* CAP_STD here based 

[linuxtv-commits] [hg:v4l-dvb] v4l2-spec: Digital Video Timings API documentation

2009-12-05 Thread Patch from Muralidharan Karicheri
The patch number 13572 was added via Hans Verkuil 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
v4l2-spec: Digital Video Timings API documentation


This patch updates the v4l2-dvb documentation for the new video timings API 
added.
Also updated the document based on comments from Hans Verkuil.

Priority: normal

Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Hans Verkuil 


---

 linux/Documentation/DocBook/media-entities.tmpl|   18 
 linux/Documentation/DocBook/media-indices.tmpl |4 
 linux/Documentation/DocBook/v4l/common.xml |   35 +
 linux/Documentation/DocBook/v4l/v4l2.xml   |4 
 linux/Documentation/DocBook/v4l/videodev2.h.xml|  116 
 linux/Documentation/DocBook/v4l/vidioc-enum-dv-presets.xml |  238 ++
 linux/Documentation/DocBook/v4l/vidioc-enuminput.xml   |   36 +
 linux/Documentation/DocBook/v4l/vidioc-enumoutput.xml  |   36 +
 linux/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml |  111 
 linux/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml|  224 +
 linux/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml |   85 +++
 media-specs/Makefile   |   14 
 12 files changed, 917 insertions(+), 4 deletions(-)



---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/22b3751c1a71b1d0d45318e460460b31a66ae579

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] v4l: Makefile and config files for vpfe capture driver

2009-07-14 Thread Patch from Muralidharan Karicheri
The patch number 12254 was added via Hans Verkuil 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
v4l: Makefile and config files for vpfe capture driver


This adds Makefile and Kconfig changes to build vpfe capture driver.



Reviewed by: Laurent Pinchart 

Priority: normal

Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Hans Verkuil 


---

 linux/drivers/media/video/Kconfig  |   49 +
 linux/drivers/media/video/Makefile |2 
 linux/drivers/media/video/davinci/Makefile |6 ++
 3 files changed, 57 insertions(+)

diff -r 42b30f10e730 -r b6eae11ad635 linux/drivers/media/video/Kconfig
--- a/linux/drivers/media/video/Kconfig Fri Jun 19 14:20:16 2009 +0200
+++ b/linux/drivers/media/video/Kconfig Mon Jul 06 20:08:31 2009 +0200
@@ -526,6 +526,55 @@ config VIDEO_VIVI
  api.
  Say Y here if you want to test video apps or debug V4L devices.
  In doubt, say N.
+
+config VIDEO_VPSS_SYSTEM
+   tristate "VPSS System module driver"
+   depends on ARCH_DAVINCI
+   help
+ Support for vpss system module for video driver
+   default y
+
+config VIDEO_VPFE_CAPTURE
+   tristate "VPFE Video Capture Driver"
+   depends on VIDEO_V4L2 && ARCH_DAVINCI
+   select VIDEOBUF_DMA_CONTIG
+   help
+ Support for DM VPFE based frame grabber. This is the
+ common V4L2 module for following DMXXX SoCs from Texas
+ Instruments:- DM6446 & DM355.
+
+ To compile this driver as a module, choose M here: the
+ module will be called vpfe-capture.
+
+config VIDEO_DM6446_CCDC
+   tristate "DM6446 CCDC HW module"
+   depends on ARCH_DAVINCI_DM644x && VIDEO_VPFE_CAPTURE
+   select VIDEO_VPSS_SYSTEM
+   default y
+   help
+  Enables DaVinci CCD hw module. DaVinci CCDC hw interfaces
+  with decoder modules such as TVP5146 over BT656 or
+  sensor module such as MT9T001 over a raw interface. This
+  module configures the interface and CCDC/ISIF to do
+  video frame capture from slave decoders.
+
+  To compile this driver as a module, choose M here: the
+  module will be called vpfe.
+
+config VIDEO_DM355_CCDC
+   tristate "DM355 CCDC HW module"
+   depends on ARCH_DAVINCI_DM355 && VIDEO_VPFE_CAPTURE
+   select VIDEO_VPSS_SYSTEM
+   default y
+   help
+  Enables DM355 CCD hw module. DM355 CCDC hw interfaces
+  with decoder modules such as TVP5146 over BT656 or
+  sensor module such as MT9T001 over a raw interface. This
+  module configures the interface and CCDC/ISIF to do
+  video frame capture from a slave decoders
+
+  To compile this driver as a module, choose M here: the
+  module will be called vpfe.
 
 source "drivers/media/video/bt8xx/Kconfig"
 
diff -r 42b30f10e730 -r b6eae11ad635 linux/drivers/media/video/Makefile
--- a/linux/drivers/media/video/MakefileFri Jun 19 14:20:16 2009 +0200
+++ b/linux/drivers/media/video/MakefileMon Jul 06 20:08:31 2009 +0200
@@ -154,6 +154,8 @@ obj-$(CONFIG_VIDEO_PXA27x)  += pxa_camer
 obj-$(CONFIG_VIDEO_PXA27x) += pxa_camera.o
 obj-$(CONFIG_VIDEO_SH_MOBILE_CEU)  += sh_mobile_ceu_camera.o
 
+obj-$(CONFIG_ARCH_DAVINCI) += davinci/
+
 obj-$(CONFIG_VIDEO_AU0828) += au0828/
 
 obj-$(CONFIG_USB_VIDEO_CLASS)  += uvc/
diff -r 42b30f10e730 -r b6eae11ad635 linux/drivers/media/video/davinci/Makefile
--- a/linux/drivers/media/video/davinci/MakefileFri Jun 19 14:20:16 
2009 +0200
+++ b/linux/drivers/media/video/davinci/MakefileMon Jul 06 20:08:31 
2009 +0200
@@ -7,3 +7,9 @@ obj-$(CONFIG_VIDEO_DAVINCI_VPIF) += vpif
 
 #DM646x EVM Display driver
 obj-$(CONFIG_DISPLAY_DAVINCI_DM646X_EVM) += vpif_display.o
+
+# Capture: DM6446 and DM355
+obj-$(CONFIG_VIDEO_VPSS_SYSTEM) += vpss.o
+obj-$(CONFIG_VIDEO_VPFE_CAPTURE) += vpfe_capture.o
+obj-$(CONFIG_VIDEO_DM6446_CCDC) += dm644x_ccdc.o
+obj-$(CONFIG_VIDEO_DM355_CCDC) += dm355_ccdc.o


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/b6eae11ad635172004cabbf6ede1c8169116d8bf

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] v4l: common vpss module for video drivers

2009-07-14 Thread Patch from Muralidharan Karicheri
The patch number 12253 was added via Hans Verkuil 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
v4l: common vpss module for video drivers


This is a new module added for vpss library functions that are
used for configuring vpss system module. All video drivers will
include vpss.h header file and call functions defined in this
module to configure vpss system module.


Reviewed by: Hans Verkuil 
Reviewed by: Laurent Pinchart 
Reviewed by: Alexey Klimov 

Priority: normal

Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Hans Verkuil 


---

 linux/drivers/media/video/davinci/vpss.c |  301 +++
 linux/include/media/davinci/vpss.h   |   69 +
 2 files changed, 370 insertions(+)

diff -r 420a3505f500 -r 42b30f10e730 linux/drivers/media/video/davinci/vpss.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/linux/drivers/media/video/davinci/vpss.c  Fri Jun 19 14:20:16 2009 +0200
@@ -0,0 +1,301 @@
+/*
+ * Copyright (C) 2009 Texas Instruments.
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * common vpss driver for all video drivers.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("VPSS Driver");
+MODULE_AUTHOR("Texas Instruments");
+
+/* DM644x defines */
+#define DM644X_SBL_PCR_VPSS(4)
+
+/* vpss BL register offsets */
+#define DM355_VPSSBL_CCDCMUX   0x1c
+/* vpss CLK register offsets */
+#define DM355_VPSSCLK_CLKCTRL  0x04
+/* masks and shifts */
+#define VPSS_HSSISEL_SHIFT 4
+
+/*
+ * vpss operations. Depends on platform. Not all functions are available
+ * on all platforms. The api, first check if a functio is available before
+ * invoking it. In the probe, the function ptrs are intialized based on
+ * vpss name. vpss name can be "dm355_vpss", "dm644x_vpss" etc.
+ */
+struct vpss_hw_ops {
+   /* enable clock */
+   int (*enable_clock)(enum vpss_clock_sel clock_sel, int en);
+   /* select input to ccdc */
+   void (*select_ccdc_source)(enum vpss_ccdc_source_sel src_sel);
+   /* clear wbl overlflow bit */
+   int (*clear_wbl_overflow)(enum vpss_wbl_sel wbl_sel);
+};
+
+/* vpss configuration */
+struct vpss_oper_config {
+   __iomem void *vpss_bl_regs_base;
+   __iomem void *vpss_regs_base;
+   struct resource *r1;
+   resource_size_t len1;
+   struct resource *r2;
+   resource_size_t len2;
+   char vpss_name[32];
+   spinlock_t vpss_lock;
+   struct vpss_hw_ops hw_ops;
+};
+
+static struct vpss_oper_config oper_cfg;
+
+/* register access routines */
+static inline u32 bl_regr(u32 offset)
+{
+   return __raw_readl(oper_cfg.vpss_bl_regs_base + offset);
+}
+
+static inline void bl_regw(u32 val, u32 offset)
+{
+   __raw_writel(val, oper_cfg.vpss_bl_regs_base + offset);
+}
+
+static inline u32 vpss_regr(u32 offset)
+{
+   return __raw_readl(oper_cfg.vpss_regs_base + offset);
+}
+
+static inline void vpss_regw(u32 val, u32 offset)
+{
+   __raw_writel(val, oper_cfg.vpss_regs_base + offset);
+}
+
+static void dm355_select_ccdc_source(enum vpss_ccdc_source_sel src_sel)
+{
+   bl_regw(src_sel << VPSS_HSSISEL_SHIFT, DM355_VPSSBL_CCDCMUX);
+}
+
+int vpss_select_ccdc_source(enum vpss_ccdc_source_sel src_sel)
+{
+   if (!oper_cfg.hw_ops.select_ccdc_source)
+   return -1;
+
+   dm355_select_ccdc_source(src_sel);
+   return 0;
+}
+EXPORT_SYMBOL(vpss_select_ccdc_source);
+
+static int dm644x_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel)
+{
+   u32 mask = 1, val;
+
+   if (wbl_sel < VPSS_PCR_AEW_WBL_0 ||
+   wbl_sel > VPSS_PCR_CCDC_WBL_O)
+   return -1;
+
+   /* writing a 0 clear the overflow */
+   mask = ~(mask << wbl_sel);
+   val = bl_regr(DM644X_SBL_PCR_VPSS) & mask;
+   bl_regw(val, D

[linuxtv-commits] [hg:v4l-dvb] v4l: ccdc hw device header file for vpfe capture

2009-07-14 Thread Patch from Muralidharan Karicheri
The patch number 12249 was added via Hans Verkuil 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
v4l: ccdc hw device header file for vpfe capture


Adds ccdc hw device header for vpfe capture driver


Reviewed by: Hans Verkuil 
Reviewed by: Laurent Pinchart 

Priority: normal

Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Hans Verkuil 


---

 linux/drivers/media/video/davinci/ccdc_hw_device.h |  110 +
 1 file changed, 110 insertions(+)

diff -r 184b26716400 -r e4559ecf3d50 
linux/drivers/media/video/davinci/ccdc_hw_device.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/linux/drivers/media/video/davinci/ccdc_hw_device.hFri Jun 19 
14:14:10 2009 +0200
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2008-2009 Texas Instruments Inc
+ *
+ * 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
+ *
+ * ccdc device API
+ */
+#ifndef _CCDC_HW_DEVICE_H
+#define _CCDC_HW_DEVICE_H
+
+#ifdef __KERNEL__
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * ccdc hw operations
+ */
+struct ccdc_hw_ops {
+   /* Pointer to initialize function to initialize ccdc device */
+   int (*open) (struct device *dev);
+   /* Pointer to deinitialize function */
+   int (*close) (struct device *dev);
+   /* set ccdc base address */
+   void (*set_ccdc_base)(void *base, int size);
+   /* Pointer to function to enable or disable ccdc */
+   void (*enable) (int en);
+   /* reset sbl. only for 6446 */
+   void (*reset) (void);
+   /* enable output to sdram */
+   void (*enable_out_to_sdram) (int en);
+   /* Pointer to function to set hw parameters */
+   int (*set_hw_if_params) (struct vpfe_hw_if_param *param);
+   /* get interface parameters */
+   int (*get_hw_if_params) (struct vpfe_hw_if_param *param);
+   /*
+* Pointer to function to set parameters. Used
+* for implementing VPFE_S_CCDC_PARAMS
+*/
+   int (*set_params) (void *params);
+   /*
+* Pointer to function to get parameter. Used
+* for implementing VPFE_G_CCDC_PARAMS
+*/
+   int (*get_params) (void *params);
+   /* Pointer to function to configure ccdc */
+   int (*configure) (void);
+
+   /* Pointer to function to set buffer type */
+   int (*set_buftype) (enum ccdc_buftype buf_type);
+   /* Pointer to function to get buffer type */
+   enum ccdc_buftype (*get_buftype) (void);
+   /* Pointer to function to set frame format */
+   int (*set_frame_format) (enum ccdc_frmfmt frm_fmt);
+   /* Pointer to function to get frame format */
+   enum ccdc_frmfmt (*get_frame_format) (void);
+   /* enumerate hw pix formats */
+   int (*enum_pix)(u32 *hw_pix, int i);
+   /* Pointer to function to set buffer type */
+   u32 (*get_pixel_format) (void);
+   /* Pointer to function to get pixel format. */
+   int (*set_pixel_format) (u32 pixfmt);
+   /* Pointer to function to set image window */
+   int (*set_image_window) (struct v4l2_rect *win);
+   /* Pointer to function to set image window */
+   void (*get_image_window) (struct v4l2_rect *win);
+   /* Pointer to function to get line length */
+   unsigned int (*get_line_length) (void);
+
+   /* Query CCDC control IDs */
+   int (*queryctrl)(struct v4l2_queryctrl *qctrl);
+   /* Set CCDC control */
+   int (*set_control)(struct v4l2_control *ctrl);
+   /* Get CCDC control */
+   int (*get_control)(struct v4l2_control *ctrl);
+
+   /* Pointer to function to set frame buffer address */
+   void (*setfbaddr) (unsigned long addr);
+   /* Pointer to function to get field id */
+   int (*getfid) (void);
+};
+
+struct ccdc_hw_device {
+   /* ccdc device name */
+   char name[32];
+   /* module owner */
+   struct module *owner;
+   /* hw ops */
+   struct ccdc_hw_ops hw_ops;
+};
+
+/* Used by CCDC module to register & unregister with 

[linuxtv-commits] [hg:v4l-dvb] tvp514x: formatting comments as per kernel documentation

2009-07-14 Thread Patch from Muralidharan Karicheri
The patch number 12247 was added via Hans Verkuil 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
tvp514x: formatting comments as per kernel documentation


Fix documentation style based on comments from Mauro.


Reviewed by: Hans Verkuil 

Priority: normal

Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Hans Verkuil 


---

 linux/drivers/media/video/tvp514x.c |  275 +++-
 1 file changed, 157 insertions(+), 118 deletions(-)

diff -r 72b11f15f25f -r 3c48f0c1fbf1 linux/drivers/media/video/tvp514x.c
--- a/linux/drivers/media/video/tvp514x.c   Fri Jun 19 12:13:44 2009 +0200
+++ b/linux/drivers/media/video/tvp514x.c   Wed Jul 01 09:20:43 2009 +0200
@@ -56,16 +56,14 @@ MODULE_DESCRIPTION("TVP514X linux decode
 MODULE_DESCRIPTION("TVP514X linux decoder driver");
 MODULE_LICENSE("GPL");
 
-/*
- * enum tvp514x_std - enum for supported standards
- */
+/* enum tvp514x_std - enum for supported standards */
 enum tvp514x_std {
STD_NTSC_MJ = 0,
STD_PAL_BDGHIN,
STD_INVALID
 };
 
-/*
+/**
  * struct tvp514x_std_info - Structure to store standard informations
  * @width: Line width in pixels
  * @height:Number of active lines
@@ -80,7 +78,7 @@ struct tvp514x_std_info {
 };
 
 static struct tvp514x_reg tvp514x_reg_list_default[0x40];
-/*
+/**
  * struct tvp514x_decoder - TVP5146/47 decoder object
  * @sd: Subdevice Slave handle
  * @tvp514x_regs: copy of hw's regs with preset values.
@@ -111,18 +109,18 @@ struct tvp514x_decoder {
enum tvp514x_std current_std;
int num_stds;
struct tvp514x_std_info *std_list;
-   /*
-* Input and Output Routing parameters
-*/
+   /* Input and Output Routing parameters */
u32 input;
u32 output;
 };
 
 /* TVP514x default register values */
 static struct tvp514x_reg tvp514x_reg_list_default[] = {
-   {TOK_WRITE, REG_INPUT_SEL, 0x05},   /* Composite selected */
+   /* Composite selected */
+   {TOK_WRITE, REG_INPUT_SEL, 0x05},
{TOK_WRITE, REG_AFE_GAIN_CTRL, 0x0F},
-   {TOK_WRITE, REG_VIDEO_STD, 0x00},   /* Auto mode */
+   /* Auto mode */
+   {TOK_WRITE, REG_VIDEO_STD, 0x00},
{TOK_WRITE, REG_OPERATION_MODE, 0x00},
{TOK_SKIP, REG_AUTOSWITCH_MASK, 0x3F},
{TOK_WRITE, REG_COLOR_KILLER, 0x10},
@@ -135,53 +133,73 @@ static struct tvp514x_reg tvp514x_reg_li
{TOK_WRITE, REG_HUE, 0x00},
{TOK_WRITE, REG_CHROMA_CONTROL1, 0x00},
{TOK_WRITE, REG_CHROMA_CONTROL2, 0x0E},
-   {TOK_SKIP, 0x0F, 0x00}, /* Reserved */
+   /* Reserved */
+   {TOK_SKIP, 0x0F, 0x00},
{TOK_WRITE, REG_COMP_PR_SATURATION, 0x80},
{TOK_WRITE, REG_COMP_Y_CONTRAST, 0x80},
{TOK_WRITE, REG_COMP_PB_SATURATION, 0x80},
-   {TOK_SKIP, 0x13, 0x00}, /* Reserved */
+   /* Reserved */
+   {TOK_SKIP, 0x13, 0x00},
{TOK_WRITE, REG_COMP_Y_BRIGHTNESS, 0x80},
-   {TOK_SKIP, 0x15, 0x00}, /* Reserved */
-   {TOK_SKIP, REG_AVID_START_PIXEL_LSB, 0x55}, /* NTSC timing */
+   /* Reserved */
+   {TOK_SKIP, 0x15, 0x00},
+   /* NTSC timing */
+   {TOK_SKIP, REG_AVID_START_PIXEL_LSB, 0x55},
{TOK_SKIP, REG_AVID_START_PIXEL_MSB, 0x00},
{TOK_SKIP, REG_AVID_STOP_PIXEL_LSB, 0x25},
{TOK_SKIP, REG_AVID_STOP_PIXEL_MSB, 0x03},
-   {TOK_SKIP, REG_HSYNC_START_PIXEL_LSB, 0x00},/* NTSC timing */
+   /* NTSC timing */
+   {TOK_SKIP, REG_HSYNC_START_PIXEL_LSB, 0x00},
{TOK_SKIP, REG_HSYNC_START_PIXEL_MSB, 0x00},
{TOK_SKIP, REG_HSYNC_STOP_PIXEL_LSB, 0x40},
{TOK_SKIP, REG_HSYNC_STOP_PIXEL_MSB, 0x00},
-   {TOK_SKIP, REG_VSYNC_START_LINE_LSB, 0x04}, /* NTSC timing */
+   /* NTSC timing */
+   {TOK_SKIP, REG_VSYNC_START_LINE_LSB, 0x04},
{TOK_SKIP, REG_VSYNC_START_LINE_MSB, 0x00},
{TOK_SKIP, REG_VSYNC_STOP_LINE_LSB, 0x07},
{TOK_SKIP, REG_VSYNC_STOP_LINE_MSB, 0x00},
-   {TOK_SKIP, REG_VBLK_START_LINE_LSB, 0x01},  /* NTSC timing */
+   /* NTSC timing */
+   {TOK_SKIP, REG_VBLK_START_LINE_LSB, 0x01},
{TOK_SKIP, REG_VBLK_START_LINE_MSB, 0x00},
{TOK_SKIP, REG_VBLK_STOP_LINE_LSB, 0x15},
{TOK_SKIP, REG_VBLK_STOP_LINE_MSB, 0x00},
-   {TOK_SKIP, 0x26, 0x00}, /* Reserved */
-   {TOK_SKIP, 0x27, 0x00}, /* Reserved */
+   /* Reserved */
+   {TOK_SKIP, 0x26, 0x00},
+   /* Reserved */
+   {TOK_SKIP, 0x27, 0x00},
{TOK_SKIP, REG_FAST_SWTICH_CONTROL, 0xCC},
-   {TOK_SKIP, 0x29, 0x00}, /* Reserved */
+   /* Reserved */
+   {TOK_SKIP, 

[linuxtv-commits] [hg:v4l-dvb] v4l: vpfe capture bridge driver for DM355 and DM6446

2009-07-14 Thread Patch from Muralidharan Karicheri
The patch number 12248 was added via Hans Verkuil 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
v4l: vpfe capture bridge driver for DM355 and DM6446


This the vpfe capture bridge driver for doing video
capture on DM355 and DM6446 evms. The ccdc hw modules register with the
driver and are used for configuring the CCD Controller for a specific
decoder interface. The driver also registers the sub devices required
for a specific evm. More than one sub devices can be registered.
This allows driver to switch dynamically to capture video from
any sub device that is registered. Currently only one sub device
(tvp5146) is supported. But in future this driver is expected
to do capture from sensor devices such as Micron's MT9T001, MT9T031
and MT9P031 etc. The driver currently supports MMAP based IO.


Reviewed by: Laurent Pinchart 
Reviewed by: Alexey Klimov 

Priority: normal

Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Hans Verkuil 


---

 linux/drivers/media/video/davinci/vpfe_capture.c | 2124 +++
 linux/include/media/davinci/vpfe_capture.h   |  198 +
 linux/include/media/davinci/vpfe_types.h |   51 
 3 files changed, 2373 insertions(+)



---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/184b267164002cda3b5a49235cd7fa8b8494f968

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] v4l: dm644x ccdc module for vpfe capture driver

2009-07-14 Thread Patch from Muralidharan Karicheri
The patch number 12251 was added via Hans Verkuil 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
v4l: dm644x ccdc module for vpfe capture driver


This is the hw module for DM644x CCDC. This registers with the
vpfe capture driver and provides a set of hw_ops to configure
CCDC for a specific decoder device connected to the VPFE.


Reviewed by: Hans Verkuil 
Reviewed by: Laurent Pinchart 

Priority: normal

Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Hans Verkuil 


---

 linux/drivers/media/video/davinci/dm644x_ccdc.c  |  878 +++
 linux/drivers/media/video/davinci/dm644x_ccdc_regs.h |  145 +
 linux/include/media/davinci/dm644x_ccdc.h|  184 ++
 3 files changed, 1207 insertions(+)



---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/82b3a41c42a05572aa063b283dfbfe8c7a8c2e47

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] v4l: dm355 ccdc module for vpfe capture driver

2009-07-14 Thread Patch from Muralidharan Karicheri
The patch number 12250 was added via Hans Verkuil 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
v4l: dm355 ccdc module for vpfe capture driver


Adds ccdc hw module for DM355 CCDC. This registers with the bridge
driver a set of hw_ops for configuring the CCDC for a specific
decoder device connected to vpfe.


Reviewed by: Hans Verkuil 
Reviewed by: Laurent Pinchart 
Reviewed by: Mauro Carvalho Chehab 

Priority: normal

Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Hans Verkuil 


---

 linux/drivers/media/video/davinci/dm355_ccdc.c  |  978 
 linux/drivers/media/video/davinci/dm355_ccdc_regs.h |  310 +++
 linux/include/media/davinci/dm355_ccdc.h|  321 +++
 3 files changed, 1609 insertions(+)



---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/583c2e15d9fcc1c3f238beac868bd9bc814ef45a

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] tvp514x: Migration to sub-device framework

2009-07-14 Thread Patch from Muralidharan Karicheri
The patch number 12246 was added via Hans Verkuil 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
tvp514x: Migration to sub-device framework


This patch converts TVP514x driver to sub-device framework
from V4L2-int framework.

Priority: normal

Signed-off-by: Brijesh Jadav 
Signed-off-by: Hardik Shah 
Signed-off-by: Vaibhav Hiremath 
Signed-off-by: Murali Karicheri 
[hverk...@xs4all.nl: remove inline from the dump_reg function]
Signed-off-by: Hans Verkuil 


---

 linux/drivers/media/video/tvp514x.c  |  965 +--
 linux/drivers/media/video/tvp514x_regs.h |   10 
 linux/include/media/tvp514x.h|4 
 3 files changed, 394 insertions(+), 585 deletions(-)



---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/72b11f15f25f4986bdc418108bd2d62bad247a2e

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] v4l: ccdc types used across ccdc modules for vpfe capture driver

2009-07-14 Thread Patch from Muralidharan Karicheri
The patch number 12252 was added via Hans Verkuil 
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List 

--

From: Muralidharan Karicheri  
v4l: ccdc types used across ccdc modules for vpfe capture driver


common types used across CCDC modules


Reviewed by: Hans Verkuil 
Reviewed by: Laurent Pinchart 

Priority: normal

Signed-off-by: Muralidharan Karicheri 
Signed-off-by: Hans Verkuil 


---

 linux/include/media/davinci/ccdc_types.h |   43 +++
 1 file changed, 43 insertions(+)

diff -r 82b3a41c42a0 -r 420a3505f500 linux/include/media/davinci/ccdc_types.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/linux/include/media/davinci/ccdc_types.h  Fri Jun 19 14:19:17 2009 +0200
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2008-2009 Texas Instruments Inc
+ *
+ * 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 _CCDC_TYPES_H
+#define _CCDC_TYPES_H
+enum ccdc_pixfmt {
+   CCDC_PIXFMT_RAW,
+   CCDC_PIXFMT_YCBCR_16BIT,
+   CCDC_PIXFMT_YCBCR_8BIT
+};
+
+enum ccdc_frmfmt {
+   CCDC_FRMFMT_PROGRESSIVE,
+   CCDC_FRMFMT_INTERLACED
+};
+
+/* PIXEL ORDER IN MEMORY from LSB to MSB */
+/* only applicable for 8-bit input mode  */
+enum ccdc_pixorder {
+   CCDC_PIXORDER_YCBYCR,
+   CCDC_PIXORDER_CBYCRY,
+};
+
+enum ccdc_buftype {
+   CCDC_BUFTYPE_FLD_INTERLEAVED,
+   CCDC_BUFTYPE_FLD_SEPARATED
+};
+#endif


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/420a3505f50045a0e3369021c5d29e3da02057c6

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits