linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Nicolas THERY <nicolas.thery@st.com>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	Jean-Marc VOLLE <jean-marc.volle@st.com>,
	Pierre-yves TALOUD <pierre-yves.taloud@st.com>,
	Willy POISSON <willy.poisson@st.com>,
	Benjamin GAIGNARD <benjamin.gaignard@st.com>,
	Vincent ABRIOU <vincent.abriou@st.com>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: how to crop/scale in mono-subdev camera sensor driver?
Date: Fri, 14 Sep 2012 23:02:36 +0200	[thread overview]
Message-ID: <50539B6C.2060400@gmail.com> (raw)
In-Reply-To: <50534688.7010805@st.com>

Hi,

On 09/14/2012 05:00 PM, Nicolas THERY wrote:
> Hello,
> 
> I'm studying how to support cropping and scaling (binning, skipping, digital
> scaling if any) for different models for camera sensor drivers.  There seems to
> be (at least) two kinds of sensor drivers:
> 
> 1) The smiapp driver has 2 or 3 subdevs: pixel array ->  binning (->  scaling).
> It gives clients full control over the various ways of cropping and scaling
> thanks to the selection API.
> 
> 2) The mt9p031 driver (and maybe others) has a single subdev.  Clients use the
> obsolete SUBDEV_S_CROP ioctl for selecting a region of interest in the pixel
> array and SUBDEV_S_FMT for setting the source pad mbus size.  If the mbus size
> differs from the cropping rectangle size, scaling is enabled and the driver
> decides internally how to combine skipping and binning to achieve the requested
> scaling factors.
> 
> As SUBDEV_S_CROP is obsolete, I wonder whether it is okay to support cropping
> and scaling in a mono-subdev sensor driver by (a) setting the cropping
> rectangle with SUBDEV_S_SELECTION on the source pad, and (b) setting the
> scaling factors via the source pad mbus size as in the mt9p031 driver?

Cc: Sakari, Laurent

AFAICT in a single subdev with one pad configuration your steps as above 
are valid, i.e. crop rectangle can be set with 
VIDIOC_SUBDEV_S_SELECTION(V4L2_SEL_TGT_CROP) and the sensor's output 
resolution with VIDIOC_SUBDEV_S_FMT.

I guess documentation [1] wasn't clear enough about that ?

The subdev crop ioctls are deprecated in favour of the selection API, so
now VIDIOC_SUBDEV_G/S_SELECTION ioctls and corresponding subdev ops needs 
to be used anywhere you would have used SUBDEV_G/S_CROP before.

This reminds me there are still a few drivers that need to be converted
to use set/get_selection subdev pad level ops, rather than set/get_crop.

[1] http://linuxtv.org/downloads/v4l-dvb-apis/subdev.html

--

Regards,
Sylwester

  reply	other threads:[~2012-09-14 21:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23  9:51 [PATCH RFC 0/4] V4L2: Vendor specific media bus formats/ frame size control Sylwester Nawrocki
2012-08-23  9:51 ` [PATCH RFC 1/4] V4L: Add V4L2_CID_FRAMESIZE image source class control Sylwester Nawrocki
2012-08-23 12:13   ` Sakari Ailus
2012-08-23 14:32     ` Sylwester Nawrocki
2012-08-23 18:24       ` Sakari Ailus
2012-08-23 22:41         ` Laurent Pinchart
2012-08-24  8:15           ` Sylwester Nawrocki
2012-08-24 22:51             ` Sakari Ailus
2012-08-26 19:22               ` Sylwester Nawrocki
2012-08-27 19:28                 ` Sakari Ailus
2012-09-11 19:21                   ` Sylwester Nawrocki
2012-09-12  6:48                     ` Hans Verkuil
2012-08-23  9:51 ` [PATCH RFC 2/4] V4L: Add V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8 media bus format Sylwester Nawrocki
2012-08-23  9:51 ` [PATCH RFC 3/4] V4L: Add V4L2_PIX_FMT_S5C_UYVY_JPG fourcc definition Sylwester Nawrocki
2012-08-23  9:51 ` [PATCH RFC 4/4] s5p-fimc: Add support for V4L2_PIX_FMT_S5C_UYVY_JPG fourcc Sylwester Nawrocki
2012-08-27 15:48 ` [PATCH RFC 0/4] V4L2: Vendor specific media bus formats/ frame size control Nicolas THERY
2012-08-29 18:41   ` sakari.ailus
2012-08-30  8:03     ` Nicolas THERY
2012-08-29 21:51   ` Sylwester Nawrocki
2012-08-30  8:06     ` Nicolas THERY
2012-09-14 15:00 ` how to crop/scale in mono-subdev camera sensor driver? Nicolas THERY
2012-09-14 21:02   ` Sylwester Nawrocki [this message]
2012-09-15 12:21     ` Sakari Ailus

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=50539B6C.2060400@gmail.com \
    --to=sylvester.nawrocki@gmail.com \
    --cc=benjamin.gaignard@st.com \
    --cc=jean-marc.volle@st.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=nicolas.thery@st.com \
    --cc=pierre-yves.taloud@st.com \
    --cc=sakari.ailus@iki.fi \
    --cc=vincent.abriou@st.com \
    --cc=willy.poisson@st.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;
as well as URLs for NNTP newsgroup(s).