diff options
Diffstat (limited to 'target/linux/brcm2708/patches-3.14/0031-V4L2-Fixes-from-6by9.patch')
-rw-r--r-- | target/linux/brcm2708/patches-3.14/0031-V4L2-Fixes-from-6by9.patch | 101 |
1 files changed, 41 insertions, 60 deletions
diff --git a/target/linux/brcm2708/patches-3.14/0031-V4L2-Fixes-from-6by9.patch b/target/linux/brcm2708/patches-3.14/0031-V4L2-Fixes-from-6by9.patch index ab578bf531..6c7500e872 100644 --- a/target/linux/brcm2708/patches-3.14/0031-V4L2-Fixes-from-6by9.patch +++ b/target/linux/brcm2708/patches-3.14/0031-V4L2-Fixes-from-6by9.patch @@ -230,8 +230,6 @@ Signed-off-by: Dave Stevenson <dsteve@broadcom.com> drivers/media/platform/bcm2835/mmal-vchiq.c | 4 +- 8 files changed, 1292 insertions(+), 178 deletions(-) -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index e89e430..d70da44 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig @@ -694,6 +694,9 @@ CONFIG_DVB_B2C2_FLEXCOP_USB=m @@ -244,8 +242,6 @@ index e89e430..d70da44 100644 CONFIG_RADIO_SI470X=y CONFIG_USB_SI470X=m CONFIG_I2C_SI470X=m -diff --git a/drivers/media/platform/bcm2835/bcm2835-camera.c b/drivers/media/platform/bcm2835/bcm2835-camera.c -index 47fe45d..f809b83 100644 --- a/drivers/media/platform/bcm2835/bcm2835-camera.c +++ b/drivers/media/platform/bcm2835/bcm2835-camera.c @@ -36,7 +36,8 @@ @@ -413,7 +409,7 @@ index 47fe45d..f809b83 100644 }; static struct mmal_fmt *get_format(struct v4l2_format *f) -@@ -229,7 +336,8 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, +@@ -229,7 +336,8 @@ static void buffer_cb(struct vchiq_mmal_ } } else { if (dev->capture.frame_count) { @@ -423,7 +419,7 @@ index 47fe45d..f809b83 100644 s64 runtime_us = pts - dev->capture.vc_start_timestamp; u32 div = 0; -@@ -250,7 +358,7 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, +@@ -250,7 +358,7 @@ static void buffer_cb(struct vchiq_mmal_ USEC_PER_SEC; } v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, @@ -432,7 +428,7 @@ index 47fe45d..f809b83 100644 "with offset %llu to %d.%06d\n", (int)dev->capture.kernel_start_ts. tv_sec, -@@ -425,7 +533,15 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) +@@ -425,7 +533,15 @@ static int start_streaming(struct vb2_qu vchiq_mmal_port_enable(dev->instance, dev->capture.port, buffer_cb); if (ret) { v4l2_err(&dev->v4l2_dev, @@ -449,7 +445,7 @@ index 47fe45d..f809b83 100644 return -1; } -@@ -530,6 +646,7 @@ static int vidioc_enum_fmt_vid_overlay(struct file *file, void *priv, +@@ -530,6 +646,7 @@ static int vidioc_enum_fmt_vid_overlay(s strlcpy(f->description, fmt->name, sizeof(f->description)); f->pixelformat = fmt->fourcc; @@ -457,7 +453,7 @@ index 47fe45d..f809b83 100644 return 0; } -@@ -647,10 +764,18 @@ static int vidioc_g_fbuf(struct file *file, void *fh, +@@ -647,10 +764,18 @@ static int vidioc_g_fbuf(struct file *fi { /* The video overlay must stay within the framebuffer and can't be positioned independently. */ @@ -479,7 +475,7 @@ index 47fe45d..f809b83 100644 return 0; } -@@ -717,6 +842,8 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, +@@ -717,6 +842,8 @@ static int vidioc_enum_fmt_vid_cap(struc strlcpy(f->description, fmt->name, sizeof(f->description)); f->pixelformat = fmt->fourcc; @@ -488,7 +484,7 @@ index 47fe45d..f809b83 100644 return 0; } -@@ -729,20 +856,13 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv, +@@ -729,20 +856,13 @@ static int vidioc_g_fmt_vid_cap(struct f f->fmt.pix.height = dev->capture.height; f->fmt.pix.field = V4L2_FIELD_NONE; f->fmt.pix.pixelformat = dev->capture.fmt->fourcc; @@ -514,7 +510,7 @@ index 47fe45d..f809b83 100644 f->fmt.pix.priv = 0; v4l2_dump_pix_format(1, bcm2835_v4l2_debug, &dev->v4l2_dev, &f->fmt.pix, -@@ -766,21 +886,35 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, +@@ -766,21 +886,35 @@ static int vidioc_try_fmt_vid_cap(struct } f->fmt.pix.field = V4L2_FIELD_NONE; @@ -560,7 +556,7 @@ index 47fe45d..f809b83 100644 v4l2_dump_pix_format(1, bcm2835_v4l2_debug, &dev->v4l2_dev, &f->fmt.pix, __func__); return 0; -@@ -818,8 +952,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, +@@ -818,8 +952,8 @@ static int mmal_setup_components(struct switch (mfmt->mmal_component) { case MMAL_COMPONENT_CAMERA: /* Make a further decision on port based on resolution */ @@ -571,7 +567,7 @@ index 47fe45d..f809b83 100644 camera_port = port = &dev->component[MMAL_COMPONENT_CAMERA]-> output[MMAL_CAMERA_PORT_VIDEO]; -@@ -861,8 +995,9 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, +@@ -861,8 +995,9 @@ static int mmal_setup_components(struct camera_port->es.video.crop.y = 0; camera_port->es.video.crop.width = f->fmt.pix.width; camera_port->es.video.crop.height = f->fmt.pix.height; @@ -582,7 +578,7 @@ index 47fe45d..f809b83 100644 ret = vchiq_mmal_port_set_format(dev->instance, camera_port); -@@ -896,8 +1031,10 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, +@@ -896,8 +1031,10 @@ static int mmal_setup_components(struct preview_port->es.video.crop.y = 0; preview_port->es.video.crop.width = f->fmt.pix.width; preview_port->es.video.crop.height = f->fmt.pix.height; @@ -595,7 +591,7 @@ index 47fe45d..f809b83 100644 ret = vchiq_mmal_port_set_format(dev->instance, preview_port); if (overlay_enabled) { ret = vchiq_mmal_port_connect_tunnel( -@@ -913,7 +1050,9 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, +@@ -913,7 +1050,9 @@ static int mmal_setup_components(struct if (ret) { v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, @@ -606,7 +602,7 @@ index 47fe45d..f809b83 100644 /* ensure capture is not going to be tried */ dev->capture.port = NULL; } else { -@@ -927,69 +1066,91 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, +@@ -927,69 +1066,91 @@ static int mmal_setup_components(struct camera_port->current_buffer.num = camera_port->recommended_buffer.num; @@ -752,7 +748,7 @@ index 47fe45d..f809b83 100644 } } else { /* configure buffering */ -@@ -1001,13 +1162,20 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, +@@ -1001,13 +1162,20 @@ static int mmal_setup_components(struct if (!ret) { dev->capture.fmt = mfmt; dev->capture.stride = f->fmt.pix.bytesperline; @@ -775,7 +771,7 @@ index 47fe45d..f809b83 100644 } } -@@ -1048,14 +1216,115 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, +@@ -1048,14 +1216,115 @@ static int vidioc_s_fmt_vid_cap(struct f } ret = mmal_setup_components(dev, f); @@ -892,7 +888,7 @@ index 47fe45d..f809b83 100644 static const struct v4l2_ioctl_ops camera0_ioctl_ops = { /* overlay */ .vidioc_enum_fmt_vid_overlay = vidioc_enum_fmt_vid_overlay, -@@ -1084,6 +1353,51 @@ static const struct v4l2_ioctl_ops camera0_ioctl_ops = { +@@ -1084,6 +1353,51 @@ static const struct v4l2_ioctl_ops camer .vidioc_querybuf = vb2_ioctl_querybuf, .vidioc_qbuf = vb2_ioctl_qbuf, .vidioc_dqbuf = vb2_ioctl_dqbuf, @@ -944,7 +940,7 @@ index 47fe45d..f809b83 100644 .vidioc_streamon = vb2_ioctl_streamon, .vidioc_streamoff = vb2_ioctl_streamoff, -@@ -1122,8 +1436,10 @@ static int set_camera_parameters(struct vchiq_mmal_instance *instance, +@@ -1122,8 +1436,10 @@ static int set_camera_parameters(struct .max_stills_h = MAX_HEIGHT, .stills_yuv422 = 1, .one_shot_stills = 1, @@ -957,7 +953,7 @@ index 47fe45d..f809b83 100644 .num_preview_video_frames = 3, .stills_capture_circular_buffer_height = 0, .fast_preview_resume = 0, -@@ -1141,6 +1457,7 @@ static int __init mmal_init(struct bm2835_mmal_dev *dev) +@@ -1141,6 +1457,7 @@ static int __init mmal_init(struct bm283 { int ret; struct mmal_es_format *format; @@ -965,7 +961,7 @@ index 47fe45d..f809b83 100644 ret = vchiq_mmal_init(&dev->instance); if (ret < 0) -@@ -1176,8 +1493,8 @@ static int __init mmal_init(struct bm2835_mmal_dev *dev) +@@ -1176,8 +1493,8 @@ static int __init mmal_init(struct bm283 format->es->video.crop.y = 0; format->es->video.crop.width = 1024; format->es->video.crop.height = 768; @@ -976,7 +972,7 @@ index 47fe45d..f809b83 100644 format = &dev->component[MMAL_COMPONENT_CAMERA]-> -@@ -1192,8 +1509,14 @@ static int __init mmal_init(struct bm2835_mmal_dev *dev) +@@ -1192,8 +1509,14 @@ static int __init mmal_init(struct bm283 format->es->video.crop.y = 0; format->es->video.crop.width = 1024; format->es->video.crop.height = 768; @@ -993,7 +989,7 @@ index 47fe45d..f809b83 100644 format = &dev->component[MMAL_COMPONENT_CAMERA]-> -@@ -1207,13 +1530,22 @@ static int __init mmal_init(struct bm2835_mmal_dev *dev) +@@ -1207,13 +1530,22 @@ static int __init mmal_init(struct bm283 format->es->video.crop.y = 0; format->es->video.crop.width = 2592; format->es->video.crop.height = 1944; @@ -1017,7 +1013,7 @@ index 47fe45d..f809b83 100644 /* get the preview component ready */ ret = vchiq_mmal_component_init( -@@ -1260,6 +1592,14 @@ static int __init mmal_init(struct bm2835_mmal_dev *dev) +@@ -1260,6 +1592,14 @@ static int __init mmal_init(struct bm283 } { @@ -1032,7 +1028,7 @@ index 47fe45d..f809b83 100644 unsigned int enable = 1; vchiq_mmal_port_parameter_set( dev->instance, -@@ -1312,6 +1652,11 @@ static int __init bm2835_mmal_init_device(struct bm2835_mmal_dev *dev, +@@ -1312,6 +1652,11 @@ static int __init bm2835_mmal_init_devic int ret; *vfd = vdev_template; @@ -1044,7 +1040,7 @@ index 47fe45d..f809b83 100644 vfd->v4l2_dev = &dev->v4l2_dev; -@@ -1328,8 +1673,9 @@ static int __init bm2835_mmal_init_device(struct bm2835_mmal_dev *dev, +@@ -1328,8 +1673,9 @@ static int __init bm2835_mmal_init_devic if (ret < 0) return ret; @@ -1056,7 +1052,7 @@ index 47fe45d..f809b83 100644 return 0; } -@@ -1337,9 +1683,9 @@ static int __init bm2835_mmal_init_device(struct bm2835_mmal_dev *dev, +@@ -1337,9 +1683,9 @@ static int __init bm2835_mmal_init_devic static struct v4l2_format default_v4l2_format = { .fmt.pix.pixelformat = V4L2_PIX_FMT_JPEG, .fmt.pix.width = 1024, @@ -1078,8 +1074,6 @@ index 47fe45d..f809b83 100644 ret = mmal_setup_components(dev, &default_v4l2_format); if (ret < 0) { v4l2_err(&dev->v4l2_dev, -diff --git a/drivers/media/platform/bcm2835/bcm2835-camera.h b/drivers/media/platform/bcm2835/bcm2835-camera.h -index 883eab7..7fe9f65 100644 --- a/drivers/media/platform/bcm2835/bcm2835-camera.h +++ b/drivers/media/platform/bcm2835/bcm2835-camera.h @@ -15,7 +15,7 @@ @@ -1149,8 +1143,6 @@ index 883eab7..7fe9f65 100644 /* Debug helpers */ -diff --git a/drivers/media/platform/bcm2835/controls.c b/drivers/media/platform/bcm2835/controls.c -index d1408e5..3017b94 100644 --- a/drivers/media/platform/bcm2835/controls.c +++ b/drivers/media/platform/bcm2835/controls.c @@ -30,11 +30,23 @@ @@ -1209,7 +1201,7 @@ index d1408e5..3017b94 100644 }; struct v4l2_to_mmal_effects_setting { -@@ -126,6 +145,25 @@ static const struct v4l2_to_mmal_effects_setting +@@ -126,6 +145,25 @@ static const struct v4l2_to_mmal_effects 1, 1, 0, 0, 0, {0, 0, 0, 0, 0} } }; @@ -1235,7 +1227,7 @@ index d1408e5..3017b94 100644 /* control handlers*/ -@@ -133,10 +171,7 @@ static int ctrl_set_rational(struct bm2835_mmal_dev *dev, +@@ -133,10 +171,7 @@ static int ctrl_set_rational(struct bm28 struct v4l2_ctrl *ctrl, const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl) { @@ -1247,7 +1239,7 @@ index d1408e5..3017b94 100644 struct vchiq_mmal_port *control; control = &dev->component[MMAL_COMPONENT_CAMERA]->control; -@@ -166,6 +201,41 @@ static int ctrl_set_value(struct bm2835_mmal_dev *dev, +@@ -166,6 +201,41 @@ static int ctrl_set_value(struct bm2835_ &u32_value, sizeof(u32_value)); } @@ -1289,7 +1281,7 @@ index d1408e5..3017b94 100644 static int ctrl_set_rotate(struct bm2835_mmal_dev *dev, struct v4l2_ctrl *ctrl, const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl) -@@ -245,37 +315,97 @@ static int ctrl_set_exposure(struct bm2835_mmal_dev *dev, +@@ -245,37 +315,97 @@ static int ctrl_set_exposure(struct bm28 struct v4l2_ctrl *ctrl, const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl) { @@ -1399,7 +1391,7 @@ index d1408e5..3017b94 100644 struct v4l2_ctrl *ctrl, const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl) { -@@ -285,24 +415,18 @@ static int ctrl_set_metering_mode(struct bm2835_mmal_dev *dev, +@@ -285,24 +415,18 @@ static int ctrl_set_metering_mode(struct control = &dev->component[MMAL_COMPONENT_CAMERA]->control; switch (ctrl->val) { @@ -1432,7 +1424,7 @@ index d1408e5..3017b94 100644 } return vchiq_mmal_port_parameter_set(dev->instance, control, -@@ -367,6 +491,29 @@ static int ctrl_set_awb_mode(struct bm2835_mmal_dev *dev, +@@ -367,6 +491,29 @@ static int ctrl_set_awb_mode(struct bm28 &u32_value, sizeof(u32_value)); } @@ -1462,7 +1454,7 @@ index d1408e5..3017b94 100644 static int ctrl_set_image_effect(struct bm2835_mmal_dev *dev, struct v4l2_ctrl *ctrl, const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl) -@@ -443,8 +590,8 @@ static int ctrl_set_colfx(struct bm2835_mmal_dev *dev, +@@ -443,8 +590,8 @@ static int ctrl_set_colfx(struct bm2835_ &dev->colourfx, sizeof(dev->colourfx)); v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, @@ -1473,7 +1465,7 @@ index d1408e5..3017b94 100644 (ret == 0 ? 0 : -EINVAL)); return (ret == 0 ? 0 : EINVAL); } -@@ -494,7 +641,7 @@ static int ctrl_set_bitrate_mode(struct bm2835_mmal_dev *dev, +@@ -494,7 +641,7 @@ static int ctrl_set_bitrate_mode(struct return 0; } @@ -1482,7 +1474,7 @@ index d1408e5..3017b94 100644 struct v4l2_ctrl *ctrl, const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl) { -@@ -510,12 +657,247 @@ static int ctrl_set_q_factor(struct bm2835_mmal_dev *dev, +@@ -510,12 +657,247 @@ static int ctrl_set_q_factor(struct bm28 &u32_value, sizeof(u32_value)); } @@ -1730,7 +1722,7 @@ index d1408e5..3017b94 100644 if ((mmal_ctrl == NULL) || (mmal_ctrl->id != ctrl->id) || -@@ -524,7 +906,13 @@ static int bm2835_mmal_s_ctrl(struct v4l2_ctrl *ctrl) +@@ -524,7 +906,13 @@ static int bm2835_mmal_s_ctrl(struct v4l return -EINVAL; } @@ -1745,7 +1737,7 @@ index d1408e5..3017b94 100644 } static const struct v4l2_ctrl_ops bm2835_mmal_ctrl_ops = { -@@ -537,40 +925,54 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { +@@ -537,40 +925,54 @@ static const struct bm2835_mmal_v4l2_ctr { V4L2_CID_SATURATION, MMAL_CONTROL_TYPE_STD, -100, 100, 0, 1, NULL, @@ -1809,7 +1801,7 @@ index d1408e5..3017b94 100644 }, /* todo this needs mixing in with set exposure { -@@ -578,83 +980,258 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { +@@ -578,83 +980,258 @@ static const struct bm2835_mmal_v4l2_ctr }, */ { @@ -2083,7 +2075,7 @@ index d1408e5..3017b94 100644 int bm2835_mmal_init_controls(struct bm2835_mmal_dev *dev, struct v4l2_ctrl_handler *hdl) { -@@ -674,10 +1251,30 @@ int bm2835_mmal_init_controls(struct bm2835_mmal_dev *dev, +@@ -674,10 +1251,30 @@ int bm2835_mmal_init_controls(struct bm2 break; case MMAL_CONTROL_TYPE_STD_MENU: @@ -2115,8 +2107,6 @@ index d1408e5..3017b94 100644 case MMAL_CONTROL_TYPE_INT_MENU: dev->ctrls[c] = v4l2_ctrl_new_int_menu(hdl, -diff --git a/drivers/media/platform/bcm2835/mmal-common.h b/drivers/media/platform/bcm2835/mmal-common.h -index 602b4a7..076f9a8 100644 --- a/drivers/media/platform/bcm2835/mmal-common.h +++ b/drivers/media/platform/bcm2835/mmal-common.h @@ -26,6 +26,7 @@ @@ -2127,8 +2117,6 @@ index 602b4a7..076f9a8 100644 u32 mmal; int depth; u32 mmal_component; /* MMAL component index to be used to encode */ -diff --git a/drivers/media/platform/bcm2835/mmal-encodings.h b/drivers/media/platform/bcm2835/mmal-encodings.h -index 856e80e..024d620 100644 --- a/drivers/media/platform/bcm2835/mmal-encodings.h +++ b/drivers/media/platform/bcm2835/mmal-encodings.h @@ -12,6 +12,8 @@ @@ -2183,8 +2171,6 @@ index 856e80e..024d620 100644 +/* @} MmalColorSpace List */ + +#endif /* MMAL_ENCODINGS_H */ -diff --git a/drivers/media/platform/bcm2835/mmal-parameters.h b/drivers/media/platform/bcm2835/mmal-parameters.h -index c611b58..aa0fd18 100644 --- a/drivers/media/platform/bcm2835/mmal-parameters.h +++ b/drivers/media/platform/bcm2835/mmal-parameters.h @@ -57,7 +57,8 @@ enum mmal_parameter_common_type { @@ -2211,7 +2197,7 @@ index c611b58..aa0fd18 100644 }; enum mmal_parameter_camera_config_timestamp_mode { -@@ -176,6 +184,14 @@ enum mmal_parameter_camera_config_timestamp_mode { +@@ -176,6 +184,14 @@ enum mmal_parameter_camera_config_timest */ }; @@ -2350,11 +2336,9 @@ index c611b58..aa0fd18 100644 }; /** Valid mirror modes */ -diff --git a/drivers/media/platform/bcm2835/mmal-vchiq.c b/drivers/media/platform/bcm2835/mmal-vchiq.c -index a06fb44..76f249e 100644 --- a/drivers/media/platform/bcm2835/mmal-vchiq.c +++ b/drivers/media/platform/bcm2835/mmal-vchiq.c -@@ -742,7 +742,7 @@ static int send_synchronous_mmal_msg(struct vchiq_mmal_instance *instance, +@@ -742,7 +742,7 @@ static int send_synchronous_mmal_msg(str return ret; } @@ -2363,7 +2347,7 @@ index a06fb44..76f249e 100644 if (ret <= 0) { pr_err("error %d waiting for sync completion\n", ret); if (ret == 0) -@@ -1326,7 +1326,7 @@ static int port_parameter_get(struct vchiq_mmal_instance *instance, +@@ -1326,7 +1326,7 @@ static int port_parameter_get(struct vch memcpy(value, &rmsg->u.port_parameter_get_reply.value, rmsg->u.port_parameter_get_reply.size); @@ -2372,6 +2356,3 @@ index a06fb44..76f249e 100644 ret, port->component->handle, port->handle, parameter_id); release_msg: --- -1.9.1 - |