public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Prabhakar Lad <prabhakar.csengg@gmail.com>
Cc: LMML <linux-media@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	DLOS <davinci-linux-open-source@linux.davincidsp.com>
Subject: Re: [PATCH] media: i2c: tvp7002: enable TVP7002 decoder for media controller based usage
Date: Mon, 29 Apr 2013 19:36:36 +0200	[thread overview]
Message-ID: <1696679.tiFHy28fsU@avalon> (raw)
In-Reply-To: <CA+V-a8u_YA=TJaRebboigM6z-A=R6-ZdyxZSED7H+4w+LN+cTQ@mail.gmail.com>

Hi Prabhakar,

On Monday 29 April 2013 23:00:26 Prabhakar Lad wrote:
> On Mon, Apr 29, 2013 at 7:57 PM, Laurent Pinchart wrote:
> > On Friday 26 April 2013 13:35:35 Prabhakar Lad wrote:
> >> From: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> >> 
> >> This patch enables tvp7002 decoder driver for media controller
> >> based usage by adding v4l2_subdev_pad_ops  operations support
> >> for enum_mbus_code, set_pad_format, get_pad_format and
> >> media_entity_init()
> >> on probe and media_entity_cleanup() on remove.
> >> 
> >> The device supports 1 output pad and no input pads.
> > 
> > We should actually define input pads, connected to connector entities, but
> > that's out of scope for this patch.
> > 
> >> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> >> ---

[snip]

> >> +/*
> >> + * tvp7002_set_pad_format() - set video format on pad
> >> + * @sd: pointer to standard V4L2 sub-device structure
> >> + * @fh: file handle for the subdev
> >> + * @fmt: pointer to subdev format struct
> >> + *
> >> + * set video format for pad.
> >> +*/
> >> +static int
> >> +tvp7002_set_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh
> >> *fh,
> >> +                    struct v4l2_subdev_format *fmt)
> >> +{
> >> +     struct tvp7002 *tvp7002 = to_tvp7002(sd);
> >> +
> >> +     /* Check pad index is valid */
> >> +     if (fmt->pad != 0)
> >> +             return -EINVAL;
> > 
> > Redundant check as well.
> 
> OK
> 
> >> +     if (fmt->format.field != tvp7002->current_timings->scanmode ||
> >> +         fmt->format.code != V4L2_MBUS_FMT_YUYV10_1X20 ||
> >> +         fmt->format.colorspace != tvp7002->current_timings->color_space
> >> || +         fmt->format.width !=
> >> tvp7002->current_timings->timings.bt.width || +        
> >> fmt->format.height != tvp7002->current_timings->timings.bt.height) +    
> >>         return -EINVAL;
> > 
> > You shouldn't return an error, but fix the input parameters according to
> > what the device supports. As the format is fixed for a giving set of
> > timings, the .set_pad_format() handler should just perform the same
> > operations as .get_pad_format(). You could even define
> > tvp7002_get_pad_format() only and use it as a handler for both
> > .get_pad_format() and .set_pad_format().
> 
> OK. So its the job back in the application end to see what format was set.

That's right. The format ioctls work that way to negotiate formats with 
userspace.

> >> +     tvp7002->format = fmt->format;
> >> +
> >> +     return 0;
> >> +}

[snip]

> >> +/* media pad related operation handlers */
> >> +static const struct v4l2_subdev_pad_ops tvp7002_pad_ops = {
> >> +     .enum_mbus_code = tvp7002_enum_mbus_code,
> >> +     .get_fmt = tvp7002_get_pad_format,
> >> +     .set_fmt = tvp7002_set_pad_format,
> > 
> > We will need to define pad-aware DV timings operations.
> 
> I didn't get you this?

We will need to extend the pad operations (struct v4l2_subdev_pad_ops) with 
operations to enumerate, get and set DV timings at the pad level.

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2013-04-29 17:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-26  8:05 [PATCH] media: i2c: tvp7002: enable TVP7002 decoder for media controller based usage Prabhakar Lad
2013-04-29 14:27 ` Laurent Pinchart
2013-04-29 17:30   ` Prabhakar Lad
2013-04-29 17:36     ` Laurent Pinchart [this message]
2013-04-29 17:50       ` Prabhakar Lad

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=1696679.tiFHy28fsU@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=prabhakar.csengg@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox