linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Cc: linux-media@vger.kernel.org, bingbu.cao@intel.com
Subject: Re: [PATCH v2 1/1] media: Use common test pattern menu entries
Date: Thu, 10 Jan 2019 18:17:43 +0200	[thread overview]
Message-ID: <20190110161742.oyyby5g4fo6peg2f@paasikivi.fi.intel.com> (raw)
In-Reply-To: <20181204124142.1d3a8543@coco.lan>

Hi Mauro,

On Tue, Dec 04, 2018 at 12:41:42PM -0200, Mauro Carvalho Chehab wrote:
> Em Tue,  4 Dec 2018 15:40:42 +0200
> Sakari Ailus <sakari.ailus@linux.intel.com> escreveu:
> 
> > While the test pattern menu itself is not standardised, many devices
> > support the same test patterns. Aligning the menu entries helps the user
> > space to use the interface, and adding macros for the menu entry strings
> > helps to keep them aligned.
> > 
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > ---
> > since v1:
> > 
> > - Fix indentation of menu strings
> > - Remove "8" from the macro names
> > 
> >  drivers/media/i2c/imx258.c             | 10 +++++-----
> >  drivers/media/i2c/imx319.c             | 10 +++++-----
> >  drivers/media/i2c/imx355.c             | 10 +++++-----
> >  drivers/media/i2c/ov2640.c             |  4 ++--
> >  drivers/media/i2c/smiapp/smiapp-core.c | 10 +++++-----
> >  include/uapi/linux/v4l2-controls.h     |  5 +++++
> >  6 files changed, 27 insertions(+), 22 deletions(-)
> > 
> > diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c
> > index f86ae18bc104..df5f016cebd9 100644
> > --- a/drivers/media/i2c/imx258.c
> > +++ b/drivers/media/i2c/imx258.c
> > @@ -498,11 +498,11 @@ static const struct imx258_reg mode_1048_780_regs[] = {
> >  };
> >  
> >  static const char * const imx258_test_pattern_menu[] = {
> > -	"Disabled",
> > -	"Solid Colour",
> > -	"Eight Vertical Colour Bars",
> > -	"Colour Bars With Fade to Grey",
> > -	"Pseudorandom Sequence (PN9)",
> > +	V4L2_TEST_PATTERN_DISABLED,
> > +	V4L2_TEST_PATTERN_SOLID_COLOUR,
> > +	V4L2_TEST_PATTERN_VERT_COLOUR_BARS,
> > +	V4L2_TEST_PATTERN_VERT_COLOUR_BARS_FADE_TO_GREY,
> > +	V4L2_TEST_PATTERN_PN9,
> >  };
> >  
> >  /* Configurations for supported link frequencies */
> > diff --git a/drivers/media/i2c/imx319.c b/drivers/media/i2c/imx319.c
> > index 17c2e4b41221..d9d4176b9d37 100644
> > --- a/drivers/media/i2c/imx319.c
> > +++ b/drivers/media/i2c/imx319.c
> > @@ -1647,11 +1647,11 @@ static const struct imx319_reg mode_1280x720_regs[] = {
> >  };
> >  
> >  static const char * const imx319_test_pattern_menu[] = {
> > -	"Disabled",
> > -	"Solid Colour",
> > -	"Eight Vertical Colour Bars",
> > -	"Colour Bars With Fade to Grey",
> > -	"Pseudorandom Sequence (PN9)",
> > +	V4L2_TEST_PATTERN_DISABLED,
> > +	V4L2_TEST_PATTERN_SOLID_COLOUR,
> > +	V4L2_TEST_PATTERN_VERT_COLOUR_BARS,
> > +	V4L2_TEST_PATTERN_VERT_COLOUR_BARS_FADE_TO_GREY,
> > +	V4L2_TEST_PATTERN_PN9,
> >  };
> >  
> >  /* supported link frequencies */
> > diff --git a/drivers/media/i2c/imx355.c b/drivers/media/i2c/imx355.c
> > index bed293b60e50..99138a291cb8 100644
> > --- a/drivers/media/i2c/imx355.c
> > +++ b/drivers/media/i2c/imx355.c
> > @@ -875,11 +875,11 @@ static const struct imx355_reg mode_820x616_regs[] = {
> >  };
> >  
> >  static const char * const imx355_test_pattern_menu[] = {
> > -	"Disabled",
> > -	"Solid Colour",
> > -	"Eight Vertical Colour Bars",
> > -	"Colour Bars With Fade to Grey",
> > -	"Pseudorandom Sequence (PN9)",
> > +	V4L2_TEST_PATTERN_DISABLED,
> > +	V4L2_TEST_PATTERN_SOLID_COLOUR,
> > +	V4L2_TEST_PATTERN_VERT_COLOUR_BARS,
> > +	V4L2_TEST_PATTERN_VERT_COLOUR_BARS_FADE_TO_GREY,
> > +	V4L2_TEST_PATTERN_PN9,
> >  };
> >  
> >  /* supported link frequencies */
> > diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c
> > index 5d2d6735cc78..65058d9a5d51 100644
> > --- a/drivers/media/i2c/ov2640.c
> > +++ b/drivers/media/i2c/ov2640.c
> > @@ -707,8 +707,8 @@ static int ov2640_reset(struct i2c_client *client)
> >  }
> >  
> >  static const char * const ov2640_test_pattern_menu[] = {
> > -	"Disabled",
> > -	"Eight Vertical Colour Bars",
> > +	V4L2_TEST_PATTERN_DISABLED,
> > +	V4L2_TEST_PATTERN_VERT_COLOUR_BARS,
> >  };
> >  
> >  /*
> > diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
> > index 58a45c353e27..5c9bcc9438ec 100644
> > --- a/drivers/media/i2c/smiapp/smiapp-core.c
> > +++ b/drivers/media/i2c/smiapp/smiapp-core.c
> > @@ -409,11 +409,11 @@ static void smiapp_update_mbus_formats(struct smiapp_sensor *sensor)
> >  }
> >  
> >  static const char * const smiapp_test_patterns[] = {
> > -	"Disabled",
> > -	"Solid Colour",
> > -	"Eight Vertical Colour Bars",
> > -	"Colour Bars With Fade to Grey",
> > -	"Pseudorandom Sequence (PN9)",
> > +	V4L2_TEST_PATTERN_DISABLED,
> > +	V4L2_TEST_PATTERN_SOLID_COLOUR,
> > +	V4L2_TEST_PATTERN_VERT_COLOUR_BARS,
> > +	V4L2_TEST_PATTERN_VERT_COLOUR_BARS_FADE_TO_GREY,
> > +	V4L2_TEST_PATTERN_PN9,
> >  };
> >  
> >  static int smiapp_set_ctrl(struct v4l2_ctrl *ctrl)
> > diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
> > index 998983a6e6b7..acb2a57fa5d6 100644
> > --- a/include/uapi/linux/v4l2-controls.h
> > +++ b/include/uapi/linux/v4l2-controls.h
> > @@ -1014,6 +1014,11 @@ enum v4l2_jpeg_chroma_subsampling {
> >  #define V4L2_CID_LINK_FREQ			(V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
> >  #define V4L2_CID_PIXEL_RATE			(V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
> >  #define V4L2_CID_TEST_PATTERN			(V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
> 
> > +#define V4L2_TEST_PATTERN_DISABLED		"Disabled"
> > +#define V4L2_TEST_PATTERN_SOLID_COLOUR		"Solid Colour"
> > +#define V4L2_TEST_PATTERN_VERT_COLOUR_BARS	"Eight Vertical Colour Bars"
> > +#define V4L2_TEST_PATTERN_VERT_COLOUR_BARS_FADE_TO_GREY "Colour Bars With Fade to Grey"
> > +#define V4L2_TEST_PATTERN_PN9			"Pseudorandom Sequence (PN9)"
> 
> I like the idea of using defines for those, but I wouldn't put them
> at the uAPI.
> 
> See, once we put anything there, it is set into a stone, and we will
> be bound forever to whatever name we place on it.
> 
> It would be a way better to have them at include/media/v4l2-ctrls.h.

The intent was to let the user space use these as well. As the menu
positions are not standardised (items are device specific), this would
still allow the user space to make an informed choice of what to select in
the menu: the functionality can still be the same for some entries.

In this case, especially the test patterns originating from the SMIA
specification are supported by many sensors, even if not otherwise SMIA
compliant.

> 
> >  #define V4L2_CID_DEINTERLACING_MODE		(V4L2_CID_IMAGE_PROC_CLASS_BASE + 4)
> >  #define V4L2_CID_DIGITAL_GAIN			(V4L2_CID_IMAGE_PROC_CLASS_BASE + 5)
> >  
> 
> Thanks,
> Mauro

-- 
Sakari Ailus
sakari.ailus@linux.intel.com

      reply	other threads:[~2019-01-10 16:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 13:40 [PATCH v2 1/1] media: Use common test pattern menu entries Sakari Ailus
2018-12-04 14:41 ` Mauro Carvalho Chehab
2019-01-10 16:17   ` Sakari Ailus [this message]

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=20190110161742.oyyby5g4fo6peg2f@paasikivi.fi.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=bingbu.cao@intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    /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 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).