All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC/PATCH 0/5] DaVinci VPIF: Support for DV preset and DV timings.
@ 2010-10-22  7:00 mats.randgaard
  2010-10-22  7:00 ` [RFC/PATCH 1/5] vpif_cap/disp: Add debug functionality mats.randgaard
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: mats.randgaard @ 2010-10-22  7:00 UTC (permalink / raw)
  To: hvaibhav; +Cc: linux-media, hans.verkuil, Mats Randgaard

From: Mats Randgaard <mats.randgaard@tandberg.com>

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

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

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [RFC/PATCH 1/5] vpif_cap/disp: Add debug functionality
  2010-10-22  7:00 [RFC/PATCH 0/5] DaVinci VPIF: Support for DV preset and DV timings mats.randgaard
@ 2010-10-22  7:00 ` mats.randgaard
  2010-10-23 19:39   ` Hiremath, Vaibhav
       [not found]   ` <AANLkTikZCSmfg2o5=zzNzPGOoqZBzKYsa-mjjeQnjdAT@mail.gmail.com>
  2010-10-22  7:00 ` [RFC/PATCH 2/5] vpif: Move and extend ch_params[] mats.randgaard
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 19+ messages in thread
From: mats.randgaard @ 2010-10-22  7:00 UTC (permalink / raw)
  To: hvaibhav; +Cc: linux-media, hans.verkuil, Mats Randgaard

From: Mats Randgaard <mats.randgaard@tandberg.com>

The following functions are added to the drivers:
    - vpif_g_chip_ident
    - vpif_dbg_g_register
    - vpif_dbg_s_register
    - vpif_log_status

Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
---
 drivers/media/video/davinci/vpif_capture.c |   87 ++++++++++++++++++++++++++
 drivers/media/video/davinci/vpif_display.c |   91 ++++++++++++++++++++++++++++
 2 files changed, 178 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
index 109ab8d..34ac883 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -37,6 +37,7 @@
 #include <linux/slab.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-ioctl.h>
+#include <media/v4l2-chip-ident.h>
 
 #include "vpif_capture.h"
 #include "vpif.h"
@@ -1807,6 +1808,86 @@ static int vpif_cropcap(struct file *file, void *priv,
 	return 0;
 }
 
+/*
+ * 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);
+	return ret;
+}
+
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+/*
+ * vpif_dbg_g_register() - Read register
+ * @file: file ptr
+ * @priv: file handle
+ * @reg: register to be read
+ *
+ * Debugging only
+ * Returns zero or -EINVAL if read operations fails.
+ */
+static int vpif_dbg_g_register(struct file *file, void *priv,
+		struct v4l2_dbg_register *reg){
+	struct vpif_fh *fh = priv;
+	struct channel_obj *ch = fh->channel;
+
+	return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], core,
+			g_register, reg);
+}
+
+/*
+ * vpif_dbg_s_register() - Write to register
+ * @file: file ptr
+ * @priv: file handle
+ * @reg: register to be modified
+ *
+ * Debugging only
+ * Returns zero or -EINVAL if write operations fails.
+ */
+static int vpif_dbg_s_register(struct file *file, void *priv,
+		struct v4l2_dbg_register *reg){
+	struct vpif_fh *fh = priv;
+	struct channel_obj *ch = fh->channel;
+
+	return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], core,
+			s_register, reg);
+}
+#endif
+
+/*
+ * vpif_log_status() - Status information
+ * @file: file ptr
+ * @priv: file handle
+ *
+ * Returns zero.
+ */
+static int vpif_log_status(struct file *filep, void *priv)
+{
+	/* status for sub devices */
+	v4l2_device_call_all(&vpif_obj.v4l2_dev, 0, core, log_status);
+
+	return 0;
+}
+
 /* vpif capture ioctl operations */
 static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
 	.vidioc_querycap        	= vpif_querycap,
@@ -1829,6 +1910,12 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
 	.vidioc_streamon        	= vpif_streamon,
 	.vidioc_streamoff       	= vpif_streamoff,
 	.vidioc_cropcap         	= vpif_cropcap,
+	.vidioc_g_chip_ident		= vpif_g_chip_ident,
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+	.vidioc_g_register		= vpif_dbg_g_register,
+	.vidioc_s_register		= vpif_dbg_s_register,
+#endif
+	.vidioc_log_status		= vpif_log_status,
 };
 
 /* vpif file operations */
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
index 8894af2..b56c53a 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -38,6 +38,7 @@
 #include <media/adv7343.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-ioctl.h>
+#include <media/v4l2-chip-ident.h>
 
 #include <mach/dm646x.h>
 
@@ -1315,6 +1316,90 @@ static int vpif_s_priority(struct file *file, void *priv, enum v4l2_priority p)
 	return v4l2_prio_change(&ch->prio, &fh->prio, p);
 }
 
+
+/*
+ * vpif_g_chip_ident() - Identify the chip
+ * @file: file ptr
+ * @priv: file handle
+ * @chip: chip identity
+ *
+ * Returns zero or -EINVAL if read operations fails.
+ */
+static int vpif_g_chip_ident(struct file *file, void *priv,
+		struct v4l2_dbg_chip_ident *chip)
+{
+	int ret = 0;
+
+	chip->ident = V4L2_IDENT_NONE;
+	chip->revision = 0;
+	if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
+			chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) {
+		vpif_dbg(2, debug, "match_type is invalid.\n");
+		return -EINVAL;
+	}
+
+	if (vpif_obj.sd)
+		ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 0, core,
+				g_chip_ident, chip);
+
+	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;
+	struct video_obj *vid_ch = &ch->video;
+
+	return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], 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;
+	struct video_obj *vid_ch = &ch->video;
+
+	return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], 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 display ioctl operations */
 static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
 	.vidioc_querycap        	= vpif_querycap,
@@ -1336,6 +1421,12 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
 	.vidioc_s_output		= vpif_s_output,
 	.vidioc_g_output		= vpif_g_output,
 	.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,
 };
 
 static const struct v4l2_file_operations vpif_fops = {
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [RFC/PATCH 2/5] vpif: Move and extend ch_params[]
  2010-10-22  7:00 [RFC/PATCH 0/5] DaVinci VPIF: Support for DV preset and DV timings mats.randgaard
  2010-10-22  7:00 ` [RFC/PATCH 1/5] vpif_cap/disp: Add debug functionality mats.randgaard
@ 2010-10-22  7:00 ` mats.randgaard
  2010-10-23 19:39   ` Hiremath, Vaibhav
       [not found]   ` <AANLkTikPFd+DMXjCXf6MQeuPZDwaekny_idTsouoe1eb@mail.gmail.com>
  2010-10-22  7:00 ` [RFC/PATCH 3/5] vpif_cap/disp: Added support for DV presets mats.randgaard
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 19+ messages in thread
From: mats.randgaard @ 2010-10-22  7:00 UTC (permalink / raw)
  To: hvaibhav; +Cc: linux-media, hans.verkuil, Mats Randgaard

From: Mats Randgaard <mats.randgaard@tandberg.com>

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

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

diff --git a/drivers/media/video/davinci/vpif.c b/drivers/media/video/davinci/vpif.c
index 1f532e3..baa9462 100644
--- a/drivers/media/video/davinci/vpif.c
+++ b/drivers/media/video/davinci/vpif.c
@@ -41,6 +41,184 @@ spinlock_t vpif_lock;
 
 void __iomem *vpif_base;
 
+/**
+ * ch_params: video standard configuration parameters for vpif
+ * The table must include all presets from supported subdevices.
+ */
+const struct vpif_channel_config_params ch_params[] = {
+	/* HDTV formats */
+	{
+		.name = "480p59_94",
+		.width = 720,
+		.height = 480,
+		.frm_fmt = 1,
+		.ycmux_mode = 0,
+		.eav2sav = 138-8,
+		.sav2eav = 720,
+		.l1 = 1,
+		.l3 = 43,
+		.l5 = 523,
+		.vsize = 525,
+		.capture_format = 0,
+		.vbi_supported = 0,
+		.hd_sd = 1,
+		.dv_preset = V4L2_DV_480P59_94,
+	},
+	{
+		.name = "576p50",
+		.width = 720,
+		.height = 576,
+		.frm_fmt = 1,
+		.ycmux_mode = 0,
+		.eav2sav = 144-8,
+		.sav2eav = 720,
+		.l1 = 1,
+		.l3 = 45,
+		.l5 = 621,
+		.vsize = 625,
+		.capture_format = 0,
+		.vbi_supported = 0,
+		.hd_sd = 1,
+		.dv_preset = V4L2_DV_576P50,
+	},
+	{
+		.name = "720p50",
+		.width = 1280,
+		.height = 720,
+		.frm_fmt = 1,
+		.ycmux_mode = 0,
+		.eav2sav = 700-8,
+		.sav2eav = 1280,
+		.l1 = 1,
+		.l3 = 26,
+		.l5 = 746,
+		.vsize = 750,
+		.capture_format = 0,
+		.vbi_supported = 0,
+		.hd_sd = 1,
+		.dv_preset = V4L2_DV_720P50,
+	},
+	{
+		.name = "720p60",
+		.width = 1280,
+		.height = 720,
+		.frm_fmt = 1,
+		.ycmux_mode = 0,
+		.eav2sav = 370 - 8,
+		.sav2eav = 1280,
+		.l1 = 1,
+		.l3 = 26,
+		.l5 = 746,
+		.vsize = 750,
+		.capture_format = 0,
+		.vbi_supported = 0,
+		.hd_sd = 1,
+		.dv_preset = V4L2_DV_720P60,
+	},
+	{
+		.name = "1080I50",
+		.width = 1920,
+		.height = 1080,
+		.frm_fmt = 0,
+		.ycmux_mode = 0,
+		.eav2sav = 720 - 8,
+		.sav2eav = 1920,
+		.l1 = 1,
+		.l3 = 21,
+		.l5 = 561,
+		.l7 = 563,
+		.l9 = 584,
+		.l11 = 1124,
+		.vsize = 1125,
+		.capture_format = 0,
+		.vbi_supported = 0,
+		.hd_sd = 1,
+		.dv_preset = V4L2_DV_1080I50,
+	},
+	{
+		.name = "1080I60",
+		.width = 1920,
+		.height = 1080,
+		.frm_fmt = 0,
+		.ycmux_mode = 0,
+		.eav2sav = 280 - 8,
+		.sav2eav = 1920,
+		.l1 = 1,
+		.l3 = 21,
+		.l5 = 561,
+		.l7 = 563,
+		.l9 = 584,
+		.l11 = 1124,
+		.vsize = 1125,
+		.capture_format = 0,
+		.vbi_supported = 0,
+		.hd_sd = 1,
+		.dv_preset = V4L2_DV_1080I60,
+	},
+	{
+		.name = "1080p60",
+		.width = 1920,
+		.height = 1080,
+		.frm_fmt = 1,
+		.ycmux_mode = 0,
+		.eav2sav = 280 - 8,
+		.sav2eav = 1920,
+		.l1 = 1,
+		.l3 = 42,
+		.l5 = 1122,
+		.vsize = 1125,
+		.capture_format = 0,
+		.vbi_supported = 0,
+		.hd_sd = 1,
+		.dv_preset = V4L2_DV_1080P60,
+	},
+
+	/* SDTV formats */
+
+	{
+		.name = "NTSC_M",
+		.width = 720,
+		.height = 480,
+		.frm_fmt = 0,
+		.ycmux_mode = 1,
+		.eav2sav = 268,
+		.sav2eav = 1440,
+		.l1 = 1,
+		.l3 = 23,
+		.l5 = 263,
+		.l7 = 266,
+		.l9 = 286,
+		.l11 = 525,
+		.vsize = 525,
+		.capture_format = 0,
+		.vbi_supported = 1,
+		.hd_sd = 0,
+		.stdid = V4L2_STD_525_60,
+	},
+	{
+		.name = "PAL_BDGHIK",
+		.width = 720,
+		.height = 576,
+		.frm_fmt = 0,
+		.ycmux_mode = 1,
+		.eav2sav = 280,
+		.sav2eav = 1440,
+		.l1 = 1,
+		.l3 = 23,
+		.l5 = 311,
+		.l7 = 313,
+		.l9 = 336,
+		.l11 = 624,
+		.vsize = 625,
+		.capture_format = 0,
+		.vbi_supported = 1,
+		.hd_sd = 0,
+		.stdid = V4L2_STD_625_50,
+	},
+};
+
+const unsigned int vpif_ch_params_count = ARRAY_SIZE(ch_params);
+
 static inline void vpif_wr_bit(u32 reg, u32 bit, u32 val)
 {
 	if (val)
diff --git a/drivers/media/video/davinci/vpif.h b/drivers/media/video/davinci/vpif.h
index 188841b..b121683 100644
--- a/drivers/media/video/davinci/vpif.h
+++ b/drivers/media/video/davinci/vpif.h
@@ -577,7 +577,6 @@ 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 fps;
 	u8 frm_fmt;			/* Indicates whether this is interlaced
 					 * or progressive format */
 	u8 ycmux_mode;			/* Indicates whether this mode requires
@@ -592,8 +591,12 @@ struct vpif_channel_config_params {
 					 * supports capturing vbi or not */
 	u8 hd_sd;
 	v4l2_std_id stdid;
+	u32 dv_preset;			/* HDTV format */
 };
 
+extern const unsigned int vpif_ch_params_count;
+extern const struct vpif_channel_config_params ch_params[];
+
 struct vpif_video_params;
 struct vpif_params;
 struct vpif_vbi_params;
diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
index 34ac883..778af7e 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -82,20 +82,6 @@ static struct vpif_device vpif_obj = { {NULL} };
 static struct device *vpif_dev;
 
 /**
- * ch_params: video standard configuration parameters for vpif
- */
-static const struct vpif_channel_config_params ch_params[] = {
-	{
-		"NTSC_M", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266,
-		286, 525, 525, 0, 1, 0, V4L2_STD_525_60,
-	},
-	{
-		"PAL_BDGHIK", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311, 313,
-		336, 624, 625, 0, 1, 0, V4L2_STD_625_50,
-	},
-};
-
-/**
  * vpif_uservirt_to_phys : translate user/virtual address to phy address
  * @virtp: user/virtual address
  *
@@ -444,7 +430,7 @@ static int vpif_update_std_info(struct channel_obj *ch)
 
 	std_info = &vpifparams->std_info;
 
-	for (index = 0; index < ARRAY_SIZE(ch_params); index++) {
+	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));
@@ -453,7 +439,7 @@ static int vpif_update_std_info(struct channel_obj *ch)
 	}
 
 	/* standard not found */
-	if (index == ARRAY_SIZE(ch_params))
+	if (index == vpif_ch_params_count)
 		return -EINVAL;
 
 	common->fmt.fmt.pix.width = std_info->width;
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
index b56c53a..edfc095 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -85,17 +85,6 @@ static struct vpif_config_params config_params = {
 static struct vpif_device vpif_obj = { {NULL} };
 static struct device *vpif_dev;
 
-static const struct vpif_channel_config_params ch_params[] = {
-	{
-		"NTSC", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266,
-		286, 525, 525, 0, 1, 0, V4L2_STD_525_60,
-	},
-	{
-		"PAL", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311, 313,
-		336, 624, 625, 0, 1, 0, V4L2_STD_625_50,
-	},
-};
-
 /*
  * vpif_uservirt_to_phys: This function is used to convert user
  * space virtual address to physical address.
@@ -388,7 +377,7 @@ static int vpif_get_std_info(struct channel_obj *ch)
 	if (!std_info->stdid)
 		return -1;
 
-	for (index = 0; index < ARRAY_SIZE(ch_params); index++) {
+	for (index = 0; index < vpif_ch_params_count; index++) {
 		config = &ch_params[index];
 		if (config->stdid & std_info->stdid) {
 			memcpy(std_info, config, sizeof(*config));
@@ -396,8 +385,8 @@ static int vpif_get_std_info(struct channel_obj *ch)
 		}
 	}
 
-	if (index == ARRAY_SIZE(ch_params))
-		return -1;
+	if (index == vpif_ch_params_count)
+		return -EINVAL;
 
 	common->fmt.fmt.pix.width = std_info->width;
 	common->fmt.fmt.pix.height = std_info->height;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [RFC/PATCH 3/5] vpif_cap/disp: Added support for DV presets
  2010-10-22  7:00 [RFC/PATCH 0/5] DaVinci VPIF: Support for DV preset and DV timings mats.randgaard
  2010-10-22  7:00 ` [RFC/PATCH 1/5] vpif_cap/disp: Add debug functionality mats.randgaard
  2010-10-22  7:00 ` [RFC/PATCH 2/5] vpif: Move and extend ch_params[] mats.randgaard
@ 2010-10-22  7:00 ` mats.randgaard
  2010-10-23 19:40   ` Hiremath, Vaibhav
       [not found]   ` <AANLkTi=Q8r7RLf7d49yoQcSHHgABS=cd+3Pq45kYGATA@mail.gmail.com>
  2010-10-22  7:00 ` [RFC/PATCH 4/5] vpif_cap/disp: Added support for DV timings mats.randgaard
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 19+ messages in thread
From: mats.randgaard @ 2010-10-22  7:00 UTC (permalink / raw)
  To: hvaibhav; +Cc: linux-media, hans.verkuil, Mats Randgaard

From: Mats Randgaard <mats.randgaard@tandberg.com>

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

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

diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
index 778af7e..bf1adea 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -432,9 +432,18 @@ static int vpif_update_std_info(struct channel_obj *ch)
 
 	for (index = 0; index < vpif_ch_params_count; index++) {
 		config = &ch_params[index];
-		if (config->stdid & vid_ch->stdid) {
-			memcpy(std_info, config, sizeof(*config));
-			break;
+		if (config->hd_sd == 0) {
+			vpif_dbg(2, debug, "SD format\n");
+			if (config->stdid & vid_ch->stdid) {
+				memcpy(std_info, config, sizeof(*config));
+				break;
+			}
+		} else {
+			vpif_dbg(2, debug, "HD format\n");
+			if (config->dv_preset == vid_ch->dv_preset) {
+				memcpy(std_info, config, sizeof(*config));
+				break;
+			}
 		}
 	}
 
@@ -1442,6 +1451,7 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
 		return -ERESTARTSYS;
 
 	ch->video.stdid = *std_id;
+	ch->video.dv_preset = V4L2_DV_INVALID;
 
 	/* Get the information about the standard */
 	if (vpif_update_std_info(ch)) {
@@ -1794,6 +1804,129 @@ static int vpif_cropcap(struct file *file, void *priv,
 	return 0;
 }
 
+/**
+ * vpif_enum_dv_presets() - ENUM_DV_PRESETS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @preset: input preset
+ */
+static int vpif_enum_dv_presets(struct file *file, void *priv,
+		struct v4l2_dv_enum_preset *preset)
+{
+	struct vpif_fh *fh = priv;
+	struct channel_obj *ch = fh->channel;
+
+	if (!vpif_obj.sd) {
+		vpif_dbg(2, debug, "No sub devices registered\n");
+
+		if (preset->index >= vpif_ch_params_count)
+			return -EINVAL;
+
+		/* dv-presets only */
+		if (ch_params[preset->index].hd_sd == 0)
+			return -EINVAL;
+
+		return v4l_fill_dv_preset_info(
+				ch_params[preset->index].dv_preset, preset);
+	}
+
+	return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
+			video, enum_dv_presets, preset);
+}
+
+/**
+ * vpif_query_dv_presets() - QUERY_DV_PRESET handler
+ * @file: file ptr
+ * @priv: file handle
+ * @preset: input preset
+ */
+static int vpif_query_dv_preset(struct file *file, void *priv,
+		struct v4l2_dv_preset *preset)
+{
+	struct vpif_fh *fh = priv;
+	struct channel_obj *ch = fh->channel;
+
+	if (!vpif_obj.sd) {
+		vpif_dbg(2, debug, "No sub devices registered\n");
+		return -EINVAL;
+	}
+
+	return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
+		       video, query_dv_preset, preset);
+}
+/**
+ * vpif_s_dv_presets() - S_DV_PRESETS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @preset: input preset
+ */
+static int vpif_s_dv_preset(struct file *file, void *priv,
+		struct v4l2_dv_preset *preset)
+{
+	struct vpif_fh *fh = priv;
+	struct channel_obj *ch = fh->channel;
+	struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
+	int ret = 0;
+
+	if (common->started) {
+		vpif_err("streaming in progress\n");
+		return -EBUSY;
+	}
+
+	if ((VPIF_CHANNEL0_VIDEO == ch->channel_id) ||
+	    (VPIF_CHANNEL1_VIDEO == ch->channel_id)) {
+		if (!fh->initialized) {
+			vpif_dbg(1, debug, "Channel Busy\n");
+			return -EBUSY;
+		}
+	}
+
+	ret = v4l2_prio_check(&ch->prio, fh->prio);
+	if (ret)
+		return ret;
+
+	fh->initialized = 1;
+
+	/* Call encoder subdevice function to set the standard */
+	if (mutex_lock_interruptible(&common->lock))
+		return -ERESTARTSYS;
+
+	ch->video.dv_preset = preset->preset;
+	ch->video.stdid = V4L2_STD_UNKNOWN;
+
+	/* Get the information about the standard */
+	if (vpif_update_std_info(ch)) {
+		ret = -EINVAL;
+		vpif_err("Error getting the standard info\n");
+	} else {
+		/* Configure the default format information */
+		vpif_config_format(ch);
+
+	ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
+			video, s_dv_preset, preset);
+	}
+
+	mutex_unlock(&common->lock);
+
+	return ret;
+}
+/**
+ * vpif_g_dv_presets() - G_DV_PRESETS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @preset: input preset
+ */
+static int vpif_g_dv_preset(struct file *file, void *priv,
+		struct v4l2_dv_preset *preset)
+{
+	struct vpif_fh *fh = priv;
+	struct channel_obj *ch = fh->channel;
+
+	preset->preset = ch->video.dv_preset;
+
+	return 0;
+}
+
 /*
  * vpif_g_chip_ident() - Identify the chip
  * @file: file ptr
@@ -1896,6 +2029,10 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
 	.vidioc_streamon        	= vpif_streamon,
 	.vidioc_streamoff       	= vpif_streamoff,
 	.vidioc_cropcap         	= vpif_cropcap,
+	.vidioc_enum_dv_presets         = vpif_enum_dv_presets,
+	.vidioc_s_dv_preset             = vpif_s_dv_preset,
+	.vidioc_g_dv_preset             = vpif_g_dv_preset,
+	.vidioc_query_dv_preset         = vpif_query_dv_preset,
 	.vidioc_g_chip_ident		= vpif_g_chip_ident,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 	.vidioc_g_register		= vpif_dbg_g_register,
diff --git a/drivers/media/video/davinci/vpif_capture.h b/drivers/media/video/davinci/vpif_capture.h
index 4e12ec8..3452a8a 100644
--- a/drivers/media/video/davinci/vpif_capture.h
+++ b/drivers/media/video/davinci/vpif_capture.h
@@ -59,6 +59,7 @@ struct video_obj {
 	enum v4l2_field buf_field;
 	/* Currently selected or default standard */
 	v4l2_std_id stdid;
+	u32 dv_preset;
 	/* This is to track the last input that is passed to application */
 	u32 input_idx;
 };
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
index edfc095..4554971 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -373,15 +373,23 @@ static int vpif_get_std_info(struct channel_obj *ch)
 
 	int index;
 
-	std_info->stdid = vid_ch->stdid;
-	if (!std_info->stdid)
-		return -1;
+	if (!vid_ch->stdid && !vid_ch->dv_preset)
+		return -EINVAL;
 
 	for (index = 0; index < vpif_ch_params_count; index++) {
 		config = &ch_params[index];
-		if (config->stdid & std_info->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;
+			}
 		}
 	}
 
@@ -1305,6 +1313,102 @@ static int vpif_s_priority(struct file *file, void *priv, enum v4l2_priority p)
 	return v4l2_prio_change(&ch->prio, &fh->prio, p);
 }
 
+/**
+ * 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;
+	struct video_obj *vid_ch = &ch->video;
+
+	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);
+	}
+
+	return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],
+			video, enum_dv_presets, preset);
+}
+
+/**
+ * vpif_s_dv_presets() - S_DV_PRESETS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @preset: input preset
+ */
+static int vpif_s_dv_preset(struct file *file, void *priv,
+		struct v4l2_dv_preset *preset)
+{
+	struct vpif_fh *fh = priv;
+	struct channel_obj *ch = fh->channel;
+	struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
+	struct video_obj *vid_ch = &ch->video;
+	int ret = 0;
+
+	if (common->started) {
+		vpif_err("streaming in progress\n");
+		return -EBUSY;
+	}
+
+	ret = v4l2_prio_check(&ch->prio, fh->prio);
+	if (ret != 0)
+		return ret;
+
+	fh->initialized = 1;
+
+	/* Call encoder subdevice function to set the standard */
+	if (mutex_lock_interruptible(&common->lock))
+		return -ERESTARTSYS;
+
+	ch->video.dv_preset = preset->preset;
+	ch->video.stdid = V4L2_STD_UNKNOWN;
+
+	/* Get the information about the standard */
+	if (vpif_get_std_info(ch)) {
+		ret = -EINVAL;
+		vpif_err("Error getting the standard info\n");
+	} else {
+		/* Configure the default format information */
+		vpif_config_format(ch);
+
+		ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],
+				video, s_dv_preset, preset);
+	}
+
+	mutex_unlock(&common->lock);
+
+	return ret;
+}
+/**
+ * vpif_g_dv_presets() - G_DV_PRESETS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @preset: input preset
+ */
+static int vpif_g_dv_preset(struct file *file, void *priv,
+		struct v4l2_dv_preset *preset)
+{
+	struct vpif_fh *fh = priv;
+	struct channel_obj *ch = fh->channel;
+
+	preset->preset = ch->video.dv_preset;
+
+	return 0;
+}
 
 /*
  * vpif_g_chip_ident() - Identify the chip
@@ -1410,6 +1514,9 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
 	.vidioc_s_output		= vpif_s_output,
 	.vidioc_g_output		= vpif_g_output,
 	.vidioc_cropcap         	= vpif_cropcap,
+	.vidioc_enum_dv_presets         = vpif_enum_dv_presets,
+	.vidioc_s_dv_preset             = vpif_s_dv_preset,
+	.vidioc_g_dv_preset             = vpif_g_dv_preset,
 	.vidioc_g_chip_ident		= vpif_g_chip_ident,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 	.vidioc_g_register		= vpif_dbg_g_register,
diff --git a/drivers/media/video/davinci/vpif_display.h b/drivers/media/video/davinci/vpif_display.h
index a2a7cd1..3d56b3e 100644
--- a/drivers/media/video/davinci/vpif_display.h
+++ b/drivers/media/video/davinci/vpif_display.h
@@ -67,6 +67,7 @@ struct video_obj {
 					 * most recent displayed frame only */
 	v4l2_std_id stdid;		/* Currently selected or default
 					 * standard */
+	u32 dv_preset;
 	u32 output_id;			/* Current output id */
 };
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [RFC/PATCH 4/5] vpif_cap/disp: Added support for DV timings
  2010-10-22  7:00 [RFC/PATCH 0/5] DaVinci VPIF: Support for DV preset and DV timings mats.randgaard
                   ` (2 preceding siblings ...)
  2010-10-22  7:00 ` [RFC/PATCH 3/5] vpif_cap/disp: Added support for DV presets mats.randgaard
@ 2010-10-22  7:00 ` mats.randgaard
  2010-10-23 19:40   ` Hiremath, Vaibhav
       [not found]   ` <AANLkTikAKhfcdjwCZjvez4A7OBLyE1s7mgVKoO3ChAa=@mail.gmail.com>
  2010-10-22  7:00 ` [RFC/PATCH 5/5] vpif_cap/disp: Cleanup, improved comments mats.randgaard
       [not found] ` <AANLkTik_idAA9gmKSEvCXfQ=MP2Oe0gSi=PrUKqyoOMZ@mail.gmail.com>
  5 siblings, 2 replies; 19+ messages in thread
From: mats.randgaard @ 2010-10-22  7:00 UTC (permalink / raw)
  To: hvaibhav; +Cc: linux-media, hans.verkuil, Mats Randgaard

From: Mats Randgaard <mats.randgaard@tandberg.com>

Added functions to set and get custom DV timings.

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

diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
index bf1adea..184fa3c 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -1927,6 +1927,123 @@ static int vpif_g_dv_preset(struct file *file, void *priv,
 	return 0;
 }
 
+/**
+ * vpif_s_dv_timings() - S_DV_TIMINGS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @timings: digital video timings
+ */
+static int vpif_s_dv_timings(struct file *file, void *priv,
+		struct v4l2_dv_timings *timings)
+{
+	struct vpif_fh *fh = priv;
+	struct channel_obj *ch = fh->channel;
+	struct vpif_params *vpifparams = &ch->vpifparams;
+	struct vpif_channel_config_params *std_info = &vpifparams->std_info;
+	struct video_obj *vid_obj = &ch->video;
+	struct v4l2_bt_timings *bt = &vid_obj->bt_timings;
+	int ret;
+
+	if (timings->type != V4L2_DV_BT_656_1120) {
+		vpif_dbg(2, debug, "Timing type not defined\n");
+		return -EINVAL;
+	}
+
+	/* Configure subdevice timings, if any */
+	ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
+			video, s_dv_timings, timings);
+	if (ret == -ENOIOCTLCMD) {
+		vpif_dbg(2, debug, "Custom DV timings not supported by "
+				"subdevice\n");
+		return -EINVAL;
+	}
+	if (ret < 0) {
+		vpif_dbg(2, debug, "Error setting custom DV timings\n");
+		return ret;
+	}
+
+	if (!(timings->bt.width && timings->bt.height &&
+				(timings->bt.hbackporch ||
+				 timings->bt.hfrontporch ||
+				 timings->bt.hsync) &&
+				timings->bt.vfrontporch &&
+				(timings->bt.vbackporch ||
+				 timings->bt.vsync))) {
+		vpif_dbg(2, debug, "Timings for width, height, "
+				"horizontal back porch, horizontal sync, "
+				"horizontal front porch, vertical back porch, "
+				"vertical sync and vertical back porch "
+				"must be defined\n");
+		return -EINVAL;
+	}
+
+	*bt = timings->bt;
+
+	/* Configure videoport timings */
+
+	std_info->eav2sav = bt->hbackporch + bt->hfrontporch +
+		bt->hsync - 8;
+	std_info->sav2eav = bt->width;
+
+	std_info->l1 = 1;
+	std_info->l3 = bt->vsync + bt->vbackporch + 1;
+
+	if (bt->interlaced) {
+		if (bt->il_vbackporch || bt->il_vfrontporch || bt->il_vsync) {
+			std_info->vsize = bt->height * 2 +
+				bt->vfrontporch + bt->vsync + bt->vbackporch +
+				bt->il_vfrontporch + bt->il_vsync +
+				bt->il_vbackporch;
+			std_info->l5 = std_info->vsize/2 -
+				(bt->vfrontporch - 1);
+			std_info->l7 = std_info->vsize/2 + 1;
+			std_info->l9 = std_info->l7 + bt->il_vsync +
+				bt->il_vbackporch + 1;
+			std_info->l11 = std_info->vsize -
+				(bt->il_vfrontporch - 1);
+		} else {
+			vpif_dbg(2, debug, "Required timing values for "
+					"interlaced BT format missing\n");
+			return -EINVAL;
+		}
+	} else {
+		std_info->vsize = bt->height + bt->vfrontporch +
+			bt->vsync + bt->vbackporch;
+		std_info->l5 = std_info->vsize - (bt->vfrontporch - 1);
+	}
+	strncpy(std_info->name, "Custom timings BT656/1120", VPIF_MAX_NAME);
+	std_info->width = bt->width;
+	std_info->height = bt->height;
+	std_info->frm_fmt = bt->interlaced ? 0 : 1;
+	std_info->ycmux_mode = 0;
+	std_info->capture_format = 0;
+	std_info->vbi_supported = 0;
+	std_info->hd_sd = 1;
+	std_info->stdid = 0;
+	std_info->dv_preset = V4L2_DV_INVALID;
+
+	return 0;
+}
+
+/**
+ * vpif_g_dv_timings() - G_DV_TIMINGS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @timings: digital video timings
+ */
+static int vpif_g_dv_timings(struct file *file, void *priv,
+		struct v4l2_dv_timings *timings)
+{
+	struct vpif_fh *fh = priv;
+	struct channel_obj *ch = fh->channel;
+	struct video_obj *vid_obj = &ch->video;
+	struct v4l2_bt_timings *bt = &vid_obj->bt_timings;
+
+	timings->bt = *bt;
+
+	return 0;
+}
+
 /*
  * vpif_g_chip_ident() - Identify the chip
  * @file: file ptr
@@ -2033,6 +2150,8 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
 	.vidioc_s_dv_preset             = vpif_s_dv_preset,
 	.vidioc_g_dv_preset             = vpif_g_dv_preset,
 	.vidioc_query_dv_preset         = vpif_query_dv_preset,
+	.vidioc_s_dv_timings            = vpif_s_dv_timings,
+	.vidioc_g_dv_timings            = vpif_g_dv_timings,
 	.vidioc_g_chip_ident		= vpif_g_chip_ident,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 	.vidioc_g_register		= vpif_dbg_g_register,
diff --git a/drivers/media/video/davinci/vpif_capture.h b/drivers/media/video/davinci/vpif_capture.h
index 3452a8a..7a4196d 100644
--- a/drivers/media/video/davinci/vpif_capture.h
+++ b/drivers/media/video/davinci/vpif_capture.h
@@ -60,6 +60,7 @@ struct video_obj {
 	/* Currently selected or default standard */
 	v4l2_std_id stdid;
 	u32 dv_preset;
+	struct v4l2_bt_timings bt_timings;
 	/* This is to track the last input that is passed to application */
 	u32 input_idx;
 };
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
index 4554971..bc42505 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -1409,6 +1409,124 @@ 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;
+	struct video_obj *vid_ch = &ch->video;
+	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[vid_ch->output_id],
+			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 */
+
+	std_info->eav2sav = bt->hbackporch + bt->hfrontporch +
+		bt->hsync - 8;
+	std_info->sav2eav = bt->width;
+
+	std_info->l1 = 1;
+	std_info->l3 = bt->vsync + bt->vbackporch + 1;
+
+	if (bt->interlaced) {
+		if (bt->il_vbackporch || bt->il_vfrontporch || bt->il_vsync) {
+			std_info->vsize = bt->height * 2 +
+				bt->vfrontporch + bt->vsync + bt->vbackporch +
+				bt->il_vfrontporch + bt->il_vsync +
+				bt->il_vbackporch;
+			std_info->l5 = std_info->vsize/2 -
+				(bt->vfrontporch - 1);
+			std_info->l7 = std_info->vsize/2 + 1;
+			std_info->l9 = std_info->l7 + bt->il_vsync +
+				bt->il_vbackporch + 1;
+			std_info->l11 = std_info->vsize -
+				(bt->il_vfrontporch - 1);
+		} else {
+			vpif_dbg(2, debug, "Required timing values for "
+					"interlaced BT format missing\n");
+			return -EINVAL;
+		}
+	} else {
+		std_info->vsize = bt->height + bt->vfrontporch +
+			bt->vsync + bt->vbackporch;
+		std_info->l5 = std_info->vsize - (bt->vfrontporch - 1);
+	}
+	strncpy(std_info->name, "Custom timings BT656/1120",
+			VPIF_MAX_NAME);
+	std_info->width = bt->width;
+	std_info->height = bt->height;
+	std_info->frm_fmt = bt->interlaced ? 0 : 1;
+	std_info->ycmux_mode = 0;
+	std_info->capture_format = 0;
+	std_info->vbi_supported = 0;
+	std_info->hd_sd = 1;
+	std_info->stdid = 0;
+	std_info->dv_preset = V4L2_DV_INVALID;
+
+	return 0;
+}
+
+/**
+ * vpif_g_dv_timings() - G_DV_TIMINGS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @timings: digital video timings
+ */
+static int vpif_g_dv_timings(struct file *file, void *priv,
+		struct v4l2_dv_timings *timings)
+{
+	struct vpif_fh *fh = priv;
+	struct channel_obj *ch = fh->channel;
+	struct video_obj *vid_obj = &ch->video;
+	struct v4l2_bt_timings *bt = &vid_obj->bt_timings;
+
+	timings->bt = *bt;
+
+	return 0;
+}
 
 /*
  * vpif_g_chip_ident() - Identify the chip
@@ -1517,6 +1635,8 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
 	.vidioc_enum_dv_presets         = vpif_enum_dv_presets,
 	.vidioc_s_dv_preset             = vpif_s_dv_preset,
 	.vidioc_g_dv_preset             = vpif_g_dv_preset,
+	.vidioc_s_dv_timings            = vpif_s_dv_timings,
+	.vidioc_g_dv_timings            = vpif_g_dv_timings,
 	.vidioc_g_chip_ident		= vpif_g_chip_ident,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 	.vidioc_g_register		= vpif_dbg_g_register,
diff --git a/drivers/media/video/davinci/vpif_display.h b/drivers/media/video/davinci/vpif_display.h
index 3d56b3e..b53aaa8 100644
--- a/drivers/media/video/davinci/vpif_display.h
+++ b/drivers/media/video/davinci/vpif_display.h
@@ -68,6 +68,7 @@ struct video_obj {
 	v4l2_std_id stdid;		/* Currently selected or default
 					 * standard */
 	u32 dv_preset;
+	struct v4l2_bt_timings bt_timings;
 	u32 output_id;			/* Current output id */
 };
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [RFC/PATCH 5/5] vpif_cap/disp: Cleanup, improved comments
  2010-10-22  7:00 [RFC/PATCH 0/5] DaVinci VPIF: Support for DV preset and DV timings mats.randgaard
                   ` (3 preceding siblings ...)
  2010-10-22  7:00 ` [RFC/PATCH 4/5] vpif_cap/disp: Added support for DV timings mats.randgaard
@ 2010-10-22  7:00 ` mats.randgaard
  2010-10-23 19:39   ` Hiremath, Vaibhav
       [not found]   ` <AANLkTi=Qw4MhARWVUNaAmGxH7sFy_Wk1=sqoRVBdrbpn@mail.gmail.com>
       [not found] ` <AANLkTik_idAA9gmKSEvCXfQ=MP2Oe0gSi=PrUKqyoOMZ@mail.gmail.com>
  5 siblings, 2 replies; 19+ messages in thread
From: mats.randgaard @ 2010-10-22  7:00 UTC (permalink / raw)
  To: hvaibhav; +Cc: linux-media, hans.verkuil, Mats Randgaard

From: Mats Randgaard <mats.randgaard@tandberg.com>

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

diff --git a/drivers/media/video/davinci/vpif.h b/drivers/media/video/davinci/vpif.h
index b121683..aea7487 100644
--- a/drivers/media/video/davinci/vpif.h
+++ b/drivers/media/video/davinci/vpif.h
@@ -577,11 +577,10 @@ struct vpif_channel_config_params {
 	char name[VPIF_MAX_NAME];	/* Name of the mode */
 	u16 width;			/* Indicates width of the image */
 	u16 height;			/* Indicates height of the image */
-	u8 frm_fmt;			/* Indicates whether this is interlaced
-					 * or progressive format */
-	u8 ycmux_mode;			/* Indicates whether this mode requires
-					 * single or two channels */
-	u16 eav2sav;			/* length of sav 2 eav */
+	u8 frm_fmt;			/* Interlaced (0) or progressive (1) */
+	u8 ycmux_mode;			/* This mode requires one (0) or two (1)
+					   channels */
+	u16 eav2sav;			/* length of eav 2 sav */
 	u16 sav2eav;			/* length of sav 2 eav */
 	u16 l1, l3, l5, l7, l9, l11;	/* Other parameter configurations */
 	u16 vsize;			/* Vertical size of the image */
@@ -589,8 +588,8 @@ struct vpif_channel_config_params {
 					 * is in BT or in CCD/CMOS */
 	u8  vbi_supported;		/* Indicates whether this mode
 					 * supports capturing vbi or not */
-	u8 hd_sd;
-	v4l2_std_id stdid;
+	u8 hd_sd;			/* HDTV (1) or SDTV (0) format */
+	v4l2_std_id stdid;		/* SDTV format */
 	u32 dv_preset;			/* HDTV format */
 };
 
diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
index 184fa3c..3acc081 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -329,7 +329,7 @@ static void vpif_schedule_next_buffer(struct common_obj *common)
  * @dev_id: dev_id ptr
  *
  * It changes status of the captured buffer, takes next buffer from the queue
- * and sets its address in VPIF  registers
+ * and sets its address in VPIF registers
  */
 static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
 {
@@ -422,14 +422,12 @@ static int vpif_update_std_info(struct channel_obj *ch)
 	struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
 	struct vpif_params *vpifparams = &ch->vpifparams;
 	const struct vpif_channel_config_params *config;
-	struct vpif_channel_config_params *std_info;
+	struct vpif_channel_config_params *std_info = &vpifparams->std_info;
 	struct video_obj *vid_ch = &ch->video;
 	int index;
 
 	vpif_dbg(2, debug, "vpif_update_std_info\n");
 
-	std_info = &vpifparams->std_info;
-
 	for (index = 0; index < vpif_ch_params_count; index++) {
 		config = &ch_params[index];
 		if (config->hd_sd == 0) {
@@ -458,6 +456,7 @@ static int vpif_update_std_info(struct channel_obj *ch)
 	common->fmt.fmt.pix.bytesperline = std_info->width;
 	vpifparams->video_params.hpitch = std_info->width;
 	vpifparams->video_params.storage_mode = std_info->frm_fmt;
+
 	return 0;
 }
 
@@ -1691,7 +1690,7 @@ static int vpif_s_fmt_vid_cap(struct file *file, void *priv,
 	struct v4l2_pix_format *pixfmt;
 	int ret = 0;
 
-	vpif_dbg(2, debug, "VIDIOC_S_FMT\n");
+	vpif_dbg(2, debug, "%s\n", __func__);
 
 	/* If streaming is started, return error */
 	if (common->started) {
@@ -2356,9 +2355,9 @@ static __init int vpif_probe(struct platform_device *pdev)
 		if (vpif_obj.sd[i])
 			vpif_obj.sd[i]->grp_id = 1 << i;
 	}
-	v4l2_info(&vpif_obj.v4l2_dev, "DM646x VPIF Capture driver"
-		  " initialized\n");
 
+	v4l2_info(&vpif_obj.v4l2_dev,
+			"DM646x VPIF capture driver initialized\n");
 	return 0;
 
 probe_subdev_out:
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
index bc42505..0a7a05e 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -363,6 +363,13 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
+/**
+ * vpif_get_std_info() - update standard related info
+ * @ch: ptr to channel object
+ *
+ * For a given standard selected by application, update values
+ * in the device data structures
+ */
 static int vpif_get_std_info(struct channel_obj *ch)
 {
 	struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
@@ -566,7 +573,10 @@ static void vpif_config_addr(struct channel_obj *ch, int muxmode)
 static int vpif_mmap(struct file *filep, struct vm_area_struct *vma)
 {
 	struct vpif_fh *fh = filep->private_data;
-	struct common_obj *common = &fh->channel->common[VPIF_VIDEO_INDEX];
+	struct channel_obj *ch = fh->channel;
+	struct common_obj *common = &(ch->common[VPIF_VIDEO_INDEX]);
+
+	vpif_dbg(2, debug, "vpif_mmap\n");
 
 	return videobuf_mmap_mapper(&common->buffer_queue, vma);
 }
@@ -678,7 +688,12 @@ static int vpif_release(struct file *filep)
 }
 
 /* functions implementing ioctls */
-
+/**
+ * vpif_querycap() - QUERYCAP handler
+ * @file: file ptr
+ * @priv: file handle
+ * @cap: ptr to v4l2_capability structure
+ */
 static int vpif_querycap(struct file *file, void  *priv,
 				struct v4l2_capability *cap)
 {
@@ -1088,7 +1103,7 @@ static int vpif_streamon(struct file *file, void *priv,
 	if (ret < 0)
 		return ret;
 
-	/* Call videobuf_streamon to start streaming  in videobuf */
+	/* Call videobuf_streamon to start streaming in videobuf */
 	ret = videobuf_streamon(&common->buffer_queue);
 	if (ret < 0) {
 		vpif_err("videobuf_streamon\n");
@@ -1872,6 +1887,8 @@ static __init int vpif_probe(struct platform_device *pdev)
 			vpif_obj.sd[i]->grp_id = 1 << i;
 	}
 
+	v4l2_info(&vpif_obj.v4l2_dev,
+			"DM646x VPIF display driver initialized\n");
 	return 0;
 
 probe_subdev_out:
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* RE: [RFC/PATCH 5/5] vpif_cap/disp: Cleanup, improved comments
  2010-10-22  7:00 ` [RFC/PATCH 5/5] vpif_cap/disp: Cleanup, improved comments mats.randgaard
@ 2010-10-23 19:39   ` Hiremath, Vaibhav
       [not found]   ` <AANLkTi=Qw4MhARWVUNaAmGxH7sFy_Wk1=sqoRVBdrbpn@mail.gmail.com>
  1 sibling, 0 replies; 19+ messages in thread
From: Hiremath, Vaibhav @ 2010-10-23 19:39 UTC (permalink / raw)
  To: mats.randgaard; +Cc: linux-media, hans.verkuil


> -----Original Message-----
> From: mats.randgaard@tandberg.com [mailto:mats.randgaard@tandberg.com]
> Sent: Friday, October 22, 2010 12:31 PM
> To: Hiremath, Vaibhav
> Cc: linux-media@vger.kernel.org; hans.verkuil@tandberg.com; Mats Randgaard
> Subject: [RFC/PATCH 5/5] vpif_cap/disp: Cleanup, improved comments
> 
> From: Mats Randgaard <mats.randgaard@tandberg.com>
> 
[Hiremath, Vaibhav] Looks ok to me.

Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>

Thanks,
Vaibhav

> Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
> Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
> ---
>  drivers/media/video/davinci/vpif.h         |   13 ++++++-------
>  drivers/media/video/davinci/vpif_capture.c |   13 ++++++-------
>  drivers/media/video/davinci/vpif_display.c |   23 ++++++++++++++++++++---
>  3 files changed, 32 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/media/video/davinci/vpif.h
> b/drivers/media/video/davinci/vpif.h
> index b121683..aea7487 100644
> --- a/drivers/media/video/davinci/vpif.h
> +++ b/drivers/media/video/davinci/vpif.h
> @@ -577,11 +577,10 @@ struct vpif_channel_config_params {
>  	char name[VPIF_MAX_NAME];	/* Name of the mode */
>  	u16 width;			/* Indicates width of the image */
>  	u16 height;			/* Indicates height of the image */
> -	u8 frm_fmt;			/* Indicates whether this is interlaced
> -					 * or progressive format */
> -	u8 ycmux_mode;			/* Indicates whether this mode
> requires
> -					 * single or two channels */
> -	u16 eav2sav;			/* length of sav 2 eav */
> +	u8 frm_fmt;			/* Interlaced (0) or progressive (1) */
> +	u8 ycmux_mode;			/* This mode requires one (0) or two
> (1)
> +					   channels */
> +	u16 eav2sav;			/* length of eav 2 sav */
>  	u16 sav2eav;			/* length of sav 2 eav */
>  	u16 l1, l3, l5, l7, l9, l11;	/* Other parameter configurations */
>  	u16 vsize;			/* Vertical size of the image */
> @@ -589,8 +588,8 @@ struct vpif_channel_config_params {
>  					 * is in BT or in CCD/CMOS */
>  	u8  vbi_supported;		/* Indicates whether this mode
>  					 * supports capturing vbi or not */
> -	u8 hd_sd;
> -	v4l2_std_id stdid;
> +	u8 hd_sd;			/* HDTV (1) or SDTV (0) format */
> +	v4l2_std_id stdid;		/* SDTV format */
>  	u32 dv_preset;			/* HDTV format */
>  };
> 
> diff --git a/drivers/media/video/davinci/vpif_capture.c
> b/drivers/media/video/davinci/vpif_capture.c
> index 184fa3c..3acc081 100644
> --- a/drivers/media/video/davinci/vpif_capture.c
> +++ b/drivers/media/video/davinci/vpif_capture.c
> @@ -329,7 +329,7 @@ static void vpif_schedule_next_buffer(struct
> common_obj *common)
>   * @dev_id: dev_id ptr
>   *
>   * It changes status of the captured buffer, takes next buffer from the
> queue
> - * and sets its address in VPIF  registers
> + * and sets its address in VPIF registers
>   */
>  static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
>  {
> @@ -422,14 +422,12 @@ static int vpif_update_std_info(struct channel_obj
> *ch)
>  	struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
>  	struct vpif_params *vpifparams = &ch->vpifparams;
>  	const struct vpif_channel_config_params *config;
> -	struct vpif_channel_config_params *std_info;
> +	struct vpif_channel_config_params *std_info = &vpifparams->std_info;
>  	struct video_obj *vid_ch = &ch->video;
>  	int index;
> 
>  	vpif_dbg(2, debug, "vpif_update_std_info\n");
> 
> -	std_info = &vpifparams->std_info;
> -
>  	for (index = 0; index < vpif_ch_params_count; index++) {
>  		config = &ch_params[index];
>  		if (config->hd_sd == 0) {
> @@ -458,6 +456,7 @@ static int vpif_update_std_info(struct channel_obj
> *ch)
>  	common->fmt.fmt.pix.bytesperline = std_info->width;
>  	vpifparams->video_params.hpitch = std_info->width;
>  	vpifparams->video_params.storage_mode = std_info->frm_fmt;
> +
>  	return 0;
>  }
> 
> @@ -1691,7 +1690,7 @@ static int vpif_s_fmt_vid_cap(struct file *file,
> void *priv,
>  	struct v4l2_pix_format *pixfmt;
>  	int ret = 0;
> 
> -	vpif_dbg(2, debug, "VIDIOC_S_FMT\n");
> +	vpif_dbg(2, debug, "%s\n", __func__);
> 
>  	/* If streaming is started, return error */
>  	if (common->started) {
> @@ -2356,9 +2355,9 @@ static __init int vpif_probe(struct platform_device
> *pdev)
>  		if (vpif_obj.sd[i])
>  			vpif_obj.sd[i]->grp_id = 1 << i;
>  	}
> -	v4l2_info(&vpif_obj.v4l2_dev, "DM646x VPIF Capture driver"
> -		  " initialized\n");
> 
> +	v4l2_info(&vpif_obj.v4l2_dev,
> +			"DM646x VPIF capture driver initialized\n");
>  	return 0;
> 
>  probe_subdev_out:
> diff --git a/drivers/media/video/davinci/vpif_display.c
> b/drivers/media/video/davinci/vpif_display.c
> index bc42505..0a7a05e 100644
> --- a/drivers/media/video/davinci/vpif_display.c
> +++ b/drivers/media/video/davinci/vpif_display.c
> @@ -363,6 +363,13 @@ static irqreturn_t vpif_channel_isr(int irq, void
> *dev_id)
>  	return IRQ_HANDLED;
>  }
> 
> +/**
> + * vpif_get_std_info() - update standard related info
> + * @ch: ptr to channel object
> + *
> + * For a given standard selected by application, update values
> + * in the device data structures
> + */
>  static int vpif_get_std_info(struct channel_obj *ch)
>  {
>  	struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
> @@ -566,7 +573,10 @@ static void vpif_config_addr(struct channel_obj *ch,
> int muxmode)
>  static int vpif_mmap(struct file *filep, struct vm_area_struct *vma)
>  {
>  	struct vpif_fh *fh = filep->private_data;
> -	struct common_obj *common = &fh->channel->common[VPIF_VIDEO_INDEX];
> +	struct channel_obj *ch = fh->channel;
> +	struct common_obj *common = &(ch->common[VPIF_VIDEO_INDEX]);
> +
> +	vpif_dbg(2, debug, "vpif_mmap\n");
> 
>  	return videobuf_mmap_mapper(&common->buffer_queue, vma);
>  }
> @@ -678,7 +688,12 @@ static int vpif_release(struct file *filep)
>  }
> 
>  /* functions implementing ioctls */
> -
> +/**
> + * vpif_querycap() - QUERYCAP handler
> + * @file: file ptr
> + * @priv: file handle
> + * @cap: ptr to v4l2_capability structure
> + */
>  static int vpif_querycap(struct file *file, void  *priv,
>  				struct v4l2_capability *cap)
>  {
> @@ -1088,7 +1103,7 @@ static int vpif_streamon(struct file *file, void
> *priv,
>  	if (ret < 0)
>  		return ret;
> 
> -	/* Call videobuf_streamon to start streaming  in videobuf */
> +	/* Call videobuf_streamon to start streaming in videobuf */
>  	ret = videobuf_streamon(&common->buffer_queue);
>  	if (ret < 0) {
>  		vpif_err("videobuf_streamon\n");
> @@ -1872,6 +1887,8 @@ static __init int vpif_probe(struct platform_device
> *pdev)
>  			vpif_obj.sd[i]->grp_id = 1 << i;
>  	}
> 
> +	v4l2_info(&vpif_obj.v4l2_dev,
> +			"DM646x VPIF display driver initialized\n");
>  	return 0;
> 
>  probe_subdev_out:
> --
> 1.7.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [RFC/PATCH 1/5] vpif_cap/disp: Add debug functionality
  2010-10-22  7:00 ` [RFC/PATCH 1/5] vpif_cap/disp: Add debug functionality mats.randgaard
@ 2010-10-23 19:39   ` Hiremath, Vaibhav
       [not found]   ` <AANLkTikZCSmfg2o5=zzNzPGOoqZBzKYsa-mjjeQnjdAT@mail.gmail.com>
  1 sibling, 0 replies; 19+ messages in thread
From: Hiremath, Vaibhav @ 2010-10-23 19:39 UTC (permalink / raw)
  To: mats.randgaard; +Cc: linux-media, hans.verkuil

> -----Original Message-----
> From: mats.randgaard@tandberg.com [mailto:mats.randgaard@tandberg.com]
> Sent: Friday, October 22, 2010 12:31 PM
> To: Hiremath, Vaibhav
> Cc: linux-media@vger.kernel.org; hans.verkuil@tandberg.com; Mats Randgaard
> Subject: [RFC/PATCH 1/5] vpif_cap/disp: Add debug functionality
> 
> From: Mats Randgaard <mats.randgaard@tandberg.com>
> 
> The following functions are added to the drivers:
>     - vpif_g_chip_ident
>     - vpif_dbg_g_register
>     - vpif_dbg_s_register
>     - vpif_log_status
> 
[Hiremath, Vaibhav] Looks ok to me.

Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>

Thanks,
Vaibhav

> Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
> Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
> ---
>  drivers/media/video/davinci/vpif_capture.c |   87
> ++++++++++++++++++++++++++
>  drivers/media/video/davinci/vpif_display.c |   91
> ++++++++++++++++++++++++++++
>  2 files changed, 178 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/media/video/davinci/vpif_capture.c
> b/drivers/media/video/davinci/vpif_capture.c
> index 109ab8d..34ac883 100644
> --- a/drivers/media/video/davinci/vpif_capture.c
> +++ b/drivers/media/video/davinci/vpif_capture.c
> @@ -37,6 +37,7 @@
>  #include <linux/slab.h>
>  #include <media/v4l2-device.h>
>  #include <media/v4l2-ioctl.h>
> +#include <media/v4l2-chip-ident.h>
> 
>  #include "vpif_capture.h"
>  #include "vpif.h"
> @@ -1807,6 +1808,86 @@ static int vpif_cropcap(struct file *file, void
> *priv,
>  	return 0;
>  }
> 
> +/*
> + * 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);
> +	return ret;
> +}
> +
> +#ifdef CONFIG_VIDEO_ADV_DEBUG
> +/*
> + * vpif_dbg_g_register() - Read register
> + * @file: file ptr
> + * @priv: file handle
> + * @reg: register to be read
> + *
> + * Debugging only
> + * Returns zero or -EINVAL if read operations fails.
> + */
> +static int vpif_dbg_g_register(struct file *file, void *priv,
> +		struct v4l2_dbg_register *reg){
> +	struct vpif_fh *fh = priv;
> +	struct channel_obj *ch = fh->channel;
> +
> +	return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], core,
> +			g_register, reg);
> +}
> +
> +/*
> + * vpif_dbg_s_register() - Write to register
> + * @file: file ptr
> + * @priv: file handle
> + * @reg: register to be modified
> + *
> + * Debugging only
> + * Returns zero or -EINVAL if write operations fails.
> + */
> +static int vpif_dbg_s_register(struct file *file, void *priv,
> +		struct v4l2_dbg_register *reg){
> +	struct vpif_fh *fh = priv;
> +	struct channel_obj *ch = fh->channel;
> +
> +	return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], core,
> +			s_register, reg);
> +}
> +#endif
> +
> +/*
> + * vpif_log_status() - Status information
> + * @file: file ptr
> + * @priv: file handle
> + *
> + * Returns zero.
> + */
> +static int vpif_log_status(struct file *filep, void *priv)
> +{
> +	/* status for sub devices */
> +	v4l2_device_call_all(&vpif_obj.v4l2_dev, 0, core, log_status);
> +
> +	return 0;
> +}
> +
>  /* vpif capture ioctl operations */
>  static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
>  	.vidioc_querycap        	= vpif_querycap,
> @@ -1829,6 +1910,12 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops =
> {
>  	.vidioc_streamon        	= vpif_streamon,
>  	.vidioc_streamoff       	= vpif_streamoff,
>  	.vidioc_cropcap         	= vpif_cropcap,
> +	.vidioc_g_chip_ident		= vpif_g_chip_ident,
> +#ifdef CONFIG_VIDEO_ADV_DEBUG
> +	.vidioc_g_register		= vpif_dbg_g_register,
> +	.vidioc_s_register		= vpif_dbg_s_register,
> +#endif
> +	.vidioc_log_status		= vpif_log_status,
>  };
> 
>  /* vpif file operations */
> diff --git a/drivers/media/video/davinci/vpif_display.c
> b/drivers/media/video/davinci/vpif_display.c
> index 8894af2..b56c53a 100644
> --- a/drivers/media/video/davinci/vpif_display.c
> +++ b/drivers/media/video/davinci/vpif_display.c
> @@ -38,6 +38,7 @@
>  #include <media/adv7343.h>
>  #include <media/v4l2-device.h>
>  #include <media/v4l2-ioctl.h>
> +#include <media/v4l2-chip-ident.h>
> 
>  #include <mach/dm646x.h>
> 
> @@ -1315,6 +1316,90 @@ static int vpif_s_priority(struct file *file, void
> *priv, enum v4l2_priority p)
>  	return v4l2_prio_change(&ch->prio, &fh->prio, p);
>  }
> 
> +
> +/*
> + * vpif_g_chip_ident() - Identify the chip
> + * @file: file ptr
> + * @priv: file handle
> + * @chip: chip identity
> + *
> + * Returns zero or -EINVAL if read operations fails.
> + */
> +static int vpif_g_chip_ident(struct file *file, void *priv,
> +		struct v4l2_dbg_chip_ident *chip)
> +{
> +	int ret = 0;
> +
> +	chip->ident = V4L2_IDENT_NONE;
> +	chip->revision = 0;
> +	if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
> +			chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) {
> +		vpif_dbg(2, debug, "match_type is invalid.\n");
> +		return -EINVAL;
> +	}
> +
> +	if (vpif_obj.sd)
> +		ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 0, core,
> +				g_chip_ident, chip);
> +
> +	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;
> +	struct video_obj *vid_ch = &ch->video;
> +
> +	return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], 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;
> +	struct video_obj *vid_ch = &ch->video;
> +
> +	return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], 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 display ioctl operations */
>  static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
>  	.vidioc_querycap        	= vpif_querycap,
> @@ -1336,6 +1421,12 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops =
> {
>  	.vidioc_s_output		= vpif_s_output,
>  	.vidioc_g_output		= vpif_g_output,
>  	.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,
>  };
> 
>  static const struct v4l2_file_operations vpif_fops = {
> --
> 1.7.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [RFC/PATCH 2/5] vpif: Move and extend ch_params[]
  2010-10-22  7:00 ` [RFC/PATCH 2/5] vpif: Move and extend ch_params[] mats.randgaard
@ 2010-10-23 19:39   ` Hiremath, Vaibhav
       [not found]   ` <AANLkTikPFd+DMXjCXf6MQeuPZDwaekny_idTsouoe1eb@mail.gmail.com>
  1 sibling, 0 replies; 19+ messages in thread
From: Hiremath, Vaibhav @ 2010-10-23 19:39 UTC (permalink / raw)
  To: mats.randgaard; +Cc: linux-media, hans.verkuil


> -----Original Message-----
> From: mats.randgaard@tandberg.com [mailto:mats.randgaard@tandberg.com]
> Sent: Friday, October 22, 2010 12:31 PM
> To: Hiremath, Vaibhav
> Cc: linux-media@vger.kernel.org; hans.verkuil@tandberg.com; Mats Randgaard
> Subject: [RFC/PATCH 2/5] vpif: Move and extend ch_params[]
> 
[Hiremath, Vaibhav] I think subject line should be changed here to something like,

[RFC/PATCH 2/5] vpif: Consolidate formats from both capture and display


> From: Mats Randgaard <mats.randgaard@tandberg.com>
> 
> - The ch_params tables in vpif_capture.c and vpif_display.c are moved to a
> common
>   table in vpif.c. Then it is easier to maintain the table.
> - The new table is extended with all the DV formats supportet by TVP7002.

[Hiremath, Vaibhav] I suggest you to make this change as a part of you another patch "[RFC/PATCH 3/5] vpif_cap/disp: Added support for DV presets".

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

[Hiremath, Vaibhav] Same here.

It should be logically divided, so I propose something,

[RFC/PATCH 2/5] vpif: Consolidate formats from both capture and display
Will only do cleanup, and move the ch_params to vpif.c file.

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

This should cater to complete dv_preset enhancements.

Rest looks ok to me.

Thanks,
Vaibhav


> Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
> Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
> ---
>  drivers/media/video/davinci/vpif.c         |  178
> ++++++++++++++++++++++++++++
>  drivers/media/video/davinci/vpif.h         |    5 +-
>  drivers/media/video/davinci/vpif_capture.c |   18 +---
>  drivers/media/video/davinci/vpif_display.c |   17 +--
>  4 files changed, 187 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/media/video/davinci/vpif.c
> b/drivers/media/video/davinci/vpif.c
> index 1f532e3..baa9462 100644
> --- a/drivers/media/video/davinci/vpif.c
> +++ b/drivers/media/video/davinci/vpif.c
> @@ -41,6 +41,184 @@ spinlock_t vpif_lock;
> 
>  void __iomem *vpif_base;
> 
> +/**
> + * ch_params: video standard configuration parameters for vpif
> + * The table must include all presets from supported subdevices.
> + */
> +const struct vpif_channel_config_params ch_params[] = {
> +	/* HDTV formats */
> +	{
> +		.name = "480p59_94",
> +		.width = 720,
> +		.height = 480,
> +		.frm_fmt = 1,
> +		.ycmux_mode = 0,
> +		.eav2sav = 138-8,
> +		.sav2eav = 720,
> +		.l1 = 1,
> +		.l3 = 43,
> +		.l5 = 523,
> +		.vsize = 525,
> +		.capture_format = 0,
> +		.vbi_supported = 0,
> +		.hd_sd = 1,
> +		.dv_preset = V4L2_DV_480P59_94,
> +	},
> +	{
> +		.name = "576p50",
> +		.width = 720,
> +		.height = 576,
> +		.frm_fmt = 1,
> +		.ycmux_mode = 0,
> +		.eav2sav = 144-8,
> +		.sav2eav = 720,
> +		.l1 = 1,
> +		.l3 = 45,
> +		.l5 = 621,
> +		.vsize = 625,
> +		.capture_format = 0,
> +		.vbi_supported = 0,
> +		.hd_sd = 1,
> +		.dv_preset = V4L2_DV_576P50,
> +	},
> +	{
> +		.name = "720p50",
> +		.width = 1280,
> +		.height = 720,
> +		.frm_fmt = 1,
> +		.ycmux_mode = 0,
> +		.eav2sav = 700-8,
> +		.sav2eav = 1280,
> +		.l1 = 1,
> +		.l3 = 26,
> +		.l5 = 746,
> +		.vsize = 750,
> +		.capture_format = 0,
> +		.vbi_supported = 0,
> +		.hd_sd = 1,
> +		.dv_preset = V4L2_DV_720P50,
> +	},
> +	{
> +		.name = "720p60",
> +		.width = 1280,
> +		.height = 720,
> +		.frm_fmt = 1,
> +		.ycmux_mode = 0,
> +		.eav2sav = 370 - 8,
> +		.sav2eav = 1280,
> +		.l1 = 1,
> +		.l3 = 26,
> +		.l5 = 746,
> +		.vsize = 750,
> +		.capture_format = 0,
> +		.vbi_supported = 0,
> +		.hd_sd = 1,
> +		.dv_preset = V4L2_DV_720P60,
> +	},
> +	{
> +		.name = "1080I50",
> +		.width = 1920,
> +		.height = 1080,
> +		.frm_fmt = 0,
> +		.ycmux_mode = 0,
> +		.eav2sav = 720 - 8,
> +		.sav2eav = 1920,
> +		.l1 = 1,
> +		.l3 = 21,
> +		.l5 = 561,
> +		.l7 = 563,
> +		.l9 = 584,
> +		.l11 = 1124,
> +		.vsize = 1125,
> +		.capture_format = 0,
> +		.vbi_supported = 0,
> +		.hd_sd = 1,
> +		.dv_preset = V4L2_DV_1080I50,
> +	},
> +	{
> +		.name = "1080I60",
> +		.width = 1920,
> +		.height = 1080,
> +		.frm_fmt = 0,
> +		.ycmux_mode = 0,
> +		.eav2sav = 280 - 8,
> +		.sav2eav = 1920,
> +		.l1 = 1,
> +		.l3 = 21,
> +		.l5 = 561,
> +		.l7 = 563,
> +		.l9 = 584,
> +		.l11 = 1124,
> +		.vsize = 1125,
> +		.capture_format = 0,
> +		.vbi_supported = 0,
> +		.hd_sd = 1,
> +		.dv_preset = V4L2_DV_1080I60,
> +	},
> +	{
> +		.name = "1080p60",
> +		.width = 1920,
> +		.height = 1080,
> +		.frm_fmt = 1,
> +		.ycmux_mode = 0,
> +		.eav2sav = 280 - 8,
> +		.sav2eav = 1920,
> +		.l1 = 1,
> +		.l3 = 42,
> +		.l5 = 1122,
> +		.vsize = 1125,
> +		.capture_format = 0,
> +		.vbi_supported = 0,
> +		.hd_sd = 1,
> +		.dv_preset = V4L2_DV_1080P60,
> +	},
> +
> +	/* SDTV formats */
> +
> +	{
> +		.name = "NTSC_M",
> +		.width = 720,
> +		.height = 480,
> +		.frm_fmt = 0,
> +		.ycmux_mode = 1,
> +		.eav2sav = 268,
> +		.sav2eav = 1440,
> +		.l1 = 1,
> +		.l3 = 23,
> +		.l5 = 263,
> +		.l7 = 266,
> +		.l9 = 286,
> +		.l11 = 525,
> +		.vsize = 525,
> +		.capture_format = 0,
> +		.vbi_supported = 1,
> +		.hd_sd = 0,
> +		.stdid = V4L2_STD_525_60,
> +	},
> +	{
> +		.name = "PAL_BDGHIK",
> +		.width = 720,
> +		.height = 576,
> +		.frm_fmt = 0,
> +		.ycmux_mode = 1,
> +		.eav2sav = 280,
> +		.sav2eav = 1440,
> +		.l1 = 1,
> +		.l3 = 23,
> +		.l5 = 311,
> +		.l7 = 313,
> +		.l9 = 336,
> +		.l11 = 624,
> +		.vsize = 625,
> +		.capture_format = 0,
> +		.vbi_supported = 1,
> +		.hd_sd = 0,
> +		.stdid = V4L2_STD_625_50,
> +	},
> +};
> +
> +const unsigned int vpif_ch_params_count = ARRAY_SIZE(ch_params);
> +
>  static inline void vpif_wr_bit(u32 reg, u32 bit, u32 val)
>  {
>  	if (val)
> diff --git a/drivers/media/video/davinci/vpif.h
> b/drivers/media/video/davinci/vpif.h
> index 188841b..b121683 100644
> --- a/drivers/media/video/davinci/vpif.h
> +++ b/drivers/media/video/davinci/vpif.h
> @@ -577,7 +577,6 @@ 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 fps;
>  	u8 frm_fmt;			/* Indicates whether this is interlaced
>  					 * or progressive format */
>  	u8 ycmux_mode;			/* Indicates whether this mode
> requires
> @@ -592,8 +591,12 @@ struct vpif_channel_config_params {
>  					 * supports capturing vbi or not */
>  	u8 hd_sd;
>  	v4l2_std_id stdid;
> +	u32 dv_preset;			/* HDTV format */
>  };
> 
> +extern const unsigned int vpif_ch_params_count;
> +extern const struct vpif_channel_config_params ch_params[];
> +
>  struct vpif_video_params;
>  struct vpif_params;
>  struct vpif_vbi_params;
> diff --git a/drivers/media/video/davinci/vpif_capture.c
> b/drivers/media/video/davinci/vpif_capture.c
> index 34ac883..778af7e 100644
> --- a/drivers/media/video/davinci/vpif_capture.c
> +++ b/drivers/media/video/davinci/vpif_capture.c
> @@ -82,20 +82,6 @@ static struct vpif_device vpif_obj = { {NULL} };
>  static struct device *vpif_dev;
> 
>  /**
> - * ch_params: video standard configuration parameters for vpif
> - */
> -static const struct vpif_channel_config_params ch_params[] = {
> -	{
> -		"NTSC_M", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266,
> -		286, 525, 525, 0, 1, 0, V4L2_STD_525_60,
> -	},
> -	{
> -		"PAL_BDGHIK", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311, 313,
> -		336, 624, 625, 0, 1, 0, V4L2_STD_625_50,
> -	},
> -};
> -
> -/**
>   * vpif_uservirt_to_phys : translate user/virtual address to phy address
>   * @virtp: user/virtual address
>   *
> @@ -444,7 +430,7 @@ static int vpif_update_std_info(struct channel_obj
> *ch)
> 
>  	std_info = &vpifparams->std_info;
> 
> -	for (index = 0; index < ARRAY_SIZE(ch_params); index++) {
> +	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));
> @@ -453,7 +439,7 @@ static int vpif_update_std_info(struct channel_obj
> *ch)
>  	}
> 
>  	/* standard not found */
> -	if (index == ARRAY_SIZE(ch_params))
> +	if (index == vpif_ch_params_count)
>  		return -EINVAL;
> 
>  	common->fmt.fmt.pix.width = std_info->width;
> diff --git a/drivers/media/video/davinci/vpif_display.c
> b/drivers/media/video/davinci/vpif_display.c
> index b56c53a..edfc095 100644
> --- a/drivers/media/video/davinci/vpif_display.c
> +++ b/drivers/media/video/davinci/vpif_display.c
> @@ -85,17 +85,6 @@ static struct vpif_config_params config_params = {
>  static struct vpif_device vpif_obj = { {NULL} };
>  static struct device *vpif_dev;
> 
> -static const struct vpif_channel_config_params ch_params[] = {
> -	{
> -		"NTSC", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266,
> -		286, 525, 525, 0, 1, 0, V4L2_STD_525_60,
> -	},
> -	{
> -		"PAL", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311, 313,
> -		336, 624, 625, 0, 1, 0, V4L2_STD_625_50,
> -	},
> -};
> -
>  /*
>   * vpif_uservirt_to_phys: This function is used to convert user
>   * space virtual address to physical address.
> @@ -388,7 +377,7 @@ static int vpif_get_std_info(struct channel_obj *ch)
>  	if (!std_info->stdid)
>  		return -1;
> 
> -	for (index = 0; index < ARRAY_SIZE(ch_params); index++) {
> +	for (index = 0; index < vpif_ch_params_count; index++) {
>  		config = &ch_params[index];
>  		if (config->stdid & std_info->stdid) {
>  			memcpy(std_info, config, sizeof(*config));
> @@ -396,8 +385,8 @@ static int vpif_get_std_info(struct channel_obj *ch)
>  		}
>  	}
> 
> -	if (index == ARRAY_SIZE(ch_params))
> -		return -1;
> +	if (index == vpif_ch_params_count)
> +		return -EINVAL;
> 
>  	common->fmt.fmt.pix.width = std_info->width;
>  	common->fmt.fmt.pix.height = std_info->height;
> --
> 1.7.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [RFC/PATCH 3/5] vpif_cap/disp: Added support for DV presets
  2010-10-22  7:00 ` [RFC/PATCH 3/5] vpif_cap/disp: Added support for DV presets mats.randgaard
@ 2010-10-23 19:40   ` Hiremath, Vaibhav
  2010-10-24  7:45     ` Hans Verkuil
       [not found]   ` <AANLkTi=Q8r7RLf7d49yoQcSHHgABS=cd+3Pq45kYGATA@mail.gmail.com>
  1 sibling, 1 reply; 19+ messages in thread
From: Hiremath, Vaibhav @ 2010-10-23 19:40 UTC (permalink / raw)
  To: mats.randgaard; +Cc: linux-media, hans.verkuil


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

vpif_cap/disp: Added support for DV presets
and
vpif_cap/disp: Add support for non-subdev mode

Rest looks ok to me.

Thanks,
Vaibhav


> +	return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
> +			video, enum_dv_presets, preset);
> +}
> +
> +/**
> + * vpif_query_dv_presets() - QUERY_DV_PRESET handler
> + * @file: file ptr
> + * @priv: file handle
> + * @preset: input preset
> + */
> +static int vpif_query_dv_preset(struct file *file, void *priv,
> +		struct v4l2_dv_preset *preset)
> +{
> +	struct vpif_fh *fh = priv;
> +	struct channel_obj *ch = fh->channel;
> +
> +	if (!vpif_obj.sd) {
> +		vpif_dbg(2, debug, "No sub devices registered\n");
> +		return -EINVAL;
> +	}
> +
> +	return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
> +		       video, query_dv_preset, preset);
> +}
> +/**
> + * vpif_s_dv_presets() - S_DV_PRESETS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @preset: input preset
> + */
> +static int vpif_s_dv_preset(struct file *file, void *priv,
> +		struct v4l2_dv_preset *preset)
> +{
> +	struct vpif_fh *fh = priv;
> +	struct channel_obj *ch = fh->channel;
> +	struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
> +	int ret = 0;
> +
> +	if (common->started) {
> +		vpif_err("streaming in progress\n");
> +		return -EBUSY;
> +	}
> +
> +	if ((VPIF_CHANNEL0_VIDEO == ch->channel_id) ||
> +	    (VPIF_CHANNEL1_VIDEO == ch->channel_id)) {
> +		if (!fh->initialized) {
> +			vpif_dbg(1, debug, "Channel Busy\n");
> +			return -EBUSY;
> +		}
> +	}
> +
> +	ret = v4l2_prio_check(&ch->prio, fh->prio);
> +	if (ret)
> +		return ret;
> +
> +	fh->initialized = 1;
> +
> +	/* Call encoder subdevice function to set the standard */
> +	if (mutex_lock_interruptible(&common->lock))
> +		return -ERESTARTSYS;
> +
> +	ch->video.dv_preset = preset->preset;
> +	ch->video.stdid = V4L2_STD_UNKNOWN;
> +
> +	/* Get the information about the standard */
> +	if (vpif_update_std_info(ch)) {
> +		ret = -EINVAL;
> +		vpif_err("Error getting the standard info\n");
> +	} else {
> +		/* Configure the default format information */
> +		vpif_config_format(ch);
> +
> +	ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
> +			video, s_dv_preset, preset);
> +	}
> +
> +	mutex_unlock(&common->lock);
> +
> +	return ret;
> +}
> +/**
> + * vpif_g_dv_presets() - G_DV_PRESETS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @preset: input preset
> + */
> +static int vpif_g_dv_preset(struct file *file, void *priv,
> +		struct v4l2_dv_preset *preset)
> +{
> +	struct vpif_fh *fh = priv;
> +	struct channel_obj *ch = fh->channel;
> +
> +	preset->preset = ch->video.dv_preset;
> +
> +	return 0;
> +}
> +
>  /*
>   * vpif_g_chip_ident() - Identify the chip
>   * @file: file ptr
> @@ -1896,6 +2029,10 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops =
> {
>  	.vidioc_streamon        	= vpif_streamon,
>  	.vidioc_streamoff       	= vpif_streamoff,
>  	.vidioc_cropcap         	= vpif_cropcap,
> +	.vidioc_enum_dv_presets         = vpif_enum_dv_presets,
> +	.vidioc_s_dv_preset             = vpif_s_dv_preset,
> +	.vidioc_g_dv_preset             = vpif_g_dv_preset,
> +	.vidioc_query_dv_preset         = vpif_query_dv_preset,
>  	.vidioc_g_chip_ident		= vpif_g_chip_ident,
>  #ifdef CONFIG_VIDEO_ADV_DEBUG
>  	.vidioc_g_register		= vpif_dbg_g_register,
> diff --git a/drivers/media/video/davinci/vpif_capture.h
> b/drivers/media/video/davinci/vpif_capture.h
> index 4e12ec8..3452a8a 100644
> --- a/drivers/media/video/davinci/vpif_capture.h
> +++ b/drivers/media/video/davinci/vpif_capture.h
> @@ -59,6 +59,7 @@ struct video_obj {
>  	enum v4l2_field buf_field;
>  	/* Currently selected or default standard */
>  	v4l2_std_id stdid;
> +	u32 dv_preset;
>  	/* This is to track the last input that is passed to application */
>  	u32 input_idx;
>  };
> diff --git a/drivers/media/video/davinci/vpif_display.c
> b/drivers/media/video/davinci/vpif_display.c
> index edfc095..4554971 100644
> --- a/drivers/media/video/davinci/vpif_display.c
> +++ b/drivers/media/video/davinci/vpif_display.c
> @@ -373,15 +373,23 @@ static int vpif_get_std_info(struct channel_obj *ch)
> 
>  	int index;
> 
> -	std_info->stdid = vid_ch->stdid;
> -	if (!std_info->stdid)
> -		return -1;
> +	if (!vid_ch->stdid && !vid_ch->dv_preset)
> +		return -EINVAL;
> 
>  	for (index = 0; index < vpif_ch_params_count; index++) {
>  		config = &ch_params[index];
> -		if (config->stdid & std_info->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;
> +			}
>  		}
>  	}
> 
> @@ -1305,6 +1313,102 @@ static int vpif_s_priority(struct file *file, void
> *priv, enum v4l2_priority p)
>  	return v4l2_prio_change(&ch->prio, &fh->prio, p);
>  }
> 
> +/**
> + * 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;
> +	struct video_obj *vid_ch = &ch->video;
> +
> +	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);
> +	}
> +
> +	return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],
> +			video, enum_dv_presets, preset);
> +}
> +
> +/**
> + * vpif_s_dv_presets() - S_DV_PRESETS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @preset: input preset
> + */
> +static int vpif_s_dv_preset(struct file *file, void *priv,
> +		struct v4l2_dv_preset *preset)
> +{
> +	struct vpif_fh *fh = priv;
> +	struct channel_obj *ch = fh->channel;
> +	struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
> +	struct video_obj *vid_ch = &ch->video;
> +	int ret = 0;
> +
> +	if (common->started) {
> +		vpif_err("streaming in progress\n");
> +		return -EBUSY;
> +	}
> +
> +	ret = v4l2_prio_check(&ch->prio, fh->prio);
> +	if (ret != 0)
> +		return ret;
> +
> +	fh->initialized = 1;
> +
> +	/* Call encoder subdevice function to set the standard */
> +	if (mutex_lock_interruptible(&common->lock))
> +		return -ERESTARTSYS;
> +
> +	ch->video.dv_preset = preset->preset;
> +	ch->video.stdid = V4L2_STD_UNKNOWN;
> +
> +	/* Get the information about the standard */
> +	if (vpif_get_std_info(ch)) {
> +		ret = -EINVAL;
> +		vpif_err("Error getting the standard info\n");
> +	} else {
> +		/* Configure the default format information */
> +		vpif_config_format(ch);
> +
> +		ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],
> +				video, s_dv_preset, preset);
> +	}
> +
> +	mutex_unlock(&common->lock);
> +
> +	return ret;
> +}
> +/**
> + * vpif_g_dv_presets() - G_DV_PRESETS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @preset: input preset
> + */
> +static int vpif_g_dv_preset(struct file *file, void *priv,
> +		struct v4l2_dv_preset *preset)
> +{
> +	struct vpif_fh *fh = priv;
> +	struct channel_obj *ch = fh->channel;
> +
> +	preset->preset = ch->video.dv_preset;
> +
> +	return 0;
> +}
> 
>  /*
>   * vpif_g_chip_ident() - Identify the chip
> @@ -1410,6 +1514,9 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops =
> {
>  	.vidioc_s_output		= vpif_s_output,
>  	.vidioc_g_output		= vpif_g_output,
>  	.vidioc_cropcap         	= vpif_cropcap,
> +	.vidioc_enum_dv_presets         = vpif_enum_dv_presets,
> +	.vidioc_s_dv_preset             = vpif_s_dv_preset,
> +	.vidioc_g_dv_preset             = vpif_g_dv_preset,
>  	.vidioc_g_chip_ident		= vpif_g_chip_ident,
>  #ifdef CONFIG_VIDEO_ADV_DEBUG
>  	.vidioc_g_register		= vpif_dbg_g_register,
> diff --git a/drivers/media/video/davinci/vpif_display.h
> b/drivers/media/video/davinci/vpif_display.h
> index a2a7cd1..3d56b3e 100644
> --- a/drivers/media/video/davinci/vpif_display.h
> +++ b/drivers/media/video/davinci/vpif_display.h
> @@ -67,6 +67,7 @@ struct video_obj {
>  					 * most recent displayed frame only */
>  	v4l2_std_id stdid;		/* Currently selected or default
>  					 * standard */
> +	u32 dv_preset;
>  	u32 output_id;			/* Current output id */
>  };
> 
> --
> 1.7.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [RFC/PATCH 4/5] vpif_cap/disp: Added support for DV timings
  2010-10-22  7:00 ` [RFC/PATCH 4/5] vpif_cap/disp: Added support for DV timings mats.randgaard
@ 2010-10-23 19:40   ` Hiremath, Vaibhav
       [not found]   ` <AANLkTikAKhfcdjwCZjvez4A7OBLyE1s7mgVKoO3ChAa=@mail.gmail.com>
  1 sibling, 0 replies; 19+ messages in thread
From: Hiremath, Vaibhav @ 2010-10-23 19:40 UTC (permalink / raw)
  To: mats.randgaard; +Cc: linux-media, hans.verkuil


> -----Original Message-----
> From: mats.randgaard@tandberg.com [mailto:mats.randgaard@tandberg.com]
> Sent: Friday, October 22, 2010 12:31 PM
> To: Hiremath, Vaibhav
> Cc: linux-media@vger.kernel.org; hans.verkuil@tandberg.com; Mats Randgaard
> Subject: [RFC/PATCH 4/5] vpif_cap/disp: Added support for DV timings
> 
> From: Mats Randgaard <mats.randgaard@tandberg.com>
> 
> Added functions to set and get custom DV timings.
> 
[Hiremath, Vaibhav] Looks ok to me.

Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>

Thanks,
Vaibhav 

> Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
> Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
> ---
>  drivers/media/video/davinci/vpif_capture.c |  119
> +++++++++++++++++++++++++++
>  drivers/media/video/davinci/vpif_capture.h |    1 +
>  drivers/media/video/davinci/vpif_display.c |  120
> ++++++++++++++++++++++++++++
>  drivers/media/video/davinci/vpif_display.h |    1 +
>  4 files changed, 241 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/media/video/davinci/vpif_capture.c
> b/drivers/media/video/davinci/vpif_capture.c
> index bf1adea..184fa3c 100644
> --- a/drivers/media/video/davinci/vpif_capture.c
> +++ b/drivers/media/video/davinci/vpif_capture.c
> @@ -1927,6 +1927,123 @@ static int vpif_g_dv_preset(struct file *file,
> void *priv,
>  	return 0;
>  }
> 
> +/**
> + * vpif_s_dv_timings() - S_DV_TIMINGS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @timings: digital video timings
> + */
> +static int vpif_s_dv_timings(struct file *file, void *priv,
> +		struct v4l2_dv_timings *timings)
> +{
> +	struct vpif_fh *fh = priv;
> +	struct channel_obj *ch = fh->channel;
> +	struct vpif_params *vpifparams = &ch->vpifparams;
> +	struct vpif_channel_config_params *std_info = &vpifparams->std_info;
> +	struct video_obj *vid_obj = &ch->video;
> +	struct v4l2_bt_timings *bt = &vid_obj->bt_timings;
> +	int ret;
> +
> +	if (timings->type != V4L2_DV_BT_656_1120) {
> +		vpif_dbg(2, debug, "Timing type not defined\n");
> +		return -EINVAL;
> +	}
> +
> +	/* Configure subdevice timings, if any */
> +	ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
> +			video, s_dv_timings, timings);
> +	if (ret == -ENOIOCTLCMD) {
> +		vpif_dbg(2, debug, "Custom DV timings not supported by "
> +				"subdevice\n");
> +		return -EINVAL;
> +	}
> +	if (ret < 0) {
> +		vpif_dbg(2, debug, "Error setting custom DV timings\n");
> +		return ret;
> +	}
> +
> +	if (!(timings->bt.width && timings->bt.height &&
> +				(timings->bt.hbackporch ||
> +				 timings->bt.hfrontporch ||
> +				 timings->bt.hsync) &&
> +				timings->bt.vfrontporch &&
> +				(timings->bt.vbackporch ||
> +				 timings->bt.vsync))) {
> +		vpif_dbg(2, debug, "Timings for width, height, "
> +				"horizontal back porch, horizontal sync, "
> +				"horizontal front porch, vertical back porch, "
> +				"vertical sync and vertical back porch "
> +				"must be defined\n");
> +		return -EINVAL;
> +	}
> +
> +	*bt = timings->bt;
> +
> +	/* Configure videoport timings */
> +
> +	std_info->eav2sav = bt->hbackporch + bt->hfrontporch +
> +		bt->hsync - 8;
> +	std_info->sav2eav = bt->width;
> +
> +	std_info->l1 = 1;
> +	std_info->l3 = bt->vsync + bt->vbackporch + 1;
> +
> +	if (bt->interlaced) {
> +		if (bt->il_vbackporch || bt->il_vfrontporch || bt->il_vsync) {
> +			std_info->vsize = bt->height * 2 +
> +				bt->vfrontporch + bt->vsync + bt->vbackporch +
> +				bt->il_vfrontporch + bt->il_vsync +
> +				bt->il_vbackporch;
> +			std_info->l5 = std_info->vsize/2 -
> +				(bt->vfrontporch - 1);
> +			std_info->l7 = std_info->vsize/2 + 1;
> +			std_info->l9 = std_info->l7 + bt->il_vsync +
> +				bt->il_vbackporch + 1;
> +			std_info->l11 = std_info->vsize -
> +				(bt->il_vfrontporch - 1);
> +		} else {
> +			vpif_dbg(2, debug, "Required timing values for "
> +					"interlaced BT format missing\n");
> +			return -EINVAL;
> +		}
> +	} else {
> +		std_info->vsize = bt->height + bt->vfrontporch +
> +			bt->vsync + bt->vbackporch;
> +		std_info->l5 = std_info->vsize - (bt->vfrontporch - 1);
> +	}
> +	strncpy(std_info->name, "Custom timings BT656/1120", VPIF_MAX_NAME);
> +	std_info->width = bt->width;
> +	std_info->height = bt->height;
> +	std_info->frm_fmt = bt->interlaced ? 0 : 1;
> +	std_info->ycmux_mode = 0;
> +	std_info->capture_format = 0;
> +	std_info->vbi_supported = 0;
> +	std_info->hd_sd = 1;
> +	std_info->stdid = 0;
> +	std_info->dv_preset = V4L2_DV_INVALID;
> +
> +	return 0;
> +}
> +
> +/**
> + * vpif_g_dv_timings() - G_DV_TIMINGS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @timings: digital video timings
> + */
> +static int vpif_g_dv_timings(struct file *file, void *priv,
> +		struct v4l2_dv_timings *timings)
> +{
> +	struct vpif_fh *fh = priv;
> +	struct channel_obj *ch = fh->channel;
> +	struct video_obj *vid_obj = &ch->video;
> +	struct v4l2_bt_timings *bt = &vid_obj->bt_timings;
> +
> +	timings->bt = *bt;
> +
> +	return 0;
> +}
> +
>  /*
>   * vpif_g_chip_ident() - Identify the chip
>   * @file: file ptr
> @@ -2033,6 +2150,8 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops =
> {
>  	.vidioc_s_dv_preset             = vpif_s_dv_preset,
>  	.vidioc_g_dv_preset             = vpif_g_dv_preset,
>  	.vidioc_query_dv_preset         = vpif_query_dv_preset,
> +	.vidioc_s_dv_timings            = vpif_s_dv_timings,
> +	.vidioc_g_dv_timings            = vpif_g_dv_timings,
>  	.vidioc_g_chip_ident		= vpif_g_chip_ident,
>  #ifdef CONFIG_VIDEO_ADV_DEBUG
>  	.vidioc_g_register		= vpif_dbg_g_register,
> diff --git a/drivers/media/video/davinci/vpif_capture.h
> b/drivers/media/video/davinci/vpif_capture.h
> index 3452a8a..7a4196d 100644
> --- a/drivers/media/video/davinci/vpif_capture.h
> +++ b/drivers/media/video/davinci/vpif_capture.h
> @@ -60,6 +60,7 @@ struct video_obj {
>  	/* Currently selected or default standard */
>  	v4l2_std_id stdid;
>  	u32 dv_preset;
> +	struct v4l2_bt_timings bt_timings;
>  	/* This is to track the last input that is passed to application */
>  	u32 input_idx;
>  };
> diff --git a/drivers/media/video/davinci/vpif_display.c
> b/drivers/media/video/davinci/vpif_display.c
> index 4554971..bc42505 100644
> --- a/drivers/media/video/davinci/vpif_display.c
> +++ b/drivers/media/video/davinci/vpif_display.c
> @@ -1409,6 +1409,124 @@ 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;
> +	struct video_obj *vid_ch = &ch->video;
> +	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[vid_ch->output_id],
> +			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 */
> +
> +	std_info->eav2sav = bt->hbackporch + bt->hfrontporch +
> +		bt->hsync - 8;
> +	std_info->sav2eav = bt->width;
> +
> +	std_info->l1 = 1;
> +	std_info->l3 = bt->vsync + bt->vbackporch + 1;
> +
> +	if (bt->interlaced) {
> +		if (bt->il_vbackporch || bt->il_vfrontporch || bt->il_vsync) {
> +			std_info->vsize = bt->height * 2 +
> +				bt->vfrontporch + bt->vsync + bt->vbackporch +
> +				bt->il_vfrontporch + bt->il_vsync +
> +				bt->il_vbackporch;
> +			std_info->l5 = std_info->vsize/2 -
> +				(bt->vfrontporch - 1);
> +			std_info->l7 = std_info->vsize/2 + 1;
> +			std_info->l9 = std_info->l7 + bt->il_vsync +
> +				bt->il_vbackporch + 1;
> +			std_info->l11 = std_info->vsize -
> +				(bt->il_vfrontporch - 1);
> +		} else {
> +			vpif_dbg(2, debug, "Required timing values for "
> +					"interlaced BT format missing\n");
> +			return -EINVAL;
> +		}
> +	} else {
> +		std_info->vsize = bt->height + bt->vfrontporch +
> +			bt->vsync + bt->vbackporch;
> +		std_info->l5 = std_info->vsize - (bt->vfrontporch - 1);
> +	}
> +	strncpy(std_info->name, "Custom timings BT656/1120",
> +			VPIF_MAX_NAME);
> +	std_info->width = bt->width;
> +	std_info->height = bt->height;
> +	std_info->frm_fmt = bt->interlaced ? 0 : 1;
> +	std_info->ycmux_mode = 0;
> +	std_info->capture_format = 0;
> +	std_info->vbi_supported = 0;
> +	std_info->hd_sd = 1;
> +	std_info->stdid = 0;
> +	std_info->dv_preset = V4L2_DV_INVALID;
> +
> +	return 0;
> +}
> +
> +/**
> + * vpif_g_dv_timings() - G_DV_TIMINGS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @timings: digital video timings
> + */
> +static int vpif_g_dv_timings(struct file *file, void *priv,
> +		struct v4l2_dv_timings *timings)
> +{
> +	struct vpif_fh *fh = priv;
> +	struct channel_obj *ch = fh->channel;
> +	struct video_obj *vid_obj = &ch->video;
> +	struct v4l2_bt_timings *bt = &vid_obj->bt_timings;
> +
> +	timings->bt = *bt;
> +
> +	return 0;
> +}
> 
>  /*
>   * vpif_g_chip_ident() - Identify the chip
> @@ -1517,6 +1635,8 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops =
> {
>  	.vidioc_enum_dv_presets         = vpif_enum_dv_presets,
>  	.vidioc_s_dv_preset             = vpif_s_dv_preset,
>  	.vidioc_g_dv_preset             = vpif_g_dv_preset,
> +	.vidioc_s_dv_timings            = vpif_s_dv_timings,
> +	.vidioc_g_dv_timings            = vpif_g_dv_timings,
>  	.vidioc_g_chip_ident		= vpif_g_chip_ident,
>  #ifdef CONFIG_VIDEO_ADV_DEBUG
>  	.vidioc_g_register		= vpif_dbg_g_register,
> diff --git a/drivers/media/video/davinci/vpif_display.h
> b/drivers/media/video/davinci/vpif_display.h
> index 3d56b3e..b53aaa8 100644
> --- a/drivers/media/video/davinci/vpif_display.h
> +++ b/drivers/media/video/davinci/vpif_display.h
> @@ -68,6 +68,7 @@ struct video_obj {
>  	v4l2_std_id stdid;		/* Currently selected or default
>  					 * standard */
>  	u32 dv_preset;
> +	struct v4l2_bt_timings bt_timings;
>  	u32 output_id;			/* Current output id */
>  };
> 
> --
> 1.7.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC/PATCH 3/5] vpif_cap/disp: Added support for DV presets
  2010-10-23 19:40   ` Hiremath, Vaibhav
@ 2010-10-24  7:45     ` Hans Verkuil
  0 siblings, 0 replies; 19+ messages in thread
From: Hans Verkuil @ 2010-10-24  7:45 UTC (permalink / raw)
  To: Hiremath, Vaibhav; +Cc: mats.randgaard, linux-media, hans.verkuil

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

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

Regards,

	Hans

> 
> vpif_cap/disp: Added support for DV presets
> and
> vpif_cap/disp: Add support for non-subdev mode
> 
> Rest looks ok to me.
> 
> Thanks,
> Vaibhav
> 
> 
> > +	return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
> > +			video, enum_dv_presets, preset);
> > +}
> > +
> > +/**
> > + * vpif_query_dv_presets() - QUERY_DV_PRESET handler
> > + * @file: file ptr
> > + * @priv: file handle
> > + * @preset: input preset
> > + */
> > +static int vpif_query_dv_preset(struct file *file, void *priv,
> > +		struct v4l2_dv_preset *preset)
> > +{
> > +	struct vpif_fh *fh = priv;
> > +	struct channel_obj *ch = fh->channel;
> > +
> > +	if (!vpif_obj.sd) {
> > +		vpif_dbg(2, debug, "No sub devices registered\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
> > +		       video, query_dv_preset, preset);
> > +}
> > +/**
> > + * vpif_s_dv_presets() - S_DV_PRESETS handler
> > + * @file: file ptr
> > + * @priv: file handle
> > + * @preset: input preset
> > + */
> > +static int vpif_s_dv_preset(struct file *file, void *priv,
> > +		struct v4l2_dv_preset *preset)
> > +{
> > +	struct vpif_fh *fh = priv;
> > +	struct channel_obj *ch = fh->channel;
> > +	struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
> > +	int ret = 0;
> > +
> > +	if (common->started) {
> > +		vpif_err("streaming in progress\n");
> > +		return -EBUSY;
> > +	}
> > +
> > +	if ((VPIF_CHANNEL0_VIDEO == ch->channel_id) ||
> > +	    (VPIF_CHANNEL1_VIDEO == ch->channel_id)) {
> > +		if (!fh->initialized) {
> > +			vpif_dbg(1, debug, "Channel Busy\n");
> > +			return -EBUSY;
> > +		}
> > +	}
> > +
> > +	ret = v4l2_prio_check(&ch->prio, fh->prio);
> > +	if (ret)
> > +		return ret;
> > +
> > +	fh->initialized = 1;
> > +
> > +	/* Call encoder subdevice function to set the standard */
> > +	if (mutex_lock_interruptible(&common->lock))
> > +		return -ERESTARTSYS;
> > +
> > +	ch->video.dv_preset = preset->preset;
> > +	ch->video.stdid = V4L2_STD_UNKNOWN;
> > +
> > +	/* Get the information about the standard */
> > +	if (vpif_update_std_info(ch)) {
> > +		ret = -EINVAL;
> > +		vpif_err("Error getting the standard info\n");
> > +	} else {
> > +		/* Configure the default format information */
> > +		vpif_config_format(ch);
> > +
> > +	ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
> > +			video, s_dv_preset, preset);
> > +	}
> > +
> > +	mutex_unlock(&common->lock);
> > +
> > +	return ret;
> > +}
> > +/**
> > + * vpif_g_dv_presets() - G_DV_PRESETS handler
> > + * @file: file ptr
> > + * @priv: file handle
> > + * @preset: input preset
> > + */
> > +static int vpif_g_dv_preset(struct file *file, void *priv,
> > +		struct v4l2_dv_preset *preset)
> > +{
> > +	struct vpif_fh *fh = priv;
> > +	struct channel_obj *ch = fh->channel;
> > +
> > +	preset->preset = ch->video.dv_preset;
> > +
> > +	return 0;
> > +}
> > +
> >  /*
> >   * vpif_g_chip_ident() - Identify the chip
> >   * @file: file ptr
> > @@ -1896,6 +2029,10 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops =
> > {
> >  	.vidioc_streamon        	= vpif_streamon,
> >  	.vidioc_streamoff       	= vpif_streamoff,
> >  	.vidioc_cropcap         	= vpif_cropcap,
> > +	.vidioc_enum_dv_presets         = vpif_enum_dv_presets,
> > +	.vidioc_s_dv_preset             = vpif_s_dv_preset,
> > +	.vidioc_g_dv_preset             = vpif_g_dv_preset,
> > +	.vidioc_query_dv_preset         = vpif_query_dv_preset,
> >  	.vidioc_g_chip_ident		= vpif_g_chip_ident,
> >  #ifdef CONFIG_VIDEO_ADV_DEBUG
> >  	.vidioc_g_register		= vpif_dbg_g_register,
> > diff --git a/drivers/media/video/davinci/vpif_capture.h
> > b/drivers/media/video/davinci/vpif_capture.h
> > index 4e12ec8..3452a8a 100644
> > --- a/drivers/media/video/davinci/vpif_capture.h
> > +++ b/drivers/media/video/davinci/vpif_capture.h
> > @@ -59,6 +59,7 @@ struct video_obj {
> >  	enum v4l2_field buf_field;
> >  	/* Currently selected or default standard */
> >  	v4l2_std_id stdid;
> > +	u32 dv_preset;
> >  	/* This is to track the last input that is passed to application */
> >  	u32 input_idx;
> >  };
> > diff --git a/drivers/media/video/davinci/vpif_display.c
> > b/drivers/media/video/davinci/vpif_display.c
> > index edfc095..4554971 100644
> > --- a/drivers/media/video/davinci/vpif_display.c
> > +++ b/drivers/media/video/davinci/vpif_display.c
> > @@ -373,15 +373,23 @@ static int vpif_get_std_info(struct channel_obj *ch)
> > 
> >  	int index;
> > 
> > -	std_info->stdid = vid_ch->stdid;
> > -	if (!std_info->stdid)
> > -		return -1;
> > +	if (!vid_ch->stdid && !vid_ch->dv_preset)
> > +		return -EINVAL;
> > 
> >  	for (index = 0; index < vpif_ch_params_count; index++) {
> >  		config = &ch_params[index];
> > -		if (config->stdid & std_info->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;
> > +			}
> >  		}
> >  	}
> > 
> > @@ -1305,6 +1313,102 @@ static int vpif_s_priority(struct file *file, void
> > *priv, enum v4l2_priority p)
> >  	return v4l2_prio_change(&ch->prio, &fh->prio, p);
> >  }
> > 
> > +/**
> > + * 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;
> > +	struct video_obj *vid_ch = &ch->video;
> > +
> > +	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);
> > +	}
> > +
> > +	return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],
> > +			video, enum_dv_presets, preset);
> > +}
> > +
> > +/**
> > + * vpif_s_dv_presets() - S_DV_PRESETS handler
> > + * @file: file ptr
> > + * @priv: file handle
> > + * @preset: input preset
> > + */
> > +static int vpif_s_dv_preset(struct file *file, void *priv,
> > +		struct v4l2_dv_preset *preset)
> > +{
> > +	struct vpif_fh *fh = priv;
> > +	struct channel_obj *ch = fh->channel;
> > +	struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
> > +	struct video_obj *vid_ch = &ch->video;
> > +	int ret = 0;
> > +
> > +	if (common->started) {
> > +		vpif_err("streaming in progress\n");
> > +		return -EBUSY;
> > +	}
> > +
> > +	ret = v4l2_prio_check(&ch->prio, fh->prio);
> > +	if (ret != 0)
> > +		return ret;
> > +
> > +	fh->initialized = 1;
> > +
> > +	/* Call encoder subdevice function to set the standard */
> > +	if (mutex_lock_interruptible(&common->lock))
> > +		return -ERESTARTSYS;
> > +
> > +	ch->video.dv_preset = preset->preset;
> > +	ch->video.stdid = V4L2_STD_UNKNOWN;
> > +
> > +	/* Get the information about the standard */
> > +	if (vpif_get_std_info(ch)) {
> > +		ret = -EINVAL;
> > +		vpif_err("Error getting the standard info\n");
> > +	} else {
> > +		/* Configure the default format information */
> > +		vpif_config_format(ch);
> > +
> > +		ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],
> > +				video, s_dv_preset, preset);
> > +	}
> > +
> > +	mutex_unlock(&common->lock);
> > +
> > +	return ret;
> > +}
> > +/**
> > + * vpif_g_dv_presets() - G_DV_PRESETS handler
> > + * @file: file ptr
> > + * @priv: file handle
> > + * @preset: input preset
> > + */
> > +static int vpif_g_dv_preset(struct file *file, void *priv,
> > +		struct v4l2_dv_preset *preset)
> > +{
> > +	struct vpif_fh *fh = priv;
> > +	struct channel_obj *ch = fh->channel;
> > +
> > +	preset->preset = ch->video.dv_preset;
> > +
> > +	return 0;
> > +}
> > 
> >  /*
> >   * vpif_g_chip_ident() - Identify the chip
> > @@ -1410,6 +1514,9 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops =
> > {
> >  	.vidioc_s_output		= vpif_s_output,
> >  	.vidioc_g_output		= vpif_g_output,
> >  	.vidioc_cropcap         	= vpif_cropcap,
> > +	.vidioc_enum_dv_presets         = vpif_enum_dv_presets,
> > +	.vidioc_s_dv_preset             = vpif_s_dv_preset,
> > +	.vidioc_g_dv_preset             = vpif_g_dv_preset,
> >  	.vidioc_g_chip_ident		= vpif_g_chip_ident,
> >  #ifdef CONFIG_VIDEO_ADV_DEBUG
> >  	.vidioc_g_register		= vpif_dbg_g_register,
> > diff --git a/drivers/media/video/davinci/vpif_display.h
> > b/drivers/media/video/davinci/vpif_display.h
> > index a2a7cd1..3d56b3e 100644
> > --- a/drivers/media/video/davinci/vpif_display.h
> > +++ b/drivers/media/video/davinci/vpif_display.h
> > @@ -67,6 +67,7 @@ struct video_obj {
> >  					 * most recent displayed frame only */
> >  	v4l2_std_id stdid;		/* Currently selected or default
> >  					 * standard */
> > +	u32 dv_preset;
> >  	u32 output_id;			/* Current output id */
> >  };
> > 
> > --
> > 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC/PATCH 0/5] DaVinci VPIF: Support for DV preset and DV timings.
       [not found] ` <AANLkTik_idAA9gmKSEvCXfQ=MP2Oe0gSi=PrUKqyoOMZ@mail.gmail.com>
@ 2010-10-24 14:42   ` Muralidharan Karicheri
  0 siblings, 0 replies; 19+ messages in thread
From: Muralidharan Karicheri @ 2010-10-24 14:42 UTC (permalink / raw)
  To: mats.randgaard; +Cc: hvaibhav, linux-media, hans.verkuil

Thanks for the patch!

On Sun, Oct 24, 2010 at 9:38 AM, Muralidharan Karicheri
<mkaricheri@gmail.com> wrote:
>
> On Fri, Oct 22, 2010 at 3:00 AM, <mats.randgaard@tandberg.com> wrote:
>>
>> From: Mats Randgaard <mats.randgaard@tandberg.com>
>>
>> Support for DV preset and timings added to vpif_capture and vpif_display drivers.
>> Functions for debugging are added and the code is improved as well.
>>
>> Mats Randgaard (5):
>>  vpif_cap/disp: Add debug functionality
>>  vpif: Move and extend ch_params[]
>>  vpif_cap/disp: Added support for DV presets
>>  vpif_cap/disp: Added support for DV timings
>>  vpif_cap/disp: Cleanup, improved comments
>>
>>  drivers/media/video/davinci/vpif.c         |  178 +++++++++++++
>>  drivers/media/video/davinci/vpif.h         |   18 +-
>>  drivers/media/video/davinci/vpif_capture.c |  380 ++++++++++++++++++++++++++--
>>  drivers/media/video/davinci/vpif_capture.h |    2 +
>>  drivers/media/video/davinci/vpif_display.c |  370 +++++++++++++++++++++++++--
>>  drivers/media/video/davinci/vpif_display.h |    2 +
>>  6 files changed, 893 insertions(+), 57 deletions(-)
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> Thanks for the patch!
>
> --
> Murali Karicheri
> mkaricheri@gmail.com



--
Murali Karicheri
mkaricheri@gmail.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC/PATCH 1/5] vpif_cap/disp: Add debug functionality
       [not found]   ` <AANLkTikZCSmfg2o5=zzNzPGOoqZBzKYsa-mjjeQnjdAT@mail.gmail.com>
@ 2010-10-24 14:43     ` Muralidharan Karicheri
  0 siblings, 0 replies; 19+ messages in thread
From: Muralidharan Karicheri @ 2010-10-24 14:43 UTC (permalink / raw)
  To: mats.randgaard, linux-media

My previous reply didn't make it to linuxtv server.

See comments below.

On Sun, Oct 24, 2010 at 10:04 AM, Muralidharan Karicheri
<mkaricheri@gmail.com> wrote:
> Thanks for the patch. Please read below for my comments
>
>
>>
>> +/*
>> + * vpif_g_chip_ident() - Identify the chip
>> + * @file: file ptr
>> + * @priv: file handle
>> + * @chip: chip identity
>> + *
>> + * Returns zero or -EINVAL if read operations fails.
>> + */
>> +static int vpif_g_chip_ident(struct file *file, void *priv,
>> +               struct v4l2_dbg_chip_ident *chip)
>> +{
>> +       int ret = 0;
>> +
>> +       chip->ident = V4L2_IDENT_NONE;
>> +       chip->revision = 0;
>> +       if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
>> +                       chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) {
>> +               vpif_dbg(2, debug, "match_type is invalid.\n");
>> +               return -EINVAL;
>> +       }
>> +
>> +       if (vpif_obj.sd)
>> +               ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 0,
>> core,
>> +                               g_chip_ident, chip);
>
> I think the if check is unnecessary since probe() will fail and this device
> node will not be visible to user :)
>
>> +       return ret;
>> +}
>> +
>> +#ifdef CONFIG_VIDEO_ADV_DEBUG
>> +/*
>> + * vpif_dbg_g_register() - Read register
>> + * @file: file ptr
>> + * @priv: file handle
>> + * @reg: register to be read
>> + *
>> + * Debugging only
>> + * Returns zero or -EINVAL if read operations fails.
>> + */
>> +static int vpif_dbg_g_register(struct file *file, void *priv,
>> +               struct v4l2_dbg_register *reg){
>> +       struct vpif_fh *fh = priv;
>> +       struct channel_obj *ch = fh->channel;
>> +
>> +       return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], core,
>> +                       g_register, reg);
>>
>> +}
>> +
>> +/*
>> + * vpif_dbg_s_register() - Write to register
>> + * @file: file ptr
>> + * @priv: file handle
>> + * @reg: register to be modified
>> + *
>> + * Debugging only
>> + * Returns zero or -EINVAL if write operations fails.
>> + */
>> +static int vpif_dbg_s_register(struct file *file, void *priv,
>> +               struct v4l2_dbg_register *reg){
>> +       struct vpif_fh *fh = priv;
>> +       struct channel_obj *ch = fh->channel;
>> +
>> +       return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], core,
>> +                       s_register, reg);
>> +}
>> +#endif
>> +
>> +/*
>> + * vpif_log_status() - Status information
>> + * @file: file ptr
>> + * @priv: file handle
>> + *
>> + * Returns zero.
>> + */
>> +static int vpif_log_status(struct file *filep, void *priv)
>> +{
>> +       /* status for sub devices */
>> +       v4l2_device_call_all(&vpif_obj.v4l2_dev, 0, core, log_status);
>> +
>> +       return 0;
>> +}
>> +
>>  /* vpif capture ioctl operations */
>>  static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
>>        .vidioc_querycap                = vpif_querycap,
>> @@ -1829,6 +1910,12 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops =
>> {
>>        .vidioc_streamon                = vpif_streamon,
>>        .vidioc_streamoff               = vpif_streamoff,
>>        .vidioc_cropcap                 = vpif_cropcap,
>> +       .vidioc_g_chip_ident            = vpif_g_chip_ident,
>> +#ifdef CONFIG_VIDEO_ADV_DEBUG
>> +       .vidioc_g_register              = vpif_dbg_g_register,
>> +       .vidioc_s_register              = vpif_dbg_s_register,
>> +#endif
>> +       .vidioc_log_status              = vpif_log_status,
>>  };
>>
>>  /* vpif file operations */
>> diff --git a/drivers/media/video/davinci/vpif_display.c
>> b/drivers/media/video/davinci/vpif_display.c
>> index 8894af2..b56c53a 100644
>> --- a/drivers/media/video/davinci/vpif_display.c
>> +++ b/drivers/media/video/davinci/vpif_display.c
>> @@ -38,6 +38,7 @@
>>  #include <media/adv7343.h>
>>  #include <media/v4l2-device.h>
>>  #include <media/v4l2-ioctl.h>
>> +#include <media/v4l2-chip-ident.h>
>>
>>  #include <mach/dm646x.h>
>>
>> @@ -1315,6 +1316,90 @@ static int vpif_s_priority(struct file *file, void
>> *priv, enum v4l2_priority p)
>>        return v4l2_prio_change(&ch->prio, &fh->prio, p);
>>  }
>>
>> +
>> +/*
>> + * vpif_g_chip_ident() - Identify the chip
>> + * @file: file ptr
>> + * @priv: file handle
>> + * @chip: chip identity
>> + *
>> + * Returns zero or -EINVAL if read operations fails.
>> + */
>> +static int vpif_g_chip_ident(struct file *file, void *priv,
>> +               struct v4l2_dbg_chip_ident *chip)
>> +{
>> +       int ret = 0;
>> +
>> +       chip->ident = V4L2_IDENT_NONE;
>> +       chip->revision = 0;
>> +       if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
>> +                       chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) {
>> +               vpif_dbg(2, debug, "match_type is invalid.\n");
>> +               return -EINVAL;
>> +       }
>> +
>> +       if (vpif_obj.sd)
>> +               ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 0,
>> core,
>> +                               g_chip_ident, chip);
>> +
>
> Same comment as above
>
>
>>
>> +       return ret;
>> +}
>> +
>
> +#ifdef CONFIG_VIDEO_ADV_DEBUG
>>
>> +/*
>> + * vpif_dbg_g_register() - Read register
>> + * @file: file ptr
>> + * @priv: file handle
>> + * @reg: register to be read
>> + *
>> + * Debugging only
>> + * Returns zero or -EINVAL if read operations fails.
>> + */
>> +static 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;
>> +       struct video_obj *vid_ch = &ch->video;
>> +
>> +       return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], 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;
>> +       struct video_obj *vid_ch = &ch->video;
>> +
>> +       return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], 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 display ioctl operations */
>>  static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
>>        .vidioc_querycap                = vpif_querycap,
>> @@ -1336,6 +1421,12 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops =
>> {
>>        .vidioc_s_output                = vpif_s_output,
>>        .vidioc_g_output                = vpif_g_output,
>>        .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,
>>  };
>>
>>  static const struct v4l2_file_operations vpif_fops = {
>> --
>> 1.7.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>
>
> --
> Murali Karicheri
> mkaricheri@gmail.com
>



--
Murali Karicheri
mkaricheri@gmail.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC/PATCH 2/5] vpif: Move and extend ch_params[]
       [not found]   ` <AANLkTikPFd+DMXjCXf6MQeuPZDwaekny_idTsouoe1eb@mail.gmail.com>
@ 2010-10-24 14:44     ` Muralidharan Karicheri
  2010-10-24 14:49     ` Fwd: " Muralidharan Karicheri
  1 sibling, 0 replies; 19+ messages in thread
From: Muralidharan Karicheri @ 2010-10-24 14:44 UTC (permalink / raw)
  To: mats.randgaard, linux-media

On Sun, Oct 24, 2010 at 10:13 AM, Muralidharan Karicheri
<mkaricheri@gmail.com> wrote:
> Acked-by : Murali Karicheri <mkaricheri@gmail.com>
>
> On Fri, Oct 22, 2010 at 3:00 AM, <mats.randgaard@tandberg.com> wrote:
>>
>> From: Mats Randgaard <mats.randgaard@tandberg.com>
>>
>> - The ch_params tables in vpif_capture.c and vpif_display.c are moved to a
>> common
>>  table in vpif.c. Then it is easier to maintain the table.
>> - The new table is extended with all the DV formats supportet by TVP7002.
>> - The field "fps" is removed from the struct vpif_channel_config_params
>> because it
>>  is not used.
>> - The field "dv_preset" is added to the struct vpif_channel_config_params
>> to
>>  support DV formats.
>>
>> Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
>> Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
>> ---
>>  drivers/media/video/davinci/vpif.c         |  178
>> ++++++++++++++++++++++++++++
>>  drivers/media/video/davinci/vpif.h         |    5 +-
>>  drivers/media/video/davinci/vpif_capture.c |   18 +---
>>  drivers/media/video/davinci/vpif_display.c |   17 +--
>>  4 files changed, 187 insertions(+), 31 deletions(-)
>>
>> diff --git a/drivers/media/video/davinci/vpif.c
>> b/drivers/media/video/davinci/vpif.c
>> index 1f532e3..baa9462 100644
>> --- a/drivers/media/video/davinci/vpif.c
>> +++ b/drivers/media/video/davinci/vpif.c
>> @@ -41,6 +41,184 @@ spinlock_t vpif_lock;
>>
>>  void __iomem *vpif_base;
>>
>> +/**
>> + * ch_params: video standard configuration parameters for vpif
>> + * The table must include all presets from supported subdevices.
>> + */
>> +const struct vpif_channel_config_params ch_params[] = {
>> +       /* HDTV formats */
>> +       {
>> +               .name = "480p59_94",
>> +               .width = 720,
>> +               .height = 480,
>> +               .frm_fmt = 1,
>> +               .ycmux_mode = 0,
>> +               .eav2sav = 138-8,
>> +               .sav2eav = 720,
>> +               .l1 = 1,
>> +               .l3 = 43,
>> +               .l5 = 523,
>> +               .vsize = 525,
>> +               .capture_format = 0,
>> +               .vbi_supported = 0,
>> +               .hd_sd = 1,
>> +               .dv_preset = V4L2_DV_480P59_94,
>> +       },
>> +       {
>> +               .name = "576p50",
>> +               .width = 720,
>> +               .height = 576,
>> +               .frm_fmt = 1,
>> +               .ycmux_mode = 0,
>> +               .eav2sav = 144-8,
>> +               .sav2eav = 720,
>> +               .l1 = 1,
>> +               .l3 = 45,
>> +               .l5 = 621,
>> +               .vsize = 625,
>> +               .capture_format = 0,
>> +               .vbi_supported = 0,
>> +               .hd_sd = 1,
>> +               .dv_preset = V4L2_DV_576P50,
>> +       },
>> +       {
>> +               .name = "720p50",
>> +               .width = 1280,
>> +               .height = 720,
>> +               .frm_fmt = 1,
>> +               .ycmux_mode = 0,
>> +               .eav2sav = 700-8,
>> +               .sav2eav = 1280,
>> +               .l1 = 1,
>> +               .l3 = 26,
>> +               .l5 = 746,
>> +               .vsize = 750,
>> +               .capture_format = 0,
>> +               .vbi_supported = 0,
>> +               .hd_sd = 1,
>> +               .dv_preset = V4L2_DV_720P50,
>> +       },
>> +       {
>> +               .name = "720p60",
>> +               .width = 1280,
>> +               .height = 720,
>> +               .frm_fmt = 1,
>> +               .ycmux_mode = 0,
>> +               .eav2sav = 370 - 8,
>> +               .sav2eav = 1280,
>> +               .l1 = 1,
>> +               .l3 = 26,
>> +               .l5 = 746,
>> +               .vsize = 750,
>> +               .capture_format = 0,
>> +               .vbi_supported = 0,
>> +               .hd_sd = 1,
>> +               .dv_preset = V4L2_DV_720P60,
>> +       },
>> +       {
>> +               .name = "1080I50",
>> +               .width = 1920,
>> +               .height = 1080,
>> +               .frm_fmt = 0,
>> +               .ycmux_mode = 0,
>> +               .eav2sav = 720 - 8,
>> +               .sav2eav = 1920,
>> +               .l1 = 1,
>> +               .l3 = 21,
>> +               .l5 = 561,
>> +               .l7 = 563,
>> +               .l9 = 584,
>> +               .l11 = 1124,
>> +               .vsize = 1125,
>> +               .capture_format = 0,
>> +               .vbi_supported = 0,
>> +               .hd_sd = 1,
>> +               .dv_preset = V4L2_DV_1080I50,
>> +       },
>> +       {
>> +               .name = "1080I60",
>> +               .width = 1920,
>> +               .height = 1080,
>> +               .frm_fmt = 0,
>> +               .ycmux_mode = 0,
>> +               .eav2sav = 280 - 8,
>> +               .sav2eav = 1920,
>> +               .l1 = 1,
>> +               .l3 = 21,
>> +               .l5 = 561,
>> +               .l7 = 563,
>> +               .l9 = 584,
>> +               .l11 = 1124,
>> +               .vsize = 1125,
>> +               .capture_format = 0,
>> +               .vbi_supported = 0,
>> +               .hd_sd = 1,
>> +               .dv_preset = V4L2_DV_1080I60,
>> +       },
>> +       {
>> +               .name = "1080p60",
>> +               .width = 1920,
>> +               .height = 1080,
>> +               .frm_fmt = 1,
>> +               .ycmux_mode = 0,
>> +               .eav2sav = 280 - 8,
>> +               .sav2eav = 1920,
>> +               .l1 = 1,
>> +               .l3 = 42,
>> +               .l5 = 1122,
>> +               .vsize = 1125,
>> +               .capture_format = 0,
>> +               .vbi_supported = 0,
>> +               .hd_sd = 1,
>> +               .dv_preset = V4L2_DV_1080P60,
>> +       },
>> +
>> +       /* SDTV formats */
>> +
>> +       {
>> +               .name = "NTSC_M",
>> +               .width = 720,
>> +               .height = 480,
>> +               .frm_fmt = 0,
>> +               .ycmux_mode = 1,
>> +               .eav2sav = 268,
>> +               .sav2eav = 1440,
>> +               .l1 = 1,
>> +               .l3 = 23,
>> +               .l5 = 263,
>> +               .l7 = 266,
>> +               .l9 = 286,
>> +               .l11 = 525,
>> +               .vsize = 525,
>> +               .capture_format = 0,
>> +               .vbi_supported = 1,
>> +               .hd_sd = 0,
>> +               .stdid = V4L2_STD_525_60,
>> +       },
>> +       {
>> +               .name = "PAL_BDGHIK",
>> +               .width = 720,
>> +               .height = 576,
>> +               .frm_fmt = 0,
>> +               .ycmux_mode = 1,
>> +               .eav2sav = 280,
>> +               .sav2eav = 1440,
>> +               .l1 = 1,
>> +               .l3 = 23,
>> +               .l5 = 311,
>> +               .l7 = 313,
>> +               .l9 = 336,
>> +               .l11 = 624,
>> +               .vsize = 625,
>> +               .capture_format = 0,
>> +               .vbi_supported = 1,
>> +               .hd_sd = 0,
>> +               .stdid = V4L2_STD_625_50,
>> +       },
>> +};
>> +
>> +const unsigned int vpif_ch_params_count = ARRAY_SIZE(ch_params);
>> +
>>  static inline void vpif_wr_bit(u32 reg, u32 bit, u32 val)
>>  {
>>        if (val)
>> diff --git a/drivers/media/video/davinci/vpif.h
>> b/drivers/media/video/davinci/vpif.h
>> index 188841b..b121683 100644
>> --- a/drivers/media/video/davinci/vpif.h
>> +++ b/drivers/media/video/davinci/vpif.h
>> @@ -577,7 +577,6 @@ 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 fps;
>>        u8 frm_fmt;                     /* Indicates whether this is
>> interlaced
>>                                         * or progressive format */
>>        u8 ycmux_mode;                  /* Indicates whether this mode
>> requires
>> @@ -592,8 +591,12 @@ struct vpif_channel_config_params {
>>                                         * supports capturing vbi or not */
>>        u8 hd_sd;
>>        v4l2_std_id stdid;
>> +       u32 dv_preset;                  /* HDTV format */
>>  };
>>
>> +extern const unsigned int vpif_ch_params_count;
>> +extern const struct vpif_channel_config_params ch_params[];
>> +
>>  struct vpif_video_params;
>>  struct vpif_params;
>>  struct vpif_vbi_params;
>> diff --git a/drivers/media/video/davinci/vpif_capture.c
>> b/drivers/media/video/davinci/vpif_capture.c
>> index 34ac883..778af7e 100644
>> --- a/drivers/media/video/davinci/vpif_capture.c
>> +++ b/drivers/media/video/davinci/vpif_capture.c
>> @@ -82,20 +82,6 @@ static struct vpif_device vpif_obj = { {NULL} };
>>  static struct device *vpif_dev;
>>
>>  /**
>> - * ch_params: video standard configuration parameters for vpif
>> - */
>> -static const struct vpif_channel_config_params ch_params[] = {
>> -       {
>> -               "NTSC_M", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266,
>> -               286, 525, 525, 0, 1, 0, V4L2_STD_525_60,
>> -       },
>> -       {
>> -               "PAL_BDGHIK", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311,
>> 313,
>> -               336, 624, 625, 0, 1, 0, V4L2_STD_625_50,
>> -       },
>> -};
>> -
>> -/**
>>  * vpif_uservirt_to_phys : translate user/virtual address to phy address
>>  * @virtp: user/virtual address
>>  *
>> @@ -444,7 +430,7 @@ static int vpif_update_std_info(struct channel_obj
>> *ch)
>>
>>        std_info = &vpifparams->std_info;
>>
>> -       for (index = 0; index < ARRAY_SIZE(ch_params); index++) {
>> +       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));
>> @@ -453,7 +439,7 @@ static int vpif_update_std_info(struct channel_obj
>> *ch)
>>        }
>>
>>        /* standard not found */
>> -       if (index == ARRAY_SIZE(ch_params))
>> +       if (index == vpif_ch_params_count)
>>                return -EINVAL;
>>
>>        common->fmt.fmt.pix.width = std_info->width;
>> diff --git a/drivers/media/video/davinci/vpif_display.c
>> b/drivers/media/video/davinci/vpif_display.c
>> index b56c53a..edfc095 100644
>> --- a/drivers/media/video/davinci/vpif_display.c
>> +++ b/drivers/media/video/davinci/vpif_display.c
>> @@ -85,17 +85,6 @@ static struct vpif_config_params config_params = {
>>  static struct vpif_device vpif_obj = { {NULL} };
>>  static struct device *vpif_dev;
>>
>> -static const struct vpif_channel_config_params ch_params[] = {
>> -       {
>> -               "NTSC", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266,
>> -               286, 525, 525, 0, 1, 0, V4L2_STD_525_60,
>> -       },
>> -       {
>> -               "PAL", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311, 313,
>> -               336, 624, 625, 0, 1, 0, V4L2_STD_625_50,
>> -       },
>> -};
>> -
>>  /*
>>  * vpif_uservirt_to_phys: This function is used to convert user
>>  * space virtual address to physical address.
>> @@ -388,7 +377,7 @@ static int vpif_get_std_info(struct channel_obj *ch)
>>        if (!std_info->stdid)
>>                return -1;
>>
>> -       for (index = 0; index < ARRAY_SIZE(ch_params); index++) {
>> +       for (index = 0; index < vpif_ch_params_count; index++) {
>>                config = &ch_params[index];
>>                if (config->stdid & std_info->stdid) {
>>                        memcpy(std_info, config, sizeof(*config));
>> @@ -396,8 +385,8 @@ static int vpif_get_std_info(struct channel_obj *ch)
>>                }
>>        }
>>
>> -       if (index == ARRAY_SIZE(ch_params))
>> -               return -1;
>> +       if (index == vpif_ch_params_count)
>> +               return -EINVAL;
>>
>>        common->fmt.fmt.pix.width = std_info->width;
>>        common->fmt.fmt.pix.height = std_info->height;
>> --
>> 1.7.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>
> --
> Murali Karicheri
> mkaricheri@gmail.com
>



--
Murali Karicheri
mkaricheri@gmail.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Fwd: [RFC/PATCH 3/5] vpif_cap/disp: Added support for DV presets
       [not found]   ` <AANLkTi=Q8r7RLf7d49yoQcSHHgABS=cd+3Pq45kYGATA@mail.gmail.com>
@ 2010-10-24 14:45     ` Muralidharan Karicheri
  0 siblings, 0 replies; 19+ messages in thread
From: Muralidharan Karicheri @ 2010-10-24 14:45 UTC (permalink / raw)
  To: linux-media

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




On Fri, Oct 22, 2010 at 3:00 AM, <mats.randgaard@tandberg.com> wrote:
>
> From: Mats Randgaard <mats.randgaard@tandberg.com>
>
> Added functions to set/get/query/enum DV presets.
>
> Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
> Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
> ---
>  drivers/media/video/davinci/vpif_capture.c |  143 +++++++++++++++++++++++++++-
>  drivers/media/video/davinci/vpif_capture.h |    1 +
>  drivers/media/video/davinci/vpif_display.c |  119 ++++++++++++++++++++++-
>  drivers/media/video/davinci/vpif_display.h |    1 +
>  4 files changed, 255 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
> index 778af7e..bf1adea 100644
> --- a/drivers/media/video/davinci/vpif_capture.c
> +++ b/drivers/media/video/davinci/vpif_capture.c
> @@ -432,9 +432,18 @@ static int vpif_update_std_info(struct channel_obj *ch)
>
>        for (index = 0; index < vpif_ch_params_count; index++) {
>                config = &ch_params[index];
> -               if (config->stdid & vid_ch->stdid) {
> -                       memcpy(std_info, config, sizeof(*config));
> -                       break;
> +               if (config->hd_sd == 0) {
> +                       vpif_dbg(2, debug, "SD format\n");
> +                       if (config->stdid & vid_ch->stdid) {
> +                               memcpy(std_info, config, sizeof(*config));
> +                               break;
> +                       }
> +               } else {
> +                       vpif_dbg(2, debug, "HD format\n");
> +                       if (config->dv_preset == vid_ch->dv_preset) {
> +                               memcpy(std_info, config, sizeof(*config));
> +                               break;
> +                       }
>                }
>        }
>
> @@ -1442,6 +1451,7 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
>                return -ERESTARTSYS;
>
>        ch->video.stdid = *std_id;
> +       ch->video.dv_preset = V4L2_DV_INVALID;
>
>        /* Get the information about the standard */
>        if (vpif_update_std_info(ch)) {
> @@ -1794,6 +1804,129 @@ static int vpif_cropcap(struct file *file, void *priv,
>        return 0;
>  }
>
> +/**
> + * vpif_enum_dv_presets() - ENUM_DV_PRESETS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @preset: input preset
> + */
> +static int vpif_enum_dv_presets(struct file *file, void *priv,
> +               struct v4l2_dv_enum_preset *preset)
> +{
> +       struct vpif_fh *fh = priv;
> +       struct channel_obj *ch = fh->channel;
> +
> +       if (!vpif_obj.sd) {
> +               vpif_dbg(2, debug, "No sub devices registered\n");
> +
> +               if (preset->index >= vpif_ch_params_count)
> +                       return -EINVAL;
> +
> +               /* dv-presets only */
> +               if (ch_params[preset->index].hd_sd == 0)
> +                       return -EINVAL;
> +
> +               return v4l_fill_dv_preset_info(
> +                               ch_params[preset->index].dv_preset, preset);
> +       }


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

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

Ditto.

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

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

>
> +
> +       if ((VPIF_CHANNEL0_VIDEO == ch->channel_id) ||
> +           (VPIF_CHANNEL1_VIDEO == ch->channel_id)) {
> +               if (!fh->initialized) {
> +                       vpif_dbg(1, debug, "Channel Busy\n");
> +                       return -EBUSY;
> +               }
> +       }
> +
> +       ret = v4l2_prio_check(&ch->prio, fh->prio);
> +       if (ret)
> +               return ret;
> +
> +       fh->initialized = 1;
> +
> +       /* Call encoder subdevice function to set the standard */
> +       if (mutex_lock_interruptible(&common->lock))
> +               return -ERESTARTSYS;
> +
> +       ch->video.dv_preset = preset->preset;
> +       ch->video.stdid = V4L2_STD_UNKNOWN;
> +

Shouldn't we move the above two lines to the else part below ?

>
> +       /* Get the information about the standard */
> +       if (vpif_update_std_info(ch)) {
> +               ret = -EINVAL;
> +               vpif_err("Error getting the standard info\n");
> +       } else {
> +               /* Configure the default format information */
> +               vpif_config_format(ch);
> +
> +       ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
> +                       video, s_dv_preset, preset);
> +       }
> +
> +       mutex_unlock(&common->lock);
> +
> +       return ret;
> +}
> +/**
> + * vpif_g_dv_presets() - G_DV_PRESETS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @preset: input preset
> + */
> +static int vpif_g_dv_preset(struct file *file, void *priv,
> +               struct v4l2_dv_preset *preset)
> +{
> +       struct vpif_fh *fh = priv;
> +       struct channel_obj *ch = fh->channel;
> +
> +       preset->preset = ch->video.dv_preset;
> +
> +       return 0;
> +}
> +
>  /*
>  * vpif_g_chip_ident() - Identify the chip
>  * @file: file ptr
> @@ -1896,6 +2029,10 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
>        .vidioc_streamon                = vpif_streamon,
>        .vidioc_streamoff               = vpif_streamoff,
>        .vidioc_cropcap                 = vpif_cropcap,
> +       .vidioc_enum_dv_presets         = vpif_enum_dv_presets,
> +       .vidioc_s_dv_preset             = vpif_s_dv_preset,
> +       .vidioc_g_dv_preset             = vpif_g_dv_preset,
> +       .vidioc_query_dv_preset         = vpif_query_dv_preset,
>        .vidioc_g_chip_ident            = vpif_g_chip_ident,
>  #ifdef CONFIG_VIDEO_ADV_DEBUG
>        .vidioc_g_register              = vpif_dbg_g_register,
> diff --git a/drivers/media/video/davinci/vpif_capture.h b/drivers/media/video/davinci/vpif_capture.h
> index 4e12ec8..3452a8a 100644
> --- a/drivers/media/video/davinci/vpif_capture.h
> +++ b/drivers/media/video/davinci/vpif_capture.h
> @@ -59,6 +59,7 @@ struct video_obj {
>        enum v4l2_field buf_field;
>        /* Currently selected or default standard */
>        v4l2_std_id stdid;
> +       u32 dv_preset;
>        /* This is to track the last input that is passed to application */
>        u32 input_idx;
>  };
> diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
> index edfc095..4554971 100644
> --- a/drivers/media/video/davinci/vpif_display.c
> +++ b/drivers/media/video/davinci/vpif_display.c
> @@ -373,15 +373,23 @@ static int vpif_get_std_info(struct channel_obj *ch)
>
>        int index;
>
> -       std_info->stdid = vid_ch->stdid;
> -       if (!std_info->stdid)
> -               return -1;
> +       if (!vid_ch->stdid && !vid_ch->dv_preset)
> +               return -EINVAL;
>
>        for (index = 0; index < vpif_ch_params_count; index++) {
>                config = &ch_params[index];
> -               if (config->stdid & std_info->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;
> +                       }
>                }
>        }
>
> @@ -1305,6 +1313,102 @@ static int vpif_s_priority(struct file *file, void *priv, enum v4l2_priority p)
>        return v4l2_prio_change(&ch->prio, &fh->prio, p);
>  }
>
> +/**
> + * 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;
> +       struct video_obj *vid_ch = &ch->video;
> +
> +       if (!vpif_obj.sd) {
> +               vpif_dbg(2, debug, "No sub devices registered\n");
> +

If check not needed as mentioned before.

>
> +               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);
> +       }
> +
> +       return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],
> +                       video, enum_dv_presets, preset);
> +}
> +
> +/**
> + * vpif_s_dv_presets() - S_DV_PRESETS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @preset: input preset
> + */
> +static int vpif_s_dv_preset(struct file *file, void *priv,
> +               struct v4l2_dv_preset *preset)
> +{
> +       struct vpif_fh *fh = priv;
> +       struct channel_obj *ch = fh->channel;
> +       struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
> +       struct video_obj *vid_ch = &ch->video;
> +       int ret = 0;
> +
> +       if (common->started) {
> +               vpif_err("streaming in progress\n");

Replace vpif_err() with vpif_dbg()

>
> +               return -EBUSY;
> +       }
> +
> +       ret = v4l2_prio_check(&ch->prio, fh->prio);
> +       if (ret != 0)
> +               return ret;
> +
> +       fh->initialized = 1;
> +
> +       /* Call encoder subdevice function to set the standard */
> +       if (mutex_lock_interruptible(&common->lock))
> +               return -ERESTARTSYS;
> +
> +       ch->video.dv_preset = preset->preset;
> +       ch->video.stdid = V4L2_STD_UNKNOWN;
> +

Move this to else part below.

>
> +       /* Get the information about the standard */
> +       if (vpif_get_std_info(ch)) {
> +               ret = -EINVAL;
> +               vpif_err("Error getting the standard info\n");
> +       } else {
> +               /* Configure the default format information */
> +               vpif_config_format(ch);
> +
> +               ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],
> +                               video, s_dv_preset, preset);
> +       }
> +
> +       mutex_unlock(&common->lock);
> +
> +       return ret;
> +}
> +/**
> + * vpif_g_dv_presets() - G_DV_PRESETS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @preset: input preset
> + */
> +static int vpif_g_dv_preset(struct file *file, void *priv,
> +               struct v4l2_dv_preset *preset)
> +{
> +       struct vpif_fh *fh = priv;
> +       struct channel_obj *ch = fh->channel;
> +
> +       preset->preset = ch->video.dv_preset;
> +
> +       return 0;
> +}
>
>  /*
>  * vpif_g_chip_ident() - Identify the chip
> @@ -1410,6 +1514,9 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
>        .vidioc_s_output                = vpif_s_output,
>        .vidioc_g_output                = vpif_g_output,
>        .vidioc_cropcap                 = vpif_cropcap,
> +       .vidioc_enum_dv_presets         = vpif_enum_dv_presets,
> +       .vidioc_s_dv_preset             = vpif_s_dv_preset,
> +       .vidioc_g_dv_preset             = vpif_g_dv_preset,
>        .vidioc_g_chip_ident            = vpif_g_chip_ident,
>  #ifdef CONFIG_VIDEO_ADV_DEBUG
>        .vidioc_g_register              = vpif_dbg_g_register,
> diff --git a/drivers/media/video/davinci/vpif_display.h b/drivers/media/video/davinci/vpif_display.h
> index a2a7cd1..3d56b3e 100644
> --- a/drivers/media/video/davinci/vpif_display.h
> +++ b/drivers/media/video/davinci/vpif_display.h
> @@ -67,6 +67,7 @@ struct video_obj {
>                                         * most recent displayed frame only */
>        v4l2_std_id stdid;              /* Currently selected or default
>                                         * standard */
> +       u32 dv_preset;
>        u32 output_id;                  /* Current output id */
>  };
>
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
Murali Karicheri
mkaricheri@gmail.com



-- 
Murali Karicheri
mkaricheri@gmail.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Fwd: [RFC/PATCH 4/5] vpif_cap/disp: Added support for DV timings
       [not found]   ` <AANLkTikAKhfcdjwCZjvez4A7OBLyE1s7mgVKoO3ChAa=@mail.gmail.com>
@ 2010-10-24 14:45     ` Muralidharan Karicheri
  0 siblings, 0 replies; 19+ messages in thread
From: Muralidharan Karicheri @ 2010-10-24 14:45 UTC (permalink / raw)
  To: linux-media

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




On Fri, Oct 22, 2010 at 3:00 AM, <mats.randgaard@tandberg.com> wrote:
>
> From: Mats Randgaard <mats.randgaard@tandberg.com>
>
> Added functions to set and get custom DV timings.
>
> Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
> Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
> ---
>  drivers/media/video/davinci/vpif_capture.c |  119 +++++++++++++++++++++++++++
>  drivers/media/video/davinci/vpif_capture.h |    1 +
>  drivers/media/video/davinci/vpif_display.c |  120 ++++++++++++++++++++++++++++
>  drivers/media/video/davinci/vpif_display.h |    1 +
>  4 files changed, 241 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
> index bf1adea..184fa3c 100644
> --- a/drivers/media/video/davinci/vpif_capture.c
> +++ b/drivers/media/video/davinci/vpif_capture.c
> @@ -1927,6 +1927,123 @@ static int vpif_g_dv_preset(struct file *file, void *priv,
>        return 0;
>  }
>
> +/**
> + * vpif_s_dv_timings() - S_DV_TIMINGS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @timings: digital video timings
> + */
> +static int vpif_s_dv_timings(struct file *file, void *priv,
> +               struct v4l2_dv_timings *timings)
> +{
> +       struct vpif_fh *fh = priv;
> +       struct channel_obj *ch = fh->channel;
> +       struct vpif_params *vpifparams = &ch->vpifparams;
> +       struct vpif_channel_config_params *std_info = &vpifparams->std_info;
> +       struct video_obj *vid_obj = &ch->video;
> +       struct v4l2_bt_timings *bt = &vid_obj->bt_timings;
> +       int ret;
> +
> +       if (timings->type != V4L2_DV_BT_656_1120) {
> +               vpif_dbg(2, debug, "Timing type not defined\n");
> +               return -EINVAL;
> +       }
> +
> +       /* Configure subdevice timings, if any */
> +       ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
> +                       video, s_dv_timings, timings);
> +       if (ret == -ENOIOCTLCMD) {
> +               vpif_dbg(2, debug, "Custom DV timings not supported by "
> +                               "subdevice\n");
> +               return -EINVAL;
> +       }
> +       if (ret < 0) {
> +               vpif_dbg(2, debug, "Error setting custom DV timings\n");
> +               return ret;
> +       }
> +
> +       if (!(timings->bt.width && timings->bt.height &&
> +                               (timings->bt.hbackporch ||
> +                                timings->bt.hfrontporch ||
> +                                timings->bt.hsync) &&
> +                               timings->bt.vfrontporch &&
> +                               (timings->bt.vbackporch ||
> +                                timings->bt.vsync))) {
> +               vpif_dbg(2, debug, "Timings for width, height, "
> +                               "horizontal back porch, horizontal sync, "
> +                               "horizontal front porch, vertical back porch, "
> +                               "vertical sync and vertical back porch "
> +                               "must be defined\n");
> +               return -EINVAL;
> +       }
> +
> +       *bt = timings->bt;
> +
> +       /* Configure videoport timings */


>
> video port ?


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

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

>
> +       strncpy(std_info->name, "Custom timings BT656/1120", VPIF_MAX_NAME);
> +       std_info->width = bt->width;
> +       std_info->height = bt->height;
> +       std_info->frm_fmt = bt->interlaced ? 0 : 1;
> +       std_info->ycmux_mode = 0;
> +       std_info->capture_format = 0;
> +       std_info->vbi_supported = 0;
> +       std_info->hd_sd = 1;
> +       std_info->stdid = 0;
> +       std_info->dv_preset = V4L2_DV_INVALID;
> +
> +       return 0;
> +}
> +
> +/**
> + * vpif_g_dv_timings() - G_DV_TIMINGS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @timings: digital video timings
> + */
> +static int vpif_g_dv_timings(struct file *file, void *priv,
> +               struct v4l2_dv_timings *timings)
> +{
> +       struct vpif_fh *fh = priv;
> +       struct channel_obj *ch = fh->channel;
> +       struct video_obj *vid_obj = &ch->video;
> +       struct v4l2_bt_timings *bt = &vid_obj->bt_timings;
> +
> +       timings->bt = *bt;
> +
> +       return 0;
> +}
> +
>  /*
>  * vpif_g_chip_ident() - Identify the chip
>  * @file: file ptr
> @@ -2033,6 +2150,8 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
>        .vidioc_s_dv_preset             = vpif_s_dv_preset,
>        .vidioc_g_dv_preset             = vpif_g_dv_preset,
>        .vidioc_query_dv_preset         = vpif_query_dv_preset,
> +       .vidioc_s_dv_timings            = vpif_s_dv_timings,
> +       .vidioc_g_dv_timings            = vpif_g_dv_timings,
>        .vidioc_g_chip_ident            = vpif_g_chip_ident,
>  #ifdef CONFIG_VIDEO_ADV_DEBUG
>        .vidioc_g_register              = vpif_dbg_g_register,
> diff --git a/drivers/media/video/davinci/vpif_capture.h b/drivers/media/video/davinci/vpif_capture.h
> index 3452a8a..7a4196d 100644
> --- a/drivers/media/video/davinci/vpif_capture.h
> +++ b/drivers/media/video/davinci/vpif_capture.h
> @@ -60,6 +60,7 @@ struct video_obj {
>        /* Currently selected or default standard */
>        v4l2_std_id stdid;
>        u32 dv_preset;
> +       struct v4l2_bt_timings bt_timings;
>        /* This is to track the last input that is passed to application */
>        u32 input_idx;
>  };
> diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
> index 4554971..bc42505 100644
> --- a/drivers/media/video/davinci/vpif_display.c
> +++ b/drivers/media/video/davinci/vpif_display.c
> @@ -1409,6 +1409,124 @@ 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;
> +       struct video_obj *vid_ch = &ch->video;
> +       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[vid_ch->output_id],
> +                       video, s_dv_timings, timings);
> +       if (ret == -ENOIOCTLCMD) {
> +               vpif_dbg(2, debug, "Custom DV timings not supported by "
> +                               "subdevice\n");
> +               return -EINVAL;
> +       }
> +       if (ret < 0) {
> +               vpif_dbg(2, debug, "Error setting custom DV timings\n");
> +               return ret;
> +       }
> +
> +       if (!(timings->bt.width && timings->bt.height &&
> +                               (timings->bt.hbackporch ||
> +                                timings->bt.hfrontporch ||
> +                                timings->bt.hsync) &&
> +                               timings->bt.vfrontporch &&
> +                               (timings->bt.vbackporch ||
> +                                timings->bt.vsync))) {
> +               vpif_dbg(2, debug, "Timings for width, height, "
> +                               "horizontal back porch, horizontal sync, "
> +                               "horizontal front porch, vertical back porch, "
> +                               "vertical sync and vertical back porch "
> +                               "must be defined\n");
> +               return -EINVAL;
> +       }
> +
> +       *bt = timings->bt;
> +
> +       /* Configure videoport timings */
> +

video port?

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

If the calculation above is dependent on vpif, move this part to vpif?

>
> +       strncpy(std_info->name, "Custom timings BT656/1120",
> +                       VPIF_MAX_NAME);
> +       std_info->width = bt->width;
> +       std_info->height = bt->height;
> +       std_info->frm_fmt = bt->interlaced ? 0 : 1;
> +       std_info->ycmux_mode = 0;
> +       std_info->capture_format = 0;
> +       std_info->vbi_supported = 0;
> +       std_info->hd_sd = 1;
> +       std_info->stdid = 0;
> +       std_info->dv_preset = V4L2_DV_INVALID;
> +
> +       return 0;
> +}
> +
> +/**
> + * vpif_g_dv_timings() - G_DV_TIMINGS handler
> + * @file: file ptr
> + * @priv: file handle
> + * @timings: digital video timings
> + */
> +static int vpif_g_dv_timings(struct file *file, void *priv,
> +               struct v4l2_dv_timings *timings)
> +{
> +       struct vpif_fh *fh = priv;
> +       struct channel_obj *ch = fh->channel;
> +       struct video_obj *vid_obj = &ch->video;
> +       struct v4l2_bt_timings *bt = &vid_obj->bt_timings;
> +
> +       timings->bt = *bt;
> +
> +       return 0;
> +}
>
>  /*
>  * vpif_g_chip_ident() - Identify the chip
> @@ -1517,6 +1635,8 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
>        .vidioc_enum_dv_presets         = vpif_enum_dv_presets,
>        .vidioc_s_dv_preset             = vpif_s_dv_preset,
>        .vidioc_g_dv_preset             = vpif_g_dv_preset,
> +       .vidioc_s_dv_timings            = vpif_s_dv_timings,
> +       .vidioc_g_dv_timings            = vpif_g_dv_timings,
>        .vidioc_g_chip_ident            = vpif_g_chip_ident,
>  #ifdef CONFIG_VIDEO_ADV_DEBUG
>        .vidioc_g_register              = vpif_dbg_g_register,
> diff --git a/drivers/media/video/davinci/vpif_display.h b/drivers/media/video/davinci/vpif_display.h
> index 3d56b3e..b53aaa8 100644
> --- a/drivers/media/video/davinci/vpif_display.h
> +++ b/drivers/media/video/davinci/vpif_display.h
> @@ -68,6 +68,7 @@ struct video_obj {
>        v4l2_std_id stdid;              /* Currently selected or default
>                                         * standard */
>        u32 dv_preset;
> +       struct v4l2_bt_timings bt_timings;
>        u32 output_id;                  /* Current output id */
>  };
>
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
Murali Karicheri
mkaricheri@gmail.com



-- 
Murali Karicheri
mkaricheri@gmail.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Fwd: [RFC/PATCH 5/5] vpif_cap/disp: Cleanup, improved comments
       [not found]   ` <AANLkTi=Qw4MhARWVUNaAmGxH7sFy_Wk1=sqoRVBdrbpn@mail.gmail.com>
@ 2010-10-24 14:46     ` Muralidharan Karicheri
  0 siblings, 0 replies; 19+ messages in thread
From: Muralidharan Karicheri @ 2010-10-24 14:46 UTC (permalink / raw)
  To: linux-media

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


Acked-by: Murali Karicheri <mkaricheri@gmail.com>

On Fri, Oct 22, 2010 at 3:00 AM, <mats.randgaard@tandberg.com> wrote:
>
> From: Mats Randgaard <mats.randgaard@tandberg.com>
>
> Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
> Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
> ---
>  drivers/media/video/davinci/vpif.h         |   13 ++++++-------
>  drivers/media/video/davinci/vpif_capture.c |   13 ++++++-------
>  drivers/media/video/davinci/vpif_display.c |   23 ++++++++++++++++++++---
>  3 files changed, 32 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/media/video/davinci/vpif.h b/drivers/media/video/davinci/vpif.h
> index b121683..aea7487 100644
> --- a/drivers/media/video/davinci/vpif.h
> +++ b/drivers/media/video/davinci/vpif.h
> @@ -577,11 +577,10 @@ struct vpif_channel_config_params {
>        char name[VPIF_MAX_NAME];       /* Name of the mode */
>        u16 width;                      /* Indicates width of the image */
>        u16 height;                     /* Indicates height of the image */
> -       u8 frm_fmt;                     /* Indicates whether this is interlaced
> -                                        * or progressive format */
> -       u8 ycmux_mode;                  /* Indicates whether this mode requires
> -                                        * single or two channels */
> -       u16 eav2sav;                    /* length of sav 2 eav */
> +       u8 frm_fmt;                     /* Interlaced (0) or progressive (1) */
> +       u8 ycmux_mode;                  /* This mode requires one (0) or two (1)
> +                                          channels */
> +       u16 eav2sav;                    /* length of eav 2 sav */
>        u16 sav2eav;                    /* length of sav 2 eav */
>        u16 l1, l3, l5, l7, l9, l11;    /* Other parameter configurations */
>        u16 vsize;                      /* Vertical size of the image */
> @@ -589,8 +588,8 @@ struct vpif_channel_config_params {
>                                         * is in BT or in CCD/CMOS */
>        u8  vbi_supported;              /* Indicates whether this mode
>                                         * supports capturing vbi or not */
> -       u8 hd_sd;
> -       v4l2_std_id stdid;
> +       u8 hd_sd;                       /* HDTV (1) or SDTV (0) format */
> +       v4l2_std_id stdid;              /* SDTV format */
>        u32 dv_preset;                  /* HDTV format */
>  };
>
> diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
> index 184fa3c..3acc081 100644
> --- a/drivers/media/video/davinci/vpif_capture.c
> +++ b/drivers/media/video/davinci/vpif_capture.c
> @@ -329,7 +329,7 @@ static void vpif_schedule_next_buffer(struct common_obj *common)
>  * @dev_id: dev_id ptr
>  *
>  * It changes status of the captured buffer, takes next buffer from the queue
> - * and sets its address in VPIF  registers
> + * and sets its address in VPIF registers
>  */
>  static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
>  {
> @@ -422,14 +422,12 @@ static int vpif_update_std_info(struct channel_obj *ch)
>        struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
>        struct vpif_params *vpifparams = &ch->vpifparams;
>        const struct vpif_channel_config_params *config;
> -       struct vpif_channel_config_params *std_info;
> +       struct vpif_channel_config_params *std_info = &vpifparams->std_info;
>        struct video_obj *vid_ch = &ch->video;
>        int index;
>
>        vpif_dbg(2, debug, "vpif_update_std_info\n");
>
> -       std_info = &vpifparams->std_info;
> -
>        for (index = 0; index < vpif_ch_params_count; index++) {
>                config = &ch_params[index];
>                if (config->hd_sd == 0) {
> @@ -458,6 +456,7 @@ static int vpif_update_std_info(struct channel_obj *ch)
>        common->fmt.fmt.pix.bytesperline = std_info->width;
>        vpifparams->video_params.hpitch = std_info->width;
>        vpifparams->video_params.storage_mode = std_info->frm_fmt;
> +
>        return 0;
>  }
>
> @@ -1691,7 +1690,7 @@ static int vpif_s_fmt_vid_cap(struct file *file, void *priv,
>        struct v4l2_pix_format *pixfmt;
>        int ret = 0;
>
> -       vpif_dbg(2, debug, "VIDIOC_S_FMT\n");
> +       vpif_dbg(2, debug, "%s\n", __func__);
>
>        /* If streaming is started, return error */
>        if (common->started) {
> @@ -2356,9 +2355,9 @@ static __init int vpif_probe(struct platform_device *pdev)
>                if (vpif_obj.sd[i])
>                        vpif_obj.sd[i]->grp_id = 1 << i;
>        }
> -       v4l2_info(&vpif_obj.v4l2_dev, "DM646x VPIF Capture driver"
> -                 " initialized\n");
>
> +       v4l2_info(&vpif_obj.v4l2_dev,
> +                       "DM646x VPIF capture driver initialized\n");
>        return 0;
>
>  probe_subdev_out:
> diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
> index bc42505..0a7a05e 100644
> --- a/drivers/media/video/davinci/vpif_display.c
> +++ b/drivers/media/video/davinci/vpif_display.c
> @@ -363,6 +363,13 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
>        return IRQ_HANDLED;
>  }
>
> +/**
> + * vpif_get_std_info() - update standard related info
> + * @ch: ptr to channel object
> + *
> + * For a given standard selected by application, update values
> + * in the device data structures
> + */
>  static int vpif_get_std_info(struct channel_obj *ch)
>  {
>        struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
> @@ -566,7 +573,10 @@ static void vpif_config_addr(struct channel_obj *ch, int muxmode)
>  static int vpif_mmap(struct file *filep, struct vm_area_struct *vma)
>  {
>        struct vpif_fh *fh = filep->private_data;
> -       struct common_obj *common = &fh->channel->common[VPIF_VIDEO_INDEX];
> +       struct channel_obj *ch = fh->channel;
> +       struct common_obj *common = &(ch->common[VPIF_VIDEO_INDEX]);
> +
> +       vpif_dbg(2, debug, "vpif_mmap\n");
>
>        return videobuf_mmap_mapper(&common->buffer_queue, vma);
>  }
> @@ -678,7 +688,12 @@ static int vpif_release(struct file *filep)
>  }
>
>  /* functions implementing ioctls */
> -
> +/**
> + * vpif_querycap() - QUERYCAP handler
> + * @file: file ptr
> + * @priv: file handle
> + * @cap: ptr to v4l2_capability structure
> + */
>  static int vpif_querycap(struct file *file, void  *priv,
>                                struct v4l2_capability *cap)
>  {
> @@ -1088,7 +1103,7 @@ static int vpif_streamon(struct file *file, void *priv,
>        if (ret < 0)
>                return ret;
>
> -       /* Call videobuf_streamon to start streaming  in videobuf */
> +       /* Call videobuf_streamon to start streaming in videobuf */
>        ret = videobuf_streamon(&common->buffer_queue);
>        if (ret < 0) {
>                vpif_err("videobuf_streamon\n");
> @@ -1872,6 +1887,8 @@ static __init int vpif_probe(struct platform_device *pdev)
>                        vpif_obj.sd[i]->grp_id = 1 << i;
>        }
>
> +       v4l2_info(&vpif_obj.v4l2_dev,
> +                       "DM646x VPIF display driver initialized\n");
>        return 0;
>
>  probe_subdev_out:
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
Murali Karicheri
mkaricheri@gmail.com



-- 
Murali Karicheri
mkaricheri@gmail.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Fwd: [RFC/PATCH 2/5] vpif: Move and extend ch_params[]
       [not found]   ` <AANLkTikPFd+DMXjCXf6MQeuPZDwaekny_idTsouoe1eb@mail.gmail.com>
  2010-10-24 14:44     ` Muralidharan Karicheri
@ 2010-10-24 14:49     ` Muralidharan Karicheri
  1 sibling, 0 replies; 19+ messages in thread
From: Muralidharan Karicheri @ 2010-10-24 14:49 UTC (permalink / raw)
  To: linux-media

Sorry for the duplicate.


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


Acked-by : Murali Karicheri <mkaricheri@gmail.com>

On Fri, Oct 22, 2010 at 3:00 AM, <mats.randgaard@tandberg.com> wrote:
>
> From: Mats Randgaard <mats.randgaard@tandberg.com>
>
> - The ch_params tables in vpif_capture.c and vpif_display.c are moved to a common
>  table in vpif.c. Then it is easier to maintain the table.
> - The new table is extended with all the DV formats supportet by TVP7002.
> - The field "fps" is removed from the struct vpif_channel_config_params because it
>  is not used.
> - The field "dv_preset" is added to the struct vpif_channel_config_params to
>  support DV formats.
>
> Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
> Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
> ---
>  drivers/media/video/davinci/vpif.c         |  178 ++++++++++++++++++++++++++++
>  drivers/media/video/davinci/vpif.h         |    5 +-
>  drivers/media/video/davinci/vpif_capture.c |   18 +---
>  drivers/media/video/davinci/vpif_display.c |   17 +--
>  4 files changed, 187 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/media/video/davinci/vpif.c b/drivers/media/video/davinci/vpif.c
> index 1f532e3..baa9462 100644
> --- a/drivers/media/video/davinci/vpif.c
> +++ b/drivers/media/video/davinci/vpif.c
> @@ -41,6 +41,184 @@ spinlock_t vpif_lock;
>
>  void __iomem *vpif_base;
>
> +/**
> + * ch_params: video standard configuration parameters for vpif
> + * The table must include all presets from supported subdevices.
> + */
> +const struct vpif_channel_config_params ch_params[] = {
> +       /* HDTV formats */
> +       {
> +               .name = "480p59_94",
> +               .width = 720,
> +               .height = 480,
> +               .frm_fmt = 1,
> +               .ycmux_mode = 0,
> +               .eav2sav = 138-8,
> +               .sav2eav = 720,
> +               .l1 = 1,
> +               .l3 = 43,
> +               .l5 = 523,
> +               .vsize = 525,
> +               .capture_format = 0,
> +               .vbi_supported = 0,
> +               .hd_sd = 1,
> +               .dv_preset = V4L2_DV_480P59_94,
> +       },
> +       {
> +               .name = "576p50",
> +               .width = 720,
> +               .height = 576,
> +               .frm_fmt = 1,
> +               .ycmux_mode = 0,
> +               .eav2sav = 144-8,
> +               .sav2eav = 720,
> +               .l1 = 1,
> +               .l3 = 45,
> +               .l5 = 621,
> +               .vsize = 625,
> +               .capture_format = 0,
> +               .vbi_supported = 0,
> +               .hd_sd = 1,
> +               .dv_preset = V4L2_DV_576P50,
> +       },
> +       {
> +               .name = "720p50",
> +               .width = 1280,
> +               .height = 720,
> +               .frm_fmt = 1,
> +               .ycmux_mode = 0,
> +               .eav2sav = 700-8,
> +               .sav2eav = 1280,
> +               .l1 = 1,
> +               .l3 = 26,
> +               .l5 = 746,
> +               .vsize = 750,
> +               .capture_format = 0,
> +               .vbi_supported = 0,
> +               .hd_sd = 1,
> +               .dv_preset = V4L2_DV_720P50,
> +       },
> +       {
> +               .name = "720p60",
> +               .width = 1280,
> +               .height = 720,
> +               .frm_fmt = 1,
> +               .ycmux_mode = 0,
> +               .eav2sav = 370 - 8,
> +               .sav2eav = 1280,
> +               .l1 = 1,
> +               .l3 = 26,
> +               .l5 = 746,
> +               .vsize = 750,
> +               .capture_format = 0,
> +               .vbi_supported = 0,
> +               .hd_sd = 1,
> +               .dv_preset = V4L2_DV_720P60,
> +       },
> +       {
> +               .name = "1080I50",
> +               .width = 1920,
> +               .height = 1080,
> +               .frm_fmt = 0,
> +               .ycmux_mode = 0,
> +               .eav2sav = 720 - 8,
> +               .sav2eav = 1920,
> +               .l1 = 1,
> +               .l3 = 21,
> +               .l5 = 561,
> +               .l7 = 563,
> +               .l9 = 584,
> +               .l11 = 1124,
> +               .vsize = 1125,
> +               .capture_format = 0,
> +               .vbi_supported = 0,
> +               .hd_sd = 1,
> +               .dv_preset = V4L2_DV_1080I50,
> +       },
> +       {
> +               .name = "1080I60",
> +               .width = 1920,
> +               .height = 1080,
> +               .frm_fmt = 0,
> +               .ycmux_mode = 0,
> +               .eav2sav = 280 - 8,
> +               .sav2eav = 1920,
> +               .l1 = 1,
> +               .l3 = 21,
> +               .l5 = 561,
> +               .l7 = 563,
> +               .l9 = 584,
> +               .l11 = 1124,
> +               .vsize = 1125,
> +               .capture_format = 0,
> +               .vbi_supported = 0,
> +               .hd_sd = 1,
> +               .dv_preset = V4L2_DV_1080I60,
> +       },
> +       {
> +               .name = "1080p60",
> +               .width = 1920,
> +               .height = 1080,
> +               .frm_fmt = 1,
> +               .ycmux_mode = 0,
> +               .eav2sav = 280 - 8,
> +               .sav2eav = 1920,
> +               .l1 = 1,
> +               .l3 = 42,
> +               .l5 = 1122,
> +               .vsize = 1125,
> +               .capture_format = 0,
> +               .vbi_supported = 0,
> +               .hd_sd = 1,
> +               .dv_preset = V4L2_DV_1080P60,
> +       },
> +
> +       /* SDTV formats */
> +
> +       {
> +               .name = "NTSC_M",
> +               .width = 720,
> +               .height = 480,
> +               .frm_fmt = 0,
> +               .ycmux_mode = 1,
> +               .eav2sav = 268,
> +               .sav2eav = 1440,
> +               .l1 = 1,
> +               .l3 = 23,
> +               .l5 = 263,
> +               .l7 = 266,
> +               .l9 = 286,
> +               .l11 = 525,
> +               .vsize = 525,
> +               .capture_format = 0,
> +               .vbi_supported = 1,
> +               .hd_sd = 0,
> +               .stdid = V4L2_STD_525_60,
> +       },
> +       {
> +               .name = "PAL_BDGHIK",
> +               .width = 720,
> +               .height = 576,
> +               .frm_fmt = 0,
> +               .ycmux_mode = 1,
> +               .eav2sav = 280,
> +               .sav2eav = 1440,
> +               .l1 = 1,
> +               .l3 = 23,
> +               .l5 = 311,
> +               .l7 = 313,
> +               .l9 = 336,
> +               .l11 = 624,
> +               .vsize = 625,
> +               .capture_format = 0,
> +               .vbi_supported = 1,
> +               .hd_sd = 0,
> +               .stdid = V4L2_STD_625_50,
> +       },
> +};
> +
> +const unsigned int vpif_ch_params_count = ARRAY_SIZE(ch_params);
> +
>  static inline void vpif_wr_bit(u32 reg, u32 bit, u32 val)
>  {
>        if (val)
> diff --git a/drivers/media/video/davinci/vpif.h b/drivers/media/video/davinci/vpif.h
> index 188841b..b121683 100644
> --- a/drivers/media/video/davinci/vpif.h
> +++ b/drivers/media/video/davinci/vpif.h
> @@ -577,7 +577,6 @@ 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 fps;
>        u8 frm_fmt;                     /* Indicates whether this is interlaced
>                                         * or progressive format */
>        u8 ycmux_mode;                  /* Indicates whether this mode requires
> @@ -592,8 +591,12 @@ struct vpif_channel_config_params {
>                                         * supports capturing vbi or not */
>        u8 hd_sd;
>        v4l2_std_id stdid;
> +       u32 dv_preset;                  /* HDTV format */
>  };
>
> +extern const unsigned int vpif_ch_params_count;
> +extern const struct vpif_channel_config_params ch_params[];
> +
>  struct vpif_video_params;
>  struct vpif_params;
>  struct vpif_vbi_params;
> diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
> index 34ac883..778af7e 100644
> --- a/drivers/media/video/davinci/vpif_capture.c
> +++ b/drivers/media/video/davinci/vpif_capture.c
> @@ -82,20 +82,6 @@ static struct vpif_device vpif_obj = { {NULL} };
>  static struct device *vpif_dev;
>
>  /**
> - * ch_params: video standard configuration parameters for vpif
> - */
> -static const struct vpif_channel_config_params ch_params[] = {
> -       {
> -               "NTSC_M", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266,
> -               286, 525, 525, 0, 1, 0, V4L2_STD_525_60,
> -       },
> -       {
> -               "PAL_BDGHIK", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311, 313,
> -               336, 624, 625, 0, 1, 0, V4L2_STD_625_50,
> -       },
> -};
> -
> -/**
>  * vpif_uservirt_to_phys : translate user/virtual address to phy address
>  * @virtp: user/virtual address
>  *
> @@ -444,7 +430,7 @@ static int vpif_update_std_info(struct channel_obj *ch)
>
>        std_info = &vpifparams->std_info;
>
> -       for (index = 0; index < ARRAY_SIZE(ch_params); index++) {
> +       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));
> @@ -453,7 +439,7 @@ static int vpif_update_std_info(struct channel_obj *ch)
>        }
>
>        /* standard not found */
> -       if (index == ARRAY_SIZE(ch_params))
> +       if (index == vpif_ch_params_count)
>                return -EINVAL;
>
>        common->fmt.fmt.pix.width = std_info->width;
> diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
> index b56c53a..edfc095 100644
> --- a/drivers/media/video/davinci/vpif_display.c
> +++ b/drivers/media/video/davinci/vpif_display.c
> @@ -85,17 +85,6 @@ static struct vpif_config_params config_params = {
>  static struct vpif_device vpif_obj = { {NULL} };
>  static struct device *vpif_dev;
>
> -static const struct vpif_channel_config_params ch_params[] = {
> -       {
> -               "NTSC", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266,
> -               286, 525, 525, 0, 1, 0, V4L2_STD_525_60,
> -       },
> -       {
> -               "PAL", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311, 313,
> -               336, 624, 625, 0, 1, 0, V4L2_STD_625_50,
> -       },
> -};
> -
>  /*
>  * vpif_uservirt_to_phys: This function is used to convert user
>  * space virtual address to physical address.
> @@ -388,7 +377,7 @@ static int vpif_get_std_info(struct channel_obj *ch)
>        if (!std_info->stdid)
>                return -1;
>
> -       for (index = 0; index < ARRAY_SIZE(ch_params); index++) {
> +       for (index = 0; index < vpif_ch_params_count; index++) {
>                config = &ch_params[index];
>                if (config->stdid & std_info->stdid) {
>                        memcpy(std_info, config, sizeof(*config));
> @@ -396,8 +385,8 @@ static int vpif_get_std_info(struct channel_obj *ch)
>                }
>        }
>
> -       if (index == ARRAY_SIZE(ch_params))
> -               return -1;
> +       if (index == vpif_ch_params_count)
> +               return -EINVAL;
>
>        common->fmt.fmt.pix.width = std_info->width;
>        common->fmt.fmt.pix.height = std_info->height;
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
Murali Karicheri
mkaricheri@gmail.com



-- 
Murali Karicheri
mkaricheri@gmail.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2010-10-24 14:49 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-22  7:00 [RFC/PATCH 0/5] DaVinci VPIF: Support for DV preset and DV timings mats.randgaard
2010-10-22  7:00 ` [RFC/PATCH 1/5] vpif_cap/disp: Add debug functionality mats.randgaard
2010-10-23 19:39   ` Hiremath, Vaibhav
     [not found]   ` <AANLkTikZCSmfg2o5=zzNzPGOoqZBzKYsa-mjjeQnjdAT@mail.gmail.com>
2010-10-24 14:43     ` Muralidharan Karicheri
2010-10-22  7:00 ` [RFC/PATCH 2/5] vpif: Move and extend ch_params[] mats.randgaard
2010-10-23 19:39   ` Hiremath, Vaibhav
     [not found]   ` <AANLkTikPFd+DMXjCXf6MQeuPZDwaekny_idTsouoe1eb@mail.gmail.com>
2010-10-24 14:44     ` Muralidharan Karicheri
2010-10-24 14:49     ` Fwd: " Muralidharan Karicheri
2010-10-22  7:00 ` [RFC/PATCH 3/5] vpif_cap/disp: Added support for DV presets mats.randgaard
2010-10-23 19:40   ` Hiremath, Vaibhav
2010-10-24  7:45     ` Hans Verkuil
     [not found]   ` <AANLkTi=Q8r7RLf7d49yoQcSHHgABS=cd+3Pq45kYGATA@mail.gmail.com>
2010-10-24 14:45     ` Fwd: " Muralidharan Karicheri
2010-10-22  7:00 ` [RFC/PATCH 4/5] vpif_cap/disp: Added support for DV timings mats.randgaard
2010-10-23 19:40   ` Hiremath, Vaibhav
     [not found]   ` <AANLkTikAKhfcdjwCZjvez4A7OBLyE1s7mgVKoO3ChAa=@mail.gmail.com>
2010-10-24 14:45     ` Fwd: " Muralidharan Karicheri
2010-10-22  7:00 ` [RFC/PATCH 5/5] vpif_cap/disp: Cleanup, improved comments mats.randgaard
2010-10-23 19:39   ` Hiremath, Vaibhav
     [not found]   ` <AANLkTi=Qw4MhARWVUNaAmGxH7sFy_Wk1=sqoRVBdrbpn@mail.gmail.com>
2010-10-24 14:46     ` Fwd: " Muralidharan Karicheri
     [not found] ` <AANLkTik_idAA9gmKSEvCXfQ=MP2Oe0gSi=PrUKqyoOMZ@mail.gmail.com>
2010-10-24 14:42   ` [RFC/PATCH 0/5] DaVinci VPIF: Support for DV preset and DV timings Muralidharan Karicheri

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.