From 96014a957c7a39392315ce117466549d69eb63b2 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Sat, 18 Oct 2008 12:23:45 -0300 Subject: V4L/DVB (9318): v4l2-int-if: Add command to get slave private data. vidioc_int_g_priv is used to get master's slave-related private data structure. The structure can contain for example master's configuration specific to slave. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-int-device.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h index c8b80e0f065..d9a0053654d 100644 --- a/include/media/v4l2-int-device.h +++ b/include/media/v4l2-int-device.h @@ -184,6 +184,11 @@ enum v4l2_int_ioctl_num { vidioc_int_dev_exit_num, /* Set device power state: 0 is off, non-zero is on. */ vidioc_int_s_power_num, + /* + * Get slave private data, e.g. platform-specific slave + * configuration used by the master. + */ + vidioc_int_g_priv_num, /* Get slave interface parameters. */ vidioc_int_g_ifparm_num, /* Does the slave need to be reset after VIDIOC_DQBUF? */ @@ -267,6 +272,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(g_priv, void, *); V4L2_INT_WRAPPER_1(g_ifparm, struct v4l2_ifparm, *); V4L2_INT_WRAPPER_1(g_needs_reset, void, *); -- cgit v1.2.3 From 621a3739f3b8c7427a789d3b2fe86a80ff234225 Mon Sep 17 00:00:00 2001 From: Sameer Venkatraman Date: Sat, 18 Oct 2008 12:25:28 -0300 Subject: V4L/DVB (9319): v4l2-int-if: Add cropcap, g_crop and s_crop commands. Signed-off-by: Sameer Venkatraman Signed-off-by: Mohit Jalori Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-int-device.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h index d9a0053654d..cee941c39aa 100644 --- a/include/media/v4l2-int-device.h +++ b/include/media/v4l2-int-device.h @@ -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, *); -- cgit v1.2.3 From 733d710b09748a79f70cbb58547d036d28ec566e Mon Sep 17 00:00:00 2001 From: Sergio Aguirre Date: Sat, 18 Oct 2008 12:26:47 -0300 Subject: V4L/DVB (9320): v4l2: 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. Signed-off-by: Sergio Aguirre Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/linux/videodev2.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index d4b03034ee7..4669d7e72e7 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -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 */ -- cgit v1.2.3 From 84389910d0f760cea22a5e58ee16b3b9713d456d Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Sat, 18 Oct 2008 12:27:50 -0300 Subject: V4L/DVB (9321): v4l2-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. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-int-device.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h index cee941c39aa..3351dcffb46 100644 --- a/include/media/v4l2-int-device.h +++ b/include/media/v4l2-int-device.h @@ -96,6 +96,12 @@ 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, +}; + /* Slave interface type. */ enum v4l2_if_type { /* @@ -185,7 +191,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 @@ -277,7 +283,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, *); -- cgit v1.2.3 From 36499e525f6d2c0aba7c7f619d7a6081c56707ca Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Sat, 18 Oct 2008 12:28:36 -0300 Subject: V4L/DVB (9322): v4l2-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. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-int-device.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h index 3351dcffb46..b5cee890923 100644 --- a/include/media/v4l2-int-device.h +++ b/include/media/v4l2-int-device.h @@ -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); -- cgit v1.2.3 From f496bc716613378f2a3f9097a8e3ea4e4e30e79d Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Sat, 18 Oct 2008 12:29:15 -0300 Subject: V4L/DVB (9323): v4l2-int-if: Add enum_framesizes and enum_frameintervals ioctls. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-int-device.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h index b5cee890923..9c2df41dbf9 100644 --- a/include/media/v4l2-int-device.h +++ b/include/media/v4l2-int-device.h @@ -204,6 +204,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, /* * @@ -289,6 +291,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); -- cgit v1.2.3 From d5fbf32f381ad841d9d9537aa1b6f74796703361 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 18 Oct 2008 13:39:53 -0300 Subject: V4L/DVB (9324): v4l2: add video_ioctl2_unlocked for unlocked_ioctl support. Based on an older patch from Sakari Ailus. Cc: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-ioctl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 0bef03add79..3e11dfe38dc 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h @@ -285,7 +285,9 @@ extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg); extern int video_ioctl2(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg); + unsigned int cmd, unsigned long arg); +extern long video_ioctl2_unlocked(struct file *file, + unsigned int cmd, unsigned long arg); /* Include support for obsoleted stuff */ extern int video_usercopy(struct inode *inode, struct file *file, -- cgit v1.2.3 From b1f88407f3767f924cae1d521e815e568996a4ef Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 21 Oct 2008 11:27:20 -0300 Subject: V4L/DVB (9330): Get rid of inode parameter at v4l_compat_translate_ioctl() The inode parameter at v4l_compat_translate_ioctl() were just passed over several places just to keep compatible with fops.ioctl. However, it weren't used anywere. This patch gets hid of this unused parameter. Cc: Laurent Pinchart Cc: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-ioctl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 3e11dfe38dc..7a919433a42 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h @@ -271,13 +271,13 @@ extern const char *v4l2_field_names[]; extern const char *v4l2_type_names[]; /* Compatibility layer interface -- v4l1-compat module */ -typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, +typedef int (*v4l2_kioctl)(struct file *file, unsigned int cmd, void *arg); #ifdef CONFIG_VIDEO_V4L1_COMPAT -int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, +int v4l_compat_translate_ioctl(struct file *file, int cmd, void *arg, v4l2_kioctl driver_ioctl); #else -#define v4l_compat_translate_ioctl(inode, file, cmd, arg, ioctl) (-EINVAL) +#define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL) #endif /* 32 Bits compatibility layer for 64 bits processors */ -- cgit v1.2.3 From 8a522c916d3c3b29a38bd3c8fc3df826d22a9444 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 21 Oct 2008 11:58:39 -0300 Subject: V4L/DVB (9331): Remove unused inode parameter from video_ioctl2 inode is never used on video_ioctl2. Remove it and rename the function to __video_ioctl2. This allows its usage directly as a callback at fops.unlocked_ioctl. Since we still need a callback with inode to be used with fops.ioctl, this patch adds video_ioctl2() that is just a call to __video_ioctl2(). Also, this patch adds some comments about video_ioctl2 and __video_ioctl2 usage at v4l2-ioctl.h. Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-ioctl.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 7a919433a42..e6ba25b3d7c 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h @@ -284,15 +284,25 @@ int v4l_compat_translate_ioctl(struct file *file, extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg); -extern int video_ioctl2(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg); -extern long video_ioctl2_unlocked(struct file *file, - unsigned int cmd, unsigned long arg); - /* Include support for obsoleted stuff */ extern int video_usercopy(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg, int (*func)(struct inode *inode, struct file *file, unsigned int cmd, void *arg)); +/* Standard handlers for V4L ioctl's */ + +/* This prototype is used on fops.unlocked_ioctl */ +extern int __video_ioctl2(struct file *file, + unsigned int cmd, unsigned long arg); + +/* This prototype is used on fops.ioctl + * Since fops.ioctl enables Kernel Big Lock, it is preferred + * to use __video_ioctl2 instead. + * It should be noticed that there's no lock code inside + * video_ioctl2(). + */ +extern int video_ioctl2(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); + #endif /* _V4L2_IOCTL_H */ -- cgit v1.2.3 From 878595f6e7225c996523965b61ce3fe29addca9d Mon Sep 17 00:00:00 2001 From: Darron Broad Date: Tue, 21 Oct 2008 11:28:46 -0300 Subject: V4L/DVB (9335): videobuf: split unregister bus creating self-contained frontend de-allocator This creates a self contained frontend de-allocator for the instances where an adapter has not been registered yet frontend de-allocation may be required. Signed-off-by: Darron Broad Signed-off-by: Mauro Carvalho Chehab --- include/media/videobuf-dvb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/media/videobuf-dvb.h b/include/media/videobuf-dvb.h index 80471c2b634..6ba4f1271d2 100644 --- a/include/media/videobuf-dvb.h +++ b/include/media/videobuf-dvb.h @@ -47,6 +47,7 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f, void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f); struct videobuf_dvb_frontend * videobuf_dvb_alloc_frontend(struct videobuf_dvb_frontends *f, int id); +void videobuf_dvb_dealloc_frontends(struct videobuf_dvb_frontends *f); struct videobuf_dvb_frontend * videobuf_dvb_get_frontend(struct videobuf_dvb_frontends *f, int id); int videobuf_dvb_find_frontend(struct videobuf_dvb_frontends *f, struct dvb_frontend *p); -- cgit v1.2.3