linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5] media: v4l2-ctrl: add a helper function to add standard control with driver specific menu
@ 2012-09-24 12:53 Prabhakar
  2012-09-24 12:53 ` [PATCH v3] media: v4l2-ctrls: add control for test pattern Prabhakar
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Prabhakar @ 2012-09-24 12:53 UTC (permalink / raw)
  To: LMML
  Cc: DLOS, LDOC, Mauro Carvalho Chehab, VGER, Lad, Prabhakar,
	Manjunath Hadli, Hans Verkuil, Sakari Ailus, Sylwester Nawrocki,
	Laurent Pinchart, Hans de Goede, Kyungmin Park,
	Guennadi Liakhovetski, Rob Landley

From: Lad, Prabhakar <prabhakar.lad@ti.com>

Add helper function v4l2_ctrl_new_std_menu_items(), which adds
a standard menu control, with driver specific menu.

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Rob Landley <rob@landley.net>
---
 Changes for v5:
 1: Fixed some grammatical issues pointed by Hans.

 Changes for v4:
 1: Rather then adding a function to modify the menu, added a helper
   function, that creates a new standard control with user specific
   menu.

 Changes for v3:
 1: Fixed style/grammer issues as pointed by Hans.
   Thanks Hans for providing the description.

 Changes for v2:
 1: Fixed review comments from Hans, to have return type as
   void, add WARN_ON() for fail conditions, allow this fucntion
   to modify the menu of custom controls.

 Documentation/video4linux/v4l2-controls.txt |   24 +++++++++++++++++++++
 drivers/media/v4l2-core/v4l2-ctrls.c        |   30 +++++++++++++++++++++++++++
 include/media/v4l2-ctrls.h                  |   23 ++++++++++++++++++++
 3 files changed, 77 insertions(+), 0 deletions(-)

diff --git a/Documentation/video4linux/v4l2-controls.txt b/Documentation/video4linux/v4l2-controls.txt
index 43da22b..b0cb0b8 100644
--- a/Documentation/video4linux/v4l2-controls.txt
+++ b/Documentation/video4linux/v4l2-controls.txt
@@ -136,11 +136,25 @@ Or alternatively for integer menu controls, by calling v4l2_ctrl_new_int_menu:
 			const struct v4l2_ctrl_ops *ops,
 			u32 id, s32 max, s32 def, const s64 *qmenu_int);
 
+Standard menu controls with a driver specific menu are added by calling
+v4l2_ctrl_new_std_menu_items:
+
+	struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(
+		struct v4l2_ctrl_handler *hdl,
+		const struct v4l2_ctrl_ops *ops, u32 id, s32 max,
+		s32 skip_mask, s32 def, const char * const *qmenu);
+
 These functions are typically called right after the v4l2_ctrl_handler_init:
 
 	static const s64 exp_bias_qmenu[] = {
 	       -2, -1, 0, 1, 2
 	};
+	static const char * const test_pattern[] = {
+		"Disabled",
+		"Vertical Bars",
+		"Solid Black",
+		"Solid White",
+	};
 
 	v4l2_ctrl_handler_init(&foo->ctrl_handler, nr_of_controls);
 	v4l2_ctrl_new_std(&foo->ctrl_handler, &foo_ctrl_ops,
@@ -156,6 +170,9 @@ These functions are typically called right after the v4l2_ctrl_handler_init:
 			ARRAY_SIZE(exp_bias_qmenu) - 1,
 			ARRAY_SIZE(exp_bias_qmenu) / 2 - 1,
 			exp_bias_qmenu);
+	v4l2_ctrl_new_std_menu_items(&foo->ctrl_handler, &foo_ctrl_ops,
+			V4L2_CID_TEST_PATTERN, ARRAY_SIZE(test_pattern) - 1, 0,
+			0, test_pattern);
 	...
 	if (foo->ctrl_handler.error) {
 		int err = foo->ctrl_handler.error;
@@ -185,6 +202,13 @@ v4l2_ctrl_new_std_menu in that it doesn't have the mask argument and takes
 as the last argument an array of signed 64-bit integers that form an exact
 menu item list.
 
+The v4l2_ctrl_new_std_menu_items function is very similar to
+v4l2_ctrl_new_std_menu but takes an extra parameter qmenu, which is the driver
+specific menu for an otherwise standard menu control. A good example for this
+control is the test pattern control for capture/display/sensors devices that
+have the capability to generate test patterns. These test patterns are hardware
+specific, so the contents of the menu will vary from device to device.
+
 Note that if something fails, the function will return NULL or an error and
 set ctrl_handler->error to the error code. If ctrl_handler->error was already
 set, then it will just return and do nothing. This is also true for
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 41b7732..96c5e73 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -1643,6 +1643,36 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl,
 }
 EXPORT_SYMBOL(v4l2_ctrl_new_std_menu);
 
+/* Helper function for standard menu controls with driver defined menu */
+struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(struct v4l2_ctrl_handler *hdl,
+			const struct v4l2_ctrl_ops *ops, u32 id, s32 max,
+			s32 mask, s32 def, const char * const *qmenu)
+{
+	enum v4l2_ctrl_type type;
+	const char *name;
+	u32 flags;
+	s32 step;
+	s32 min;
+
+	/* v4l2_ctrl_new_std_menu_items() should only be called for
+	 * standard controls without a standard menu.
+	 */
+	if (v4l2_ctrl_get_menu(id)) {
+		handler_set_err(hdl, -EINVAL);
+		return NULL;
+	}
+
+	v4l2_ctrl_fill(id, &name, &type, &min, &max, &step, &def, &flags);
+	if (type != V4L2_CTRL_TYPE_MENU || qmenu == NULL) {
+		handler_set_err(hdl, -EINVAL);
+		return NULL;
+	}
+	return v4l2_ctrl_new(hdl, ops, id, name, type, 0, max, mask, def,
+			     flags, qmenu, NULL, NULL);
+
+}
+EXPORT_SYMBOL(v4l2_ctrl_new_std_menu_items);
+
 /* Helper function for standard integer menu controls */
 struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct v4l2_ctrl_handler *hdl,
 			const struct v4l2_ctrl_ops *ops,
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 776605f..8db9dbe 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -351,6 +351,29 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl,
 			const struct v4l2_ctrl_ops *ops,
 			u32 id, s32 max, s32 mask, s32 def);
 
+/** v4l2_ctrl_new_std_menu_items() - Create a new standard V4L2 menu control
+  * with driver specific menu.
+  * @hdl:	The control handler.
+  * @ops:	The control ops.
+  * @id:	The control ID.
+  * @max:	The control's maximum value.
+  * @mask:	The control's skip mask for menu controls. This makes it
+  *		easy to skip menu items that are not valid. If bit X is set,
+  *		then menu item X is skipped. Of course, this only works for
+  *		menus with <= 32 menu items. There are no menus that come
+  *		close to that number, so this is OK. Should we ever need more,
+  *		then this will have to be extended to a u64 or a bit array.
+  * @def:	The control's default value.
+  * @qmenu:	The new menu.
+  *
+  * Same as v4l2_ctrl_new_std_menu(), but @qmenu will be the driver specific
+  * menu of this control.
+  *
+  */
+struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(struct v4l2_ctrl_handler *hdl,
+			const struct v4l2_ctrl_ops *ops, u32 id, s32 max,
+			s32 mask, s32 def, const char * const *qmenu);
+
 /** v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control.
   * @hdl:	The control handler.
   * @ops:	The control ops.
-- 
1.7.4.1


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

* [PATCH v3] media: v4l2-ctrls: add control for test pattern
  2012-09-24 12:53 [PATCH v5] media: v4l2-ctrl: add a helper function to add standard control with driver specific menu Prabhakar
@ 2012-09-24 12:53 ` Prabhakar
  2012-09-24 13:37   ` Hans Verkuil
  2012-09-24 12:58 ` [PATCH v5] media: v4l2-ctrl: add a helper function to add standard control with driver specific menu Hans Verkuil
  2012-09-24 13:12 ` Laurent Pinchart
  2 siblings, 1 reply; 6+ messages in thread
From: Prabhakar @ 2012-09-24 12:53 UTC (permalink / raw)
  To: LMML
  Cc: DLOS, LDOC, Mauro Carvalho Chehab, VGER, Lad, Prabhakar,
	Manjunath Hadli, Hans Verkuil, Laurent Pinchart,
	Sylwester Nawrocki, Hans de Goede, Kyungmin Park, Rob Landley

From: Lad, Prabhakar <prabhakar.lad@ti.com>

add V4L2_CID_TEST_PATTERN of type menu, which determines
the internal test pattern selected by the device.

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Rob Landley <rob@landley.net>
---
 This patches has one checkpatch warning for line over
 80 characters altough it can be avoided I have kept it
 for consistency.

 Changes for v3:
 1: Removed the menu for test pattern, pointed by Sakari.

 Changes for v2:
 1: Included display devices in the description for test pattern
   as pointed by Hans.
 2: In the menu replaced 'Test Pattern Disabled' by 'Disabled' as
   pointed by Sylwester.
 3: Removed the test patterns from menu as the are hardware specific
   as pointed by Sakari.

 Documentation/DocBook/media/v4l/controls.xml |   10 ++++++++++
 drivers/media/v4l2-core/v4l2-ctrls.c         |    2 ++
 include/linux/videodev2.h                    |    1 +
 3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
index f0fb08d..51e9c4e 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -4313,6 +4313,16 @@ interface and may change in the future.</para>
 	      </tbody>
 	    </entrytbl>
 	  </row>
+	  <row>
+	    <entry spanname="id"><constant>V4L2_CID_TEST_PATTERN</constant></entry>
+	    <entry>menu</entry>
+	  </row>
+	  <row id="v4l2-test-pattern">
+	    <entry spanname="descr"> The Capture/Display/Sensors have the capability
+	    to generate internal test patterns and this are hardware specific. This
+	    test patterns are used to test a device is properly working and can generate
+	    the desired waveforms that it supports.</entry>
+	  </row>
 	<row><entry></entry></row>
 	</tbody>
       </tgroup>
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 8f2f40b..41b7732 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -740,6 +740,7 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_LINK_FREQ:		return "Link Frequency";
 	case V4L2_CID_PIXEL_RATE:		return "Pixel Rate";
 	case V4L2_CID_DPCM_PREDICTOR:		return "DPCM Predictor";
+	case V4L2_CID_TEST_PATTERN:		return "Test Pattern";
 
 	default:
 		return NULL;
@@ -841,6 +842,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_EXPOSURE_METERING:
 	case V4L2_CID_SCENE_MODE:
 	case V4L2_CID_DPCM_PREDICTOR:
+	case V4L2_CID_TEST_PATTERN:
 		*type = V4L2_CTRL_TYPE_MENU;
 		break;
 	case V4L2_CID_LINK_FREQ:
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index ca9fb78..7014c0b 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -2005,6 +2005,7 @@ enum v4l2_dpcm_predictor {
 	V4L2_DPCM_PREDICTOR_SIMPLE	= 0,
 	V4L2_DPCM_PREDICTOR_ADVANCED	= 1,
 };
+#define V4L2_CID_TEST_PATTERN			(V4L2_CID_IMAGE_PROC_CLASS_BASE + 4)
 
 /*
  *	T U N I N G
-- 
1.7.4.1


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

* Re: [PATCH v5] media: v4l2-ctrl: add a helper function to add standard control with driver specific menu
  2012-09-24 12:53 [PATCH v5] media: v4l2-ctrl: add a helper function to add standard control with driver specific menu Prabhakar
  2012-09-24 12:53 ` [PATCH v3] media: v4l2-ctrls: add control for test pattern Prabhakar
@ 2012-09-24 12:58 ` Hans Verkuil
  2012-09-24 13:12 ` Laurent Pinchart
  2 siblings, 0 replies; 6+ messages in thread
From: Hans Verkuil @ 2012-09-24 12:58 UTC (permalink / raw)
  To: Prabhakar
  Cc: LMML, DLOS, LDOC, Mauro Carvalho Chehab, VGER, Lad, Prabhakar,
	Manjunath Hadli, Hans Verkuil, Sakari Ailus, Sylwester Nawrocki,
	Laurent Pinchart, Hans de Goede, Kyungmin Park,
	Guennadi Liakhovetski, Rob Landley

On Mon September 24 2012 14:53:40 Prabhakar wrote:
> From: Lad, Prabhakar <prabhakar.lad@ti.com>
> 
> Add helper function v4l2_ctrl_new_std_menu_items(), which adds
> a standard menu control, with driver specific menu.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

> 
> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> Cc: Hans Verkuil <hans.verkuil@cisco.com>
> Cc: Sakari Ailus <sakari.ailus@iki.fi>
> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Rob Landley <rob@landley.net>
> ---
>  Changes for v5:
>  1: Fixed some grammatical issues pointed by Hans.
> 
>  Changes for v4:
>  1: Rather then adding a function to modify the menu, added a helper
>    function, that creates a new standard control with user specific
>    menu.
> 
>  Changes for v3:
>  1: Fixed style/grammer issues as pointed by Hans.
>    Thanks Hans for providing the description.
> 
>  Changes for v2:
>  1: Fixed review comments from Hans, to have return type as
>    void, add WARN_ON() for fail conditions, allow this fucntion
>    to modify the menu of custom controls.
> 
>  Documentation/video4linux/v4l2-controls.txt |   24 +++++++++++++++++++++
>  drivers/media/v4l2-core/v4l2-ctrls.c        |   30 +++++++++++++++++++++++++++
>  include/media/v4l2-ctrls.h                  |   23 ++++++++++++++++++++
>  3 files changed, 77 insertions(+), 0 deletions(-)

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

* Re: [PATCH v5] media: v4l2-ctrl: add a helper function to add standard control with driver specific menu
  2012-09-24 12:53 [PATCH v5] media: v4l2-ctrl: add a helper function to add standard control with driver specific menu Prabhakar
  2012-09-24 12:53 ` [PATCH v3] media: v4l2-ctrls: add control for test pattern Prabhakar
  2012-09-24 12:58 ` [PATCH v5] media: v4l2-ctrl: add a helper function to add standard control with driver specific menu Hans Verkuil
@ 2012-09-24 13:12 ` Laurent Pinchart
  2 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2012-09-24 13:12 UTC (permalink / raw)
  To: Prabhakar
  Cc: LMML, DLOS, LDOC, Mauro Carvalho Chehab, VGER, Lad, Prabhakar,
	Manjunath Hadli, Hans Verkuil, Sakari Ailus, Sylwester Nawrocki,
	Hans de Goede, Kyungmin Park, Guennadi Liakhovetski, Rob Landley

On Monday 24 September 2012 18:23:40 Prabhakar wrote:
> From: Lad, Prabhakar <prabhakar.lad@ti.com>
> 
> Add helper function v4l2_ctrl_new_std_menu_items(), which adds
> a standard menu control, with driver specific menu.
> 
> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> Cc: Hans Verkuil <hans.verkuil@cisco.com>
> Cc: Sakari Ailus <sakari.ailus@iki.fi>
> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Rob Landley <rob@landley.net>

Thank you for not giving up despite the many change requests you have received 
:-)

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH v3] media: v4l2-ctrls: add control for test pattern
  2012-09-24 12:53 ` [PATCH v3] media: v4l2-ctrls: add control for test pattern Prabhakar
@ 2012-09-24 13:37   ` Hans Verkuil
  2012-09-25  5:41     ` Prabhakar Lad
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Verkuil @ 2012-09-24 13:37 UTC (permalink / raw)
  To: davinci-linux-open-source
  Cc: Prabhakar, LMML, Rob Landley, LDOC, VGER, Hans de Goede,
	Kyungmin Park, Hans Verkuil, Sylwester Nawrocki,
	Mauro Carvalho Chehab

On Mon September 24 2012 14:53:41 Prabhakar wrote:
> From: Lad, Prabhakar <prabhakar.lad@ti.com>
> 
> add V4L2_CID_TEST_PATTERN of type menu, which determines
> the internal test pattern selected by the device.
> 
> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
> Cc: Hans Verkuil <hans.verkuil@cisco.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Rob Landley <rob@landley.net>
> ---
>  This patches has one checkpatch warning for line over
>  80 characters altough it can be avoided I have kept it
>  for consistency.
> 
>  Changes for v3:
>  1: Removed the menu for test pattern, pointed by Sakari.
> 
>  Changes for v2:
>  1: Included display devices in the description for test pattern
>    as pointed by Hans.
>  2: In the menu replaced 'Test Pattern Disabled' by 'Disabled' as
>    pointed by Sylwester.
>  3: Removed the test patterns from menu as the are hardware specific
>    as pointed by Sakari.
> 
>  Documentation/DocBook/media/v4l/controls.xml |   10 ++++++++++
>  drivers/media/v4l2-core/v4l2-ctrls.c         |    2 ++
>  include/linux/videodev2.h                    |    1 +
>  3 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
> index f0fb08d..51e9c4e 100644
> --- a/Documentation/DocBook/media/v4l/controls.xml
> +++ b/Documentation/DocBook/media/v4l/controls.xml
> @@ -4313,6 +4313,16 @@ interface and may change in the future.</para>
>  	      </tbody>
>  	    </entrytbl>
>  	  </row>
> +	  <row>
> +	    <entry spanname="id"><constant>V4L2_CID_TEST_PATTERN</constant></entry>
> +	    <entry>menu</entry>
> +	  </row>
> +	  <row id="v4l2-test-pattern">
> +	    <entry spanname="descr"> The Capture/Display/Sensors have the capability
> +	    to generate internal test patterns and this are hardware specific. This
> +	    test patterns are used to test a device is properly working and can generate
> +	    the desired waveforms that it supports.</entry>

Some grammar/style fixes:

	    <entry spanname="descr"> Some capture/display/sensor devices have the
	    capability to generate test pattern images. These hardware specific
	    test patterns can be used to test if a device is working properly.</entry>


> +	  </row>
>  	<row><entry></entry></row>
>  	</tbody>
>        </tgroup>
> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
> index 8f2f40b..41b7732 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> @@ -740,6 +740,7 @@ const char *v4l2_ctrl_get_name(u32 id)
>  	case V4L2_CID_LINK_FREQ:		return "Link Frequency";
>  	case V4L2_CID_PIXEL_RATE:		return "Pixel Rate";
>  	case V4L2_CID_DPCM_PREDICTOR:		return "DPCM Predictor";
> +	case V4L2_CID_TEST_PATTERN:		return "Test Pattern";
>  
>  	default:
>  		return NULL;
> @@ -841,6 +842,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
>  	case V4L2_CID_EXPOSURE_METERING:
>  	case V4L2_CID_SCENE_MODE:
>  	case V4L2_CID_DPCM_PREDICTOR:
> +	case V4L2_CID_TEST_PATTERN:
>  		*type = V4L2_CTRL_TYPE_MENU;
>  		break;
>  	case V4L2_CID_LINK_FREQ:
> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
> index ca9fb78..7014c0b 100644
> --- a/include/linux/videodev2.h
> +++ b/include/linux/videodev2.h
> @@ -2005,6 +2005,7 @@ enum v4l2_dpcm_predictor {
>  	V4L2_DPCM_PREDICTOR_SIMPLE	= 0,
>  	V4L2_DPCM_PREDICTOR_ADVANCED	= 1,
>  };
> +#define V4L2_CID_TEST_PATTERN			(V4L2_CID_IMAGE_PROC_CLASS_BASE + 4)
>  
>  /*
>   *	T U N I N G
> 

Regards,

	Hans

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

* Re: [PATCH v3] media: v4l2-ctrls: add control for test pattern
  2012-09-24 13:37   ` Hans Verkuil
@ 2012-09-25  5:41     ` Prabhakar Lad
  0 siblings, 0 replies; 6+ messages in thread
From: Prabhakar Lad @ 2012-09-25  5:41 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: davinci-linux-open-source, LMML, Rob Landley, LDOC, VGER,
	Hans de Goede, Kyungmin Park, Hans Verkuil, Sylwester Nawrocki,
	Mauro Carvalho Chehab

Hi Hans,

Thanks for the review,

On Mon, Sep 24, 2012 at 7:07 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> On Mon September 24 2012 14:53:41 Prabhakar wrote:
>> From: Lad, Prabhakar <prabhakar.lad@ti.com>
>>
>> add V4L2_CID_TEST_PATTERN of type menu, which determines
>> the internal test pattern selected by the device.
>>
>> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
>> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
>> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
>> Cc: Hans Verkuil <hans.verkuil@cisco.com>
>> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
>> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
>> Cc: Hans de Goede <hdegoede@redhat.com>
>> Cc: Kyungmin Park <kyungmin.park@samsung.com>
>> Cc: Rob Landley <rob@landley.net>
>> ---
>>  This patches has one checkpatch warning for line over
>>  80 characters altough it can be avoided I have kept it
>>  for consistency.
>>
>>  Changes for v3:
>>  1: Removed the menu for test pattern, pointed by Sakari.
>>
>>  Changes for v2:
>>  1: Included display devices in the description for test pattern
>>    as pointed by Hans.
>>  2: In the menu replaced 'Test Pattern Disabled' by 'Disabled' as
>>    pointed by Sylwester.
>>  3: Removed the test patterns from menu as the are hardware specific
>>    as pointed by Sakari.
>>
>>  Documentation/DocBook/media/v4l/controls.xml |   10 ++++++++++
>>  drivers/media/v4l2-core/v4l2-ctrls.c         |    2 ++
>>  include/linux/videodev2.h                    |    1 +
>>  3 files changed, 13 insertions(+), 0 deletions(-)
>>
>> diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
>> index f0fb08d..51e9c4e 100644
>> --- a/Documentation/DocBook/media/v4l/controls.xml
>> +++ b/Documentation/DocBook/media/v4l/controls.xml
>> @@ -4313,6 +4313,16 @@ interface and may change in the future.</para>
>>             </tbody>
>>           </entrytbl>
>>         </row>
>> +       <row>
>> +         <entry spanname="id"><constant>V4L2_CID_TEST_PATTERN</constant></entry>
>> +         <entry>menu</entry>
>> +       </row>
>> +       <row id="v4l2-test-pattern">
>> +         <entry spanname="descr"> The Capture/Display/Sensors have the capability
>> +         to generate internal test patterns and this are hardware specific. This
>> +         test patterns are used to test a device is properly working and can generate
>> +         the desired waveforms that it supports.</entry>
>
> Some grammar/style fixes:
>
>             <entry spanname="descr"> Some capture/display/sensor devices have the
>             capability to generate test pattern images. These hardware specific
>             test patterns can be used to test if a device is working properly.</entry>
>
I'll fix it in next version.

Regards,
--Prabhakar Lad

>
>> +       </row>
>>       <row><entry></entry></row>
>>       </tbody>
>>        </tgroup>
>> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
>> index 8f2f40b..41b7732 100644
>> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
>> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
>> @@ -740,6 +740,7 @@ const char *v4l2_ctrl_get_name(u32 id)
>>       case V4L2_CID_LINK_FREQ:                return "Link Frequency";
>>       case V4L2_CID_PIXEL_RATE:               return "Pixel Rate";
>>       case V4L2_CID_DPCM_PREDICTOR:           return "DPCM Predictor";
>> +     case V4L2_CID_TEST_PATTERN:             return "Test Pattern";
>>
>>       default:
>>               return NULL;
>> @@ -841,6 +842,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
>>       case V4L2_CID_EXPOSURE_METERING:
>>       case V4L2_CID_SCENE_MODE:
>>       case V4L2_CID_DPCM_PREDICTOR:
>> +     case V4L2_CID_TEST_PATTERN:
>>               *type = V4L2_CTRL_TYPE_MENU;
>>               break;
>>       case V4L2_CID_LINK_FREQ:
>> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
>> index ca9fb78..7014c0b 100644
>> --- a/include/linux/videodev2.h
>> +++ b/include/linux/videodev2.h
>> @@ -2005,6 +2005,7 @@ enum v4l2_dpcm_predictor {
>>       V4L2_DPCM_PREDICTOR_SIMPLE      = 0,
>>       V4L2_DPCM_PREDICTOR_ADVANCED    = 1,
>>  };
>> +#define V4L2_CID_TEST_PATTERN                        (V4L2_CID_IMAGE_PROC_CLASS_BASE + 4)
>>
>>  /*
>>   *   T U N I N G
>>
>
> Regards,
>
>         Hans
> --
> 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

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

end of thread, other threads:[~2012-09-25  5:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-24 12:53 [PATCH v5] media: v4l2-ctrl: add a helper function to add standard control with driver specific menu Prabhakar
2012-09-24 12:53 ` [PATCH v3] media: v4l2-ctrls: add control for test pattern Prabhakar
2012-09-24 13:37   ` Hans Verkuil
2012-09-25  5:41     ` Prabhakar Lad
2012-09-24 12:58 ` [PATCH v5] media: v4l2-ctrl: add a helper function to add standard control with driver specific menu Hans Verkuil
2012-09-24 13:12 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).