All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: Prabhakar Lad <prabhakar.lad@ti.com>
Cc: LMML <linux-media@vger.kernel.org>,
	dlos <davinci-linux-open-source@linux.davincidsp.com>,
	linux-kernel@vger.kernel.org,
	Manjunath Hadli <manjunath.hadli@ti.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-doc@vger.kernel.org, Hans Verkuil <hans.verkuil@cisco.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Hans de Goede <hdegoede@redhat.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Rob Landley <rob@landley.net>
Subject: Re: [PATCH v2] media: v4l2-ctrls: add control for test pattern
Date: Fri, 07 Sep 2012 21:20:51 +0300	[thread overview]
Message-ID: <504A3B03.4090600@iki.fi> (raw)
In-Reply-To: <1347007309-6913-1-git-send-email-prabhakar.lad@ti.com>

Hi Prabhakar,

Thanks for the patch!

Prabhakar Lad 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>
> Cc: 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 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 |   20 ++++++++++++++++++++
>   drivers/media/v4l2-core/v4l2-ctrls.c         |    8 ++++++++
>   include/linux/videodev2.h                    |    4 ++++
>   3 files changed, 32 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
> index ad873ea..173934e 100644
> --- a/Documentation/DocBook/media/v4l/controls.xml
> +++ b/Documentation/DocBook/media/v4l/controls.xml
> @@ -4311,6 +4311,26 @@ 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>
> +	    <entrytbl spanname="descr" cols="2">
> +	      <tbody valign="top">
> +	        <row>
> +	         <entry><constant>V4L2_TEST_PATTERN_DISABLED</constant></entry>
> +	          <entry>Test pattern generation is disabled</entry>
> +	        </row>
> +	      </tbody>
> +	    </entrytbl>
> +	  </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..d731422 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> @@ -430,6 +430,10 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
>   		"Advanced",
>   		NULL,
>   	};
> +	static const char * const test_pattern[] = {
> +		"Disabled",
> +		NULL,
> +	};
>
>   	switch (id) {
>   	case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
> @@ -509,6 +513,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
>   		return jpeg_chroma_subsampling;
>   	case V4L2_CID_DPCM_PREDICTOR:
>   		return dpcm_predictor;
> +	case V4L2_CID_TEST_PATTERN:
> +		return test_pattern;

I think it's not necessary to define test_pattern (nor be prepared to 
return it) since the menu is going to be device specific. So the driver 
is responsible for all of the menu items. Such menus are created using 
v4l2_ctrl_new_custom() instead of v4l2_ctrl_new_std_menu().

Looks good to me otherwise.

Kind regards,

-- 
Sakari Ailus
sakari.ailus@iki.fi

  reply	other threads:[~2012-09-07 18:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-07  8:41 [PATCH v2] media: v4l2-ctrls: add control for test pattern Prabhakar Lad
2012-09-07 18:20 ` Sakari Ailus [this message]
2012-09-07 19:09   ` Prabhakar Lad
2012-09-08 11:11   ` Hans Verkuil
2012-09-09  7:40     ` Sakari Ailus
2012-09-13  1:04       ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=504A3B03.4090600@iki.fi \
    --to=sakari.ailus@iki.fi \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=hans.verkuil@cisco.com \
    --cc=hdegoede@redhat.com \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=manjunath.hadli@ti.com \
    --cc=mchehab@infradead.org \
    --cc=prabhakar.lad@ti.com \
    --cc=rob@landley.net \
    --cc=s.nawrocki@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.