@@ -284,6 +284,8 @@ static const char *v4l2_ioctls[] = {
[_IOC_NR(VIDIOC_DBG_G_CHIP_IDENT)] = "VIDIOC_DBG_G_CHIP_IDENT",
[_IOC_NR(VIDIOC_S_HW_FREQ_SEEK)] = "VIDIOC_S_HW_FREQ_SEEK",
#endif
+ [_IOC_NR(VIDIOC_S_COLOR_SPACE_CONV)] = "VIDIOC_S_COLOR_SPACE_CONV",
+ [_IOC_NR(VIDIOC_G_COLOR_SPACE_CONV)] = "VIDIOC_G_COLOR_SPACE_CONV",
};
#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls)
@@ -1795,6 +1797,23 @@ static long __video_do_ioctl(struct file *file,
break;
}
+ /*---------------Color space conversion------------------------------*/
+ case VIDIOC_S_COLOR_SPACE_CONV:
+ {
+ struct v4l2_color_space_conv *p = arg;
+ if (!ops->vidioc_s_color_space_conv)
+ break;
+ ret = ops->vidioc_s_color_space_conv(file, fh, p);
+ break;
+ }
+ case VIDIOC_G_COLOR_SPACE_CONV:
+ {
+ struct v4l2_color_space_conv *p = arg;
+ if (!ops->vidioc_g_color_space_conv)
+ break;
+ ret = ops->vidioc_g_color_space_conv(file, fh, p);
+ break;
+ }
default:
{
if (!ops->vidioc_default)
@@ -1281,6 +1281,18 @@ struct v4l2_rds_data {
#define V4L2_RDS_BLOCK_ERROR 0x80
/*
+ * Color conversion
+ * User needs to pass pointer to color conversion matrix
+ * defined by hardware
+ */
+struct v4l2_color_space_conv {
+ __s32 coefficients[3][3];
+ __s32 const_factor;
+ __s32 input_offs[3];
+ __s32 output_offs[3];
+};
+
+/*
* A U D I O
*/
struct v4l2_audio {
@@ -1619,6 +1631,8 @@ struct v4l2_dbg_chip_ident {
#endif
#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
+#define VIDIOC_S_COLOR_SPACE_CONV _IOW('V', 83, struct v4l2_color_space_conv)
+#define VIDIOC_G_COLOR_SPACE_CONV _IOR('V', 84, struct v4l2_color_space_conv)
/* Reminder: when adding new ioctls please add support for them to
drivers/media/video/v4l2-compat-ioctl32.c as well! */
@@ -242,6 +242,10 @@ struct v4l2_ioctl_ops {
/* For other private ioctls */
long (*vidioc_default) (struct file *file, void *fh,
int cmd, void *arg);
+ int (*vidioc_s_color_space_conv) (struct file *file, void *fh,
+ struct v4l2_color_space_conv *a);
+ int (*vidioc_g_color_space_conv) (struct file *file, void *fh,
+ struct v4l2_color_space_conv *a);
};