From: Sakari Ailus <sakari.ailus@iki.fi>
To: jean-philippe francois <jp.francois@cynove.com>
Cc: linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com,
dacohen@gmail.com, snjw23@gmail.com,
andriy.shevchenko@linux.intel.com, t.stanislaws@samsung.com,
tuukkat76@gmail.com, k.debski@samsung.com, riverful@gmail.com,
hverkuil@xs4all.nl, teturtia@gmail.com,
pradeep.sawlani@gmail.com
Subject: Re: [PATCH v5.1 35/35] smiapp: Add driver
Date: Sun, 11 Mar 2012 11:04:34 +0200 [thread overview]
Message-ID: <20120311090434.GH1591@valkosipuli.localdomain> (raw)
In-Reply-To: <CAGGh5h37Rd9O1Hp6FHBo1KcQRdEb=2OJxGkA0aJmyWkEB9juGQ@mail.gmail.com>
Hi François,
On Thu, Mar 08, 2012 at 04:06:34PM +0100, jean-philippe francois wrote:
> Le 8 mars 2012 14:57, Sakari Ailus <sakari.ailus@iki.fi> a écrit :
> > Add driver for SMIA++/SMIA image sensors. The driver exposes the sensor as
> > three subdevs, pixel array, binner and scaler --- in case the device has a
> > scaler.
> >
> > Currently it relies on the board code for external clock handling. There is
> > no fast way out of this dependency before the ISP drivers (omap3isp) among
> > others will be able to export that clock through the clock framework
> > instead.
> >
> > + case V4L2_CID_EXPOSURE:
> > + return smiapp_write(
> > + client,
> > + SMIAPP_REG_U16_COARSE_INTEGRATION_TIME, ctrl->val);
> > +
> At this point, knowing pixel clock and line length, it is possible
> to get / set the exposure in useconds or millisecond value.
It is possible, but still I don't think we even want that at this level.
This is a fairly low level interface.
The exposure time in seconds can always be constructed from horizontal and
vertical blanking and the pixel rate in the user space.
How you choose the exposure value in seconds does contain policy decisions
which belong to the user space. Sensor drivers don't even have enough
information to make these decisions. Providing the exposure time in native
unit for sensors allows making these decisions in the user space.
For example:
- To get a common frame rate such as 30 or 25 fps, you need to add blanking,
either horizontal or vertical. Using horizontal blanking gives you more
unwanted rolling shutter effect but amortises the data rate over time. Which
one you want (horizontal or vertical) is dependent on your hardware and what
else is involved in your use case
- Hardware limitations. Most blocks in the OMAP 3 ISP have the maximum speed
of is 100 Mp/s but for the CSI-2 receiver it's 200 Mp/s. So if the ISP is
configured to write the images to memory in the CSI-2 receiver, the maximum
pixel rate is 200 Mp/s, not 100. This kind of limitations are quite common
in ISPs and not limited to OMAP 3 ISP. Should the sensor driver know which
blocks are part of the pipeline, and limit minimum frame time based on that?
I admit not everything is in place yet for the full solution of this
problem, but making the pixel rate configurable available to the user space
is definitely a part of it. Ideally the user should be provided a way to
enumerate these limitations to be able to make informed decisions.
It shouldn't be the responsibility of the regular applications to deal with
these things, though. We need additional functionality in libv4l2 to provide
a higher level interface to the exposure time --- just like for the pipeline
configuration. On the other hand, an application tailored to a device must
be able to make these decisions by itself.
> From userspace, if for example you change the format and crop,
> you can just set the expo to a value in msec or usec, and get the
> same exposure after your format change.
>
> The driver is IMO the place where we have all the info. Here is some
> example code with usec. (The 522 constant is the fine integration register...)
>
> static int mt9j_expo_to_shutter(struct usb_ovfx2 * ov, u32 expo)
> {
> int rc = 0;
> u32 expo_pix; // exposition in pixclk unit
> u16 coarse_expo;
> u16 row_time;
> expo_pix = expo * 96; /// pixel clock in MHz
> MT9J_RREAD(ov, LINE_LENGTH_PCK, &row_time);
> expo_pix = expo_pix - 522;
> coarse_expo = (expo_pix + row_time/2)/ row_time;
> MT9J_RWRITE(ov, COARSE_EXPO_REG, coarse_expo);
> return rc;
> }
>
> static int mt9j_shutter_to_expo(struct usb_ovfx2 * ov, u32 * expo)
> {
> int rc = 0;
> u32 expo_pix; // exposition in pixclk unit
> u16 coarse_expo;
> u16 row_time;
> MT9J_RREAD(ov, LINE_LENGTH_PCK, &row_time);
> MT9J_RREAD(ov, COARSE_EXPO_REG, &coarse_expo);
> expo_pix = row_time * coarse_expo + 522;
> *expo = expo_pix / (96);
> return rc;
> }
>
> Maybe you have enough on your plate for now, and this can
> wait after inclusion, but it is a nice abstraction to have from
> userspace point of view.
Kind regards,
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi jabber/XMPP/Gmail: sailus@retiisi.org.uk
next prev parent reply other threads:[~2012-03-11 9:04 UTC|newest]
Thread overview: 93+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-06 16:32 [PATCH v5 0/35] V4L2 subdev and sensor control changes, SMIA++ driver and N9 camera board code Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 01/35] v4l: Introduce integer menu controls Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 02/35] v4l: Document " Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 03/35] vivi: Add an integer menu test control Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 04/35] v4l: VIDIOC_SUBDEV_S_SELECTION and VIDIOC_SUBDEV_G_SELECTION IOCTLs Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 05/35] v4l: vdev_to_v4l2_subdev() should have return type "struct v4l2_subdev *" Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 06/35] v4l: Check pad number in get try pointer functions Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 07/35] v4l: Support s_crop and g_crop through s/g_selection Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 08/35] v4l: Add subdev selections documentation: svg and dia files Sakari Ailus
2012-03-06 16:42 ` Laurent Pinchart
2012-03-06 16:32 ` [PATCH v5 09/35] v4l: Add subdev selections documentation Sakari Ailus
2012-03-06 16:44 ` Laurent Pinchart
2012-03-07 8:53 ` Michael Jones
2012-03-07 18:11 ` Sakari Ailus
2012-03-15 9:55 ` Sylwester Nawrocki
2012-03-15 13:00 ` Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 10/35] v4l: Mark VIDIOC_SUBDEV_G_CROP and VIDIOC_SUBDEV_S_CROP obsolete Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 11/35] v4l: Image source control class Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 12/35] v4l: Image processing " Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 13/35] v4l: Document raw bayer 4CC codes Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 14/35] v4l: Add DPCM compressed raw bayer pixel formats Sakari Ailus
2012-03-21 9:37 ` Prabhakar Lad
2012-03-21 9:53 ` Sakari Ailus
2012-03-21 11:44 ` [PATCH v5.5 14/40] " Sakari Ailus
2012-03-21 12:08 ` Prabhakar Lad
2012-03-06 16:32 ` [PATCH v5 15/35] media: Add link_validate() op to check links to the sink pad Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 16/35] v4l: Improve sub-device documentation for pad ops Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 17/35] v4l: Implement v4l2_subdev_link_validate() Sakari Ailus
2012-03-06 16:32 ` [PATCH v5 18/35] v4l: Allow changing control handler lock Sakari Ailus
2012-05-14 15:27 ` Sylwester Nawrocki
2012-05-14 15:45 ` Sakari Ailus
2012-05-14 16:02 ` Sylwester Nawrocki
2012-05-14 15:48 ` Sylwester Nawrocki
2012-03-06 16:33 ` [PATCH v5 19/35] omap3isp: Support additional in-memory compressed bayer formats Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 20/35] omap3isp: Move definitions required by board code under include/media Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 21/35] omap3: add definition for CONTROL_CAMERA_PHY_CTRL Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 22/35] omap3isp: Move setting constaints above media_entity_pipeline_start Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 23/35] omap3isp: Assume media_entity_pipeline_start may fail Sakari Ailus
2012-03-06 16:45 ` Laurent Pinchart
2012-03-06 16:33 ` [PATCH v5 24/35] omap3isp: Add lane configuration to platform data Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 25/35] omap3isp: Collect entities that are part of the pipeline Sakari Ailus
2012-03-07 10:35 ` Laurent Pinchart
2012-03-07 17:20 ` Sakari Ailus
2012-03-07 17:22 ` [PATCH v5.1 " Sakari Ailus
2012-03-07 23:50 ` Laurent Pinchart
2012-03-09 18:44 ` [PATCH " Sakari Ailus
2012-03-09 20:31 ` [PATCH v5.3 " Sakari Ailus
2012-03-09 20:34 ` Laurent Pinchart
2012-03-08 17:05 ` Sakari Ailus
2012-03-07 10:50 ` [PATCH v5 " Laurent Pinchart
2012-03-07 15:24 ` Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 26/35] omap3isp: Add information on external subdev to struct isp_pipeline Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 27/35] omap3isp: Introduce isp_video_check_external_subdevs() Sakari Ailus
2012-03-07 10:43 ` Laurent Pinchart
2012-03-07 17:49 ` Sakari Ailus
2012-03-07 18:52 ` Laurent Pinchart
2012-03-07 23:57 ` Sakari Ailus
2012-03-08 17:04 ` [PATCH v5.3 " Sakari Ailus
2012-03-08 18:05 ` Laurent Pinchart
2012-03-07 18:14 ` [PATCH v5.1 " Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 28/35] omap3isp: Use external rate instead of vpcfg Sakari Ailus
2012-03-07 10:53 ` Laurent Pinchart
2012-03-07 17:54 ` Sakari Ailus
2012-03-07 18:34 ` Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 29/35] omap3isp: Default link validation for ccp2, csi2, preview and resizer Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 30/35] omap3isp: Move CCDC link validation to ccdc_link_validate() Sakari Ailus
2012-03-07 11:00 ` Laurent Pinchart
2012-03-07 18:02 ` Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 31/35] omap3isp: Configure CSI-2 phy based on platform data Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 32/35] omap3isp: Add resizer data rate configuration to resizer_link_validate Sakari Ailus
2012-03-07 11:01 ` Laurent Pinchart
2012-03-06 16:33 ` [PATCH v5 33/35] omap3isp: Find source pad from external entity Sakari Ailus
2012-03-07 11:04 ` Laurent Pinchart
2012-03-07 18:08 ` Sakari Ailus
2012-03-06 16:33 ` [PATCH v5 34/35] smiapp: Generic SMIA++/SMIA PLL calculator Sakari Ailus
2012-03-07 12:26 ` Laurent Pinchart
2012-03-08 13:29 ` Sakari Ailus
2012-03-08 13:57 ` [PATCH v5.1 " Sakari Ailus
2012-03-08 14:38 ` Laurent Pinchart
2012-03-08 14:48 ` Sakari Ailus
2012-03-08 14:49 ` [PATCH v5.2 " Sakari Ailus
2012-03-08 14:51 ` Laurent Pinchart
2012-03-08 13:57 ` [PATCH v5.1 35/35] smiapp: Add driver Sakari Ailus
2012-03-08 14:46 ` Laurent Pinchart
2012-03-08 16:49 ` [PATCH v5.3 " Sakari Ailus
2012-03-11 13:37 ` Laurent Pinchart
2012-03-11 14:03 ` Sakari Ailus
2012-03-11 14:45 ` [PATCH v5.4 " Sakari Ailus
2012-03-11 16:32 ` Laurent Pinchart
2012-03-08 15:06 ` [PATCH v5.1 " jean-philippe francois
2012-03-11 9:04 ` Sakari Ailus [this message]
2012-03-12 9:44 ` jean-philippe francois
2012-03-06 16:33 ` [PATCH v5 35/35] rm680: Add camera init 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=20120311090434.GH1591@valkosipuli.localdomain \
--to=sakari.ailus@iki.fi \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dacohen@gmail.com \
--cc=hverkuil@xs4all.nl \
--cc=jp.francois@cynove.com \
--cc=k.debski@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=pradeep.sawlani@gmail.com \
--cc=riverful@gmail.com \
--cc=snjw23@gmail.com \
--cc=t.stanislaws@samsung.com \
--cc=teturtia@gmail.com \
--cc=tuukkat76@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