V4L changes for OMAP 3 camera
cover V4L changes for OMAP 3 camera
Hi,
This patchset extends V4L2 interface and especially v4l2-int-if somewhat. The new functionality is there to support the OMAP 3 camera driver.
Our aim is to get these patches into v4l-dvb tree and further to Linus' tree. The OMAP 3 camera driver, which is dependent on these patches, is targeted to linux-omap tree through [email protected] mailing list. It is unlikely that it would be useful (or even compile) without many of the changes in linux-omap tree.
The patches apply against v4l-dvb, Linus' tree or linux-omap.
Comments will be appreciated. :-)
Regards,
Signature · 7 lines
Sakari Ailus [email protected] -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/7 V4L: Int if: Add cropcap, g_crop and s_crop commands.
--- include/media/v4l2-int-device.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
include/media/v4l2-int-device.h +6 -0
@@ -170,6 +170,9 @@ enum v4l2_int_ioctl_num { vidioc_int_queryctrl_num, vidioc_int_g_ctrl_num, vidioc_int_s_ctrl_num, + vidioc_int_cropcap_num, + vidioc_int_g_crop_num, + vidioc_int_s_crop_num, vidioc_int_g_parm_num, vidioc_int_s_parm_num,
@@ -266,6 +269,9 @@ V4L2_INT_WRAPPER_1(try_fmt_cap, struct v4l2_format, *); V4L2_INT_WRAPPER_1(queryctrl, struct v4l2_queryctrl, *); V4L2_INT_WRAPPER_1(g_ctrl, struct v4l2_control, *); V4L2_INT_WRAPPER_1(s_ctrl, struct v4l2_control, *); +V4L2_INT_WRAPPER_1(cropcap, struct v4l2_cropcap, *); +V4L2_INT_WRAPPER_1(g_crop, struct v4l2_crop, *); +V4L2_INT_WRAPPER_1(s_crop, struct v4l2_crop, *); V4L2_INT_WRAPPER_1(g_parm, struct v4l2_streamparm, *); V4L2_INT_WRAPPER_1(s_parm, struct v4l2_streamparm, *);
Signature · 6 lines
1.5.0.6 -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list
PATCH 3/7 V4L: Add 10-bit RAW Bayer formats
Add 10-bit raw bayer format expanded to 16 bits. Adds also definition for 10-bit raw bayer format dpcm-compressed to 8 bits.
--- include/linux/videodev2.h | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
include/linux/videodev2.h +7 -0
@@ -315,6 +315,13 @@ struct v4l2_pix_format {/* see http://www.siliconimaging.com/RGB%20Bayer.htm */ #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1')/* 8 BGBG.. GRGR.. */ #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G')/* 8 GBGB.. RGRG.. */ +/* +* 10bit raw bayer, expanded to 16 bits +* xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb... +*/ +#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') +/* 10bit raw bayer DPCM compressed to 8 bits */ +#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2')/* 16 BGBG.. GRGR.. */ /* compressed formats */
Signature · 6 lines
1.5.0.6 -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list
PATCH 4/7 V4L: Add VIDIOC_G_PRIV_MEM ioctl
Some devices, for example image sensors, contain settings in their EEPROM memory that are useful to userspace programs. VIDIOC_G_PRIV_MEM can be used to read those settings.
This patch adds also the corresponding v4l2_int_device command.
--- include/linux/videodev2.h | 8 ++++++++ include/media/v4l2-int-device.h | 3 +++ 2 files changed, 11 insertions(+), 0 deletions(-)
include/linux/videodev2.h +8 -0
@@ -1357,6 +1357,13 @@ struct v4l2_chip_ident {__u32 revision;/* chip revision, chip specific */ }; +/* VIDIOC_G_PRIV_MEM */ +struct v4l2_priv_mem { +__u32 offset;/* offset to data */ +__u32 length;/* memory allocated to ptr or read length */ +void *ptr;/* pointer to allocated memory */ +}; +/* * I O C T L C O D E S F O R V I D E O D E V I C E S *
@@ -1430,6 +1437,7 @@ struct v4l2_chip_ident {#define VIDIOC_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_chip_ident)#endif #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) +#define VIDIOC_G_PRIV_MEM _IOWR('V', 83, struct v4l2_priv_mem)#ifdef __OLD_VIDIOC_/* for compatibility, will go away some day */
include/media/v4l2-int-device.h +3 -0
@@ -208,6 +208,8 @@ enum v4l2_int_ioctl_num { vidioc_int_init_num,/* VIDIOC_INT_G_CHIP_IDENT */ vidioc_int_g_chip_ident_num, +/* VIDIOC_INT_G_PRIV_MEM */ + vidioc_int_g_priv_mem_num,/* *
@@ -285,5 +287,6 @@ V4L2_INT_WRAPPER_1(g_needs_reset, void, *);V4L2_INT_WRAPPER_0 (reset);V4L2_INT_WRAPPER_0 (init); V4L2_INT_WRAPPER_1(g_chip_ident, int, *); +V4L2_INT_WRAPPER_1(g_priv_mem, struct v4l2_priv_mem, *);#endif
Signature · 6 lines
1.5.0.6 -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list
PATCH 5/7 V4L: Int if: Define new power state changes
Use enum v4l2_power instead of int as second argument to vidioc_int_s_power. The new functionality is that standby state is also recognised.
Possible transitions:
off -> on (V4L2_POWER_ON)
on -> standby (V4L2_POWER_STANDBY)
on -> off (V4L2_POWER_OFF)
standby -> off (V4L2_POWER_OFF)
standby -> on (V4L2_POWER_RESUME)
--- include/media/v4l2-int-device.h | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-)
include/media/v4l2-int-device.h +9 -2
@@ -96,6 +96,13 @@ int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg);* */ +enum v4l2_power { +V4L2_POWER_OFF =0 , +V4L2_POWER_ON , +V4L2_POWER_STANDBY , +V4L2_POWER_RESUME , +}; +/* Slave interface type. */ enum v4l2_if_type {/*
@@ -185,7 +192,7 @@ enum v4l2_int_ioctl_num { vidioc_int_dev_init_num =1000 ,/* Delinitialise the device at slave detach. */ vidioc_int_dev_exit_num, -/* Set device power state: 0 is off, non-zero is on. */ +/* Set device power state. */ vidioc_int_s_power_num,/* * Get slave private data, e.g. platform-specific slave
@@ -279,7 +286,7 @@ V4L2_INT_WRAPPER_1(s_parm, struct v4l2_streamparm, *);V4L2_INT_WRAPPER_0 (dev_init);V4L2_INT_WRAPPER_0 (dev_exit); -V4L2_INT_WRAPPER_1(s_power, int, ); +V4L2_INT_WRAPPER_1(s_power, enum v4l2_power, ); V4L2_INT_WRAPPER_1(g_priv, void, *); V4L2_INT_WRAPPER_1(g_ifparm, struct v4l2_ifparm, *); V4L2_INT_WRAPPER_1(g_needs_reset, void, *);
Signature · 6 lines
1.5.0.6 -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list
PATCH 6/7 V4L: Int if: Export more interfaces to modules
Export v4l2_int_device_try_attach_all. This allows initiating the initialisation of int if device after the drivers have been registered.
Also allow drivers to call ioctls if v4l2-int-if was compiled as module.
--- drivers/media/video/v4l2-int-device.c | 5 ++++- include/media/v4l2-int-device.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletions(-)
drivers/media/video/v4l2-int-device.c +4 -1
@@ -32,7 +32,7 @@static DEFINE_MUTEX (mutex);static LIST_HEAD (int_list); -static void v4l2_int_device_try_attach_all (void ) +void v4l2_int_device_try_attach_all (void ) {struct v4l2_int_device *m, *s;
@@ -66,6 +66,7 @@ static void v4l2_int_device_try_attach_all(void) } } } +EXPORT_SYMBOL_GPL (v4l2_int_device_try_attach_all);static int ioctl_sort_cmp (const void *a,const void *b) {
@@ -144,6 +145,7 @@ int v4l2_int_ioctl_0(struct v4l2_int_device *d, int cmd)find_ioctl (d->u.slave, cmd, (v4l2_int_ioctl_func *)no_such_ioctl_0))(d); } +EXPORT_SYMBOL_GPL (v4l2_int_ioctl_0);static int no_such_ioctl_1 (struct v4l2_int_device *d,void *arg) {
@@ -156,5 +158,6 @@ int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg)find_ioctl (d->u.slave, cmd, (v4l2_int_ioctl_func *)no_such_ioctl_1))(d, arg); } +EXPORT_SYMBOL_GPL (v4l2_int_ioctl_1);MODULE_LICENSE ("GPL" );
include/media/v4l2-int-device.h +2 -0
@@ -84,6 +84,8 @@ struct v4l2_int_device {void *priv; }; +void v4l2_int_device_try_attach_all (void ); +int v4l2_int_device_register (struct v4l2_int_device *d);void v4l2_int_device_unregister (struct v4l2_int_device *d);
Signature · 6 lines
1.5.0.6 -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list
PATCH 7/7 V4L: Int if: Add enum_framesizes and enum_frameintervals ioctls.
--- include/media/v4l2-int-device.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
include/media/v4l2-int-device.h +4 -0
@@ -205,6 +205,8 @@ enum v4l2_int_ioctl_num { vidioc_int_g_ifparm_num,/* Does the slave need to be reset after VIDIOC_DQBUF? */ vidioc_int_g_needs_reset_num, + vidioc_int_enum_framesizes_num, + vidioc_int_enum_frameintervals_num,/* *
@@ -292,6 +294,8 @@ V4L2_INT_WRAPPER_1(s_power, enum v4l2_power, ); V4L2_INT_WRAPPER_1(g_priv, void, *); V4L2_INT_WRAPPER_1(g_ifparm, struct v4l2_ifparm, *); V4L2_INT_WRAPPER_1(g_needs_reset, void, *); +V4L2_INT_WRAPPER_1(enum_framesizes, struct v4l2_frmsizeenum, *); +V4L2_INT_WRAPPER_1(enum_frameintervals, struct v4l2_frmivalenum, *);V4L2_INT_WRAPPER_0 (reset);V4L2_INT_WRAPPER_0 (init);
Signature · 6 lines
1.5.0.6 -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list
Re: [PATCH 4/7] V4L: Add VIDIOC_G_PRIV_MEM ioctl
In reply to Sakari AilusHi Sakari,
Quoted 3 lines · Sakari Ailus
Some devices, for example image sensors, contain settings in their EEPROM memory that are useful to userspace programs.
VIDIOC_G_PRIV_MEMcan be used to read those settings.
That doesn't really belong to the V4L2 API, does it ? Wouldn't it be better to export the data through sysfs ?
Best regards,
Laurent Pinchart
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
Hi Sakari,
Quoted 13 lines · On Monday 08 September 2008 18:47:51 Sakari Ailus wrote:
Hi,
This patchset extends V4L2 interface and especially v4l2-int-if somewhat. The new functionality is there to support the OMAP 3 camera driver.
Our aim is to get these patches into v4l-dvb tree and further to Linus' tree. The OMAP 3 camera driver, which is dependent on these patches, is targeted to linux-omap tree through [email protected] mailing list. It is unlikely that it would be useful (or even compile) without many of the changes in linux-omap tree.
Quoted 3 lines
The patches apply against v4l-dvb, Linus' tree or linux-omap.
Comments will be appreciated. :-)
Well, here they are:
Patch 1/7 seems to be missing in action. Can you post that one again?
Patch 2/7: Acked-by: Hans Verkuil <[email protected]>
Patch 3/7: Acked-by: Hans Verkuil <[email protected]>
Patch 4/7: I'm having problems with this one. Shouldn't it be better to make this a driver-private ioctl? And then that ioctl can actually return a struct containing those settings, rather than a eeprom dump. It is highly device specific, after all, so let the device extract and return the useful information instead of requiring an application to do that.
Patch 5/7: Please add the explanation regarding possible transitions as comments to the header. Also, why is the RESUME needed? You have three
states: off, standby, on. Resume is not a state, it is a state transition. It seems out of place.
Patch 6/7: Acked-by: Hans Verkuil <[email protected]>
Patch 7/7: Acked-by: Hans Verkuil <[email protected]>
Note: as I have stated in earlier posts, I'm not happy about having multiple interfaces for sensors (soc-camera vs v4l2-int-device). However, since there is no replacement available at the moment I'm not going to hold back this effort.
Regards,
Hans
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
Quoted 1 line · ext Hans Verkuil
Hi Sakari,
Hello again, Hans!
(I'm removing Mohit since he's not involved with OMAP 3 camera driver anymore, as far as I understand.)
Quoted 3 lines
Well, here they are:
Patch 1/7 seems to be missing in action. Can you post that one again?
Oops. I thought I posted this again but it hasn't appeared on the list.
I'll repost that soon.
Quoted 5 lines
Patch 2/7: Acked-by: Hans Verkuil <[email protected]>
Patch 3/7: Acked-by: Hans Verkuil <[email protected]>
Patch 4/7: I'm having problems with this one. Shouldn't it be better to make this a driver-private ioctl? And then that ioctl can actually return a struct containing those settings, rather than a eeprom dump. It is highly device specific, after all, so let the device extract and return the useful information instead of requiring an application to do that.
Laurent Pinchart suggested to make this available through sysfs. I guess this is what we'll do instead for now, at least, as I don't have enough information on different sensors and what they might have in their EEPROMs.
Quoted 1 line
Patch 5/7: Please add the explanation regarding possible transitions as comments to the header. Also, why is the RESUME needed? You have three states: off, standby, on. Resume is not a state, it is a state transition. It seems out of place.
These are not actually states but commands. All except resume are also states. Maybe that's a bit confusing which is bad, I suppose. Anyway, this way the slave driver does not need to know its last power state as long as it supports these state transitions.
I'll add more documentation to v4l2-int-device.h.
Quoted 3 lines
Patch 6/7: Acked-by: Hans Verkuil <[email protected]>
Patch 7/7: Acked-by: Hans Verkuil <[email protected]>
Great!
Quoted 1 line
Note: as I have stated in earlier posts, I'm not happy about having multiple interfaces for sensors (soc-camera vs v4l2-int-device). However, since there is no replacement available at the moment I'm not going to hold back this effort.
Thanks.
(I'll try to pay more attention to v4l2_client and v4l-dvb-ng tree. :))
Signature · 7 lines
Sakari Ailus [email protected] -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list