linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Cc: sre@kernel.org, pali.rohar@gmail.com, pavel@ucw.cz,
	linux-media@vger.kernel.org
Subject: Re: [RFC PATCH 01/24] V4L fixes
Date: Fri, 29 Apr 2016 10:41:52 +0300	[thread overview]
Message-ID: <20160429074151.GF32125@valkosipuli.retiisi.org.uk> (raw)
In-Reply-To: <571E46B2.7060300@gmail.com>

Hi Ivaylo,

On Mon, Apr 25, 2016 at 07:32:50PM +0300, Ivaylo Dimitrov wrote:
> Hi,
> 
> On 25.04.2016 16:25, Sakari Ailus wrote:
> >Hi Ivaylo,
> >
> >Thanks for the set!
> >
> >On Mon, Apr 25, 2016 at 12:08:01AM +0300, Ivaylo Dimitrov wrote:
> >>From: "Tuukka.O Toivonen" <tuukka.o.toivonen@nokia.com>
> >>
> >>Squashed from the following upstream commits:
> >>
> >>V4L: Create control class for sensor mode
> >>V4L: add ad5820 focus specific custom controls
> >>V4L: add V4L2_CID_TEST_PATTERN
> >>V4L: Add V4L2_CID_MODE_OPSYSCLOCK for reading output system clock
> >>
> >>Signed-off-by: Tuukka Toivonen <tuukka.o.toivonen@nokia.com>
> >>Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> >>---
> >>  include/uapi/linux/v4l2-controls.h | 17 +++++++++++++++++
> >>  1 file changed, 17 insertions(+)
> >>
> >>diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
> >>index b6a357a..23011cc 100644
> >>--- a/include/uapi/linux/v4l2-controls.h
> >>+++ b/include/uapi/linux/v4l2-controls.h
> >>@@ -62,6 +62,7 @@
> >>  #define V4L2_CTRL_CLASS_FM_RX		0x00a10000	/* FM Receiver controls */
> >>  #define V4L2_CTRL_CLASS_RF_TUNER	0x00a20000	/* RF tuner controls */
> >>  #define V4L2_CTRL_CLASS_DETECT		0x00a30000	/* Detection controls */
> >>+#define V4L2_CTRL_CLASS_MODE		0x00a40000	/* Sensor mode information */
> >>
> >>  /* User-class control IDs */
> >>
> >>@@ -974,4 +975,20 @@ enum v4l2_detect_md_mode {
> >>  #define V4L2_CID_DETECT_MD_THRESHOLD_GRID	(V4L2_CID_DETECT_CLASS_BASE + 3)
> >>  #define V4L2_CID_DETECT_MD_REGION_GRID		(V4L2_CID_DETECT_CLASS_BASE + 4)
> >>
> >>+/* SMIA-type sensor information */
> >>+#define V4L2_CID_MODE_CLASS_BASE		(V4L2_CTRL_CLASS_MODE | 0x900)
> >>+#define V4L2_CID_MODE_CLASS			(V4L2_CTRL_CLASS_MODE | 1)
> >>+#define V4L2_CID_MODE_FRAME_WIDTH		(V4L2_CID_MODE_CLASS_BASE+1)
> >>+#define V4L2_CID_MODE_FRAME_HEIGHT		(V4L2_CID_MODE_CLASS_BASE+2)
> >>+#define V4L2_CID_MODE_VISIBLE_WIDTH		(V4L2_CID_MODE_CLASS_BASE+3)
> >>+#define V4L2_CID_MODE_VISIBLE_HEIGHT		(V4L2_CID_MODE_CLASS_BASE+4)
> >
> >The interface here pre-dates the selection API. The frame width and height
> >is today conveyed to the bridge driver by the smiapp driver in the scaler
> >(or binner in case of the lack of the scaler) sub-device's source pad
> >format.
> >
> >(While that's the current interface, I'm not entirely happy with it; it
> >requires more sub-devices to be created for the same I2C device). I think in
> >this case you'd need one more to properly control the sensor.
> >
> 
> By looking at the code, it seems those are read-only, so I don't think it
> make sense to add a binner sub-device with read-only controls.

Well, I can't disagree with that. However, I think a number of other drivers
would benefit from doing this properly --- the V4L2 selection API which
defines a strict order for the processing steps does not suit to this use
case very well. You could use the crop selection rectangle for now, albeit
that doesn't fully express what the sensor does, or use private controls. We
could then later replace this with something better.

> 
> >>+#define V4L2_CID_MODE_PIXELCLOCK		(V4L2_CID_MODE_CLASS_BASE+5)
> >>+#define V4L2_CID_MODE_SENSITIVITY		(V4L2_CID_MODE_CLASS_BASE+6)
> >>+#define V4L2_CID_MODE_OPSYSCLOCK		(V4L2_CID_MODE_CLASS_BASE+7)
> >
> >While I don't remember quite what the sensitivity value was about (it could
> >be e.g. binning summing / averaging), the other two values are passed to
> >(and also controlled by) the user space using controls. There are
> >V4L2_CID_PIXEL_RATE and V4L2_CID_LINK_FREQ or such.
> >
> 
> I've already made a change so V4L2_CID_PIXEL_RATE is used in et8ek8 driver (https://github.com/freemangordon/linux-n900/commit/54433e50451b4ed6cc6e3b25d149c5cacd97e438),
> but V4L2_CID_MODE_PIXELCLOCK is used in smiapp driver, which seems to expose
> its own controls. Not sure those are needed though. And if, what for. I hope
> you know better than me.

It's needed to tell the sensor timings to the user space. The camera control
algorithms need that information.

> 
> I guess V4L2_CID_MODE_OPSYSCLOCK can be easily transformed to
> V4L2_CID_LINK_FREQ in the same way as V4L2_CID_MODE_PIXELCLOCK.

Yes.

> 
> >>+
> >>+/* Control IDs specific to the AD5820 driver as defined by V4L2 */
> >>+#define V4L2_CID_FOCUS_AD5820_BASE 		(V4L2_CTRL_CLASS_CAMERA | 0x10af)
> >>+#define V4L2_CID_FOCUS_AD5820_RAMP_TIME		(V4L2_CID_FOCUS_AD5820_BASE+0)
> >>+#define V4L2_CID_FOCUS_AD5820_RAMP_MODE		(V4L2_CID_FOCUS_AD5820_BASE+1)
> >
> >The ad5820 driver isn't in upstream at the moment. It should be investigated
> >whether there is a possibility to have standard V4L2 controls for lens
> >devices, or whether device specific controls should be implemented instead.
> >Device specific controls are a safe choice in this case, but they should be
> >in a separate patch, possibly one that would also include the lens driver
> >itself.
> >
> 
> Yeah, I sent the whole patch for the sake of not losing the history too
> much.

There's still work to be done but I'm very happy to see that you and a few
others are contributing. :-)

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

  reply	other threads:[~2016-04-29  7:42 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160420081427.GZ32125@valkosipuli.retiisi.org.uk>
2016-04-24 21:08 ` [RFC PATCH 00/24] Make Nokia N900 cameras working Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 01/24] V4L fixes Ivaylo Dimitrov
2016-04-24 22:05     ` Pavel Machek
2016-04-25  7:29     ` Hans Verkuil
2016-04-25 13:25     ` Sakari Ailus
2016-04-25 16:32       ` Ivaylo Dimitrov
2016-04-29  7:41         ` Sakari Ailus [this message]
2016-04-24 21:08   ` [RFC PATCH 02/24] smiaregs: Generic i2c register writing Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 03/24] et8ek8: Toshiba 5MP sensor driver Ivaylo Dimitrov
2016-05-01 10:44     ` Sakari Ailus
2016-05-01 12:31       ` Ivaylo Dimitrov
2016-05-01 12:32         ` Ivaylo Dimitrov
2016-05-01 12:50       ` Ivaylo Dimitrov
2016-05-01 13:41         ` Sakari Ailus
2016-05-03 14:50           ` [PATCH] [media]: Driver for Toshiba et8ek8 5MP sensor Ivaylo Dimitrov
2016-05-22 10:07             ` Ivaylo Dimitrov
2016-05-24 11:19             ` Pavel Machek
2016-06-04 19:16               ` Ivaylo Dimitrov
2016-06-06  9:04               ` Sylwester Nawrocki
2016-05-25 21:45             ` Sakari Ailus
2016-06-04 19:54               ` Ivaylo Dimitrov
2016-06-09 23:13                 ` Sakari Ailus
2016-04-24 21:08   ` [RFC PATCH 04/24] smiapp-pll: Take existing divisor into account in minimum divisor check Ivaylo Dimitrov
2016-05-01 10:45     ` Sakari Ailus
2016-05-03 18:25       ` Ivaylo Dimitrov
2016-05-24  9:09       ` Pali Rohár
2016-05-24 10:17     ` Pavel Machek
2016-04-24 21:08   ` [RFC PATCH 05/24] smiapp: Add smiapp_has_quirk() to tell whether a quirk is implemented Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 06/24] smiapp: Add quirk control support Ivaylo Dimitrov
2016-05-01 10:46     ` Sakari Ailus
2016-05-03 18:32       ` Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 07/24] v4l: of: Call CSI2 bus csi2, not csi Ivaylo Dimitrov
2016-04-29 13:22     ` Pavel Machek
2016-04-24 21:08   ` [RFC PATCH 08/24] v4l: of: Obtain data bus type from bus-type property Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 09/24] v4l: Add CSI1 and CCP2 bus type to enum v4l2_mbus_type Ivaylo Dimitrov
2016-04-29 13:27     ` Pavel Machek
2016-04-24 21:08   ` [RFC PATCH 10/24] v4l: of: Separate lane parsing from CSI-2 bus parameter parsing Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 11/24] dt: bindings: v4l: Add bus-type video interface property Ivaylo Dimitrov
2016-04-29 13:28     ` Pavel Machek
2016-04-24 21:08   ` [RFC PATCH 12/24] dt: bindings: Add CSI1/CCP2 related properties to video-interfaces.txt Ivaylo Dimitrov
2016-04-29 13:39     ` Pavel Machek
2016-04-24 21:08   ` [RFC PATCH 13/24] v4l: of: Support CSI-1 and CCP2 busses Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 14/24] media: et8ek8: add device tree binding document Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 15/24] media: add subdev type for bus switch Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 16/24] media: video-bus-switch: new driver Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 17/24] smiapp: add CCP2 support Ivaylo Dimitrov
2016-05-01 10:57     ` Sakari Ailus
2016-04-24 21:08   ` [RFC PATCH 18/24] v4l2-async: per notifier locking Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 19/24] v4l2_device_register_subdev_nodes: allow calling multiple times Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 20/24] ARM: dts: omap3-n900: enable cameras Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 21/24] omap3isp: dt: Add support for CSI1/CCP2 busses Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 22/24] [media] omap3isp: Correctly set IO_OUT_SEL and VP_CLK_POL for CCP2 mode Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 23/24] [media] omap3isp: Make sure CSI1 interface is enabled in CPP2 mode Ivaylo Dimitrov
2016-04-24 21:08   ` [RFC PATCH 24/24] ARM: dts: omap3-n900: enable cameras - remove invalid entry Ivaylo Dimitrov
2016-04-24 21:55   ` [RFC PATCH 00/24] Make Nokia N900 cameras working Pavel Machek
2016-04-25  6:33     ` Ivaylo Dimitrov
2016-04-25 17:09       ` Pavel Machek
2016-04-25 17:21         ` Ivaylo Dimitrov
2016-04-27 21:07           ` Pavel Machek
2016-04-25 10:40   ` Pali Rohár
2016-04-25 14:06     ` Pavel Machek
2016-04-25 14:09       ` Hans Verkuil
2016-04-27 21:09         ` Pavel Machek
2016-04-25 14:14       ` Pali Rohár
2016-04-25 17:14         ` Pali Rohár
2016-04-25 16:58   ` Pavel Machek
2016-04-25 17:17     ` Ivaylo Dimitrov
2016-04-25 18:40       ` Pavel Machek
2016-04-25 19:17         ` Ivaylo Dimitrov
2016-04-25 20:41           ` Pavel Machek
2016-04-25 20:53             ` Ivaylo Dimitrov
2016-04-25 22:07               ` Pavel Machek
2016-04-26  4:21                 ` Ivaylo Dimitrov
2016-04-27  8:30                   ` Pavel Machek
2016-04-27  3:08   ` Sebastian Reichel
2016-04-27  5:05     ` Ivaylo Dimitrov
2016-04-27  6:57       ` Ivaylo Dimitrov
2016-04-27 16:42         ` Sebastian Reichel
2016-04-27 16:45           ` Pavel Machek
2016-04-27 16:59             ` Sebastian Reichel
2016-05-02  7:06               ` Pavel Machek
2016-04-27 17:12           ` Ивайло Димитров
2016-04-27 19:05             ` Pavel Machek
2016-04-29  0:05             ` Sebastian Reichel
2016-04-29 17:45               ` Sebastian Reichel
2016-04-29 18:44                 ` Ivaylo Dimitrov
2016-05-01 10:37                   ` Sakari Ailus
2016-05-01  9:03                 ` Pavel Machek
2016-04-27 20:30           ` Pavel Machek
2016-06-17 16:42     ` Nokia N900 cameras -- pipeline setup in python (was Re: [RFC PATCH 00/24] Make Nokia N900 cameras working) Pavel Machek
2016-06-17 17:12       ` Pavel Machek
2016-06-20 17:00         ` Pavel Machek
2016-06-20 20:59         ` Sakari Ailus
2016-06-21 18:05           ` Pavel Machek
2016-06-22  7:22             ` Sakari Ailus
2016-06-22 11:18           ` Pavel Machek
2016-07-01  7:31           ` square-only image on Nokia N900 camera " Pavel Machek
2016-07-01  8:50             ` Pavel Machek
2016-07-01 11:01               ` Pavel Machek
2016-07-01 19:40                 ` Pavel Machek
2016-06-24 16:21   ` [RFC PATCH 00/24] Make Nokia N900 cameras working Pavel Machek
2016-08-27 13:48   ` fcam-dev support for new kernels -- " Pavel Machek

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=20160429074151.GF32125@valkosipuli.retiisi.org.uk \
    --to=sakari.ailus@iki.fi \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=pali.rohar@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=sre@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).