.. | .. |
---|
37 | 37 | /* VFE halt timeout */ |
---|
38 | 38 | #define VFE_HALT_TIMEOUT_MS 100 |
---|
39 | 39 | /* Max number of frame drop updates per frame */ |
---|
40 | | -#define VFE_FRAME_DROP_UPDATES 5 |
---|
41 | | -/* Frame drop value. NOTE: VAL + UPDATES should not exceed 31 */ |
---|
42 | | -#define VFE_FRAME_DROP_VAL 20 |
---|
| 40 | +#define VFE_FRAME_DROP_UPDATES 2 |
---|
| 41 | +/* Frame drop value. VAL + UPDATES - 1 should not exceed 31 */ |
---|
| 42 | +#define VFE_FRAME_DROP_VAL 30 |
---|
43 | 43 | |
---|
44 | 44 | #define VFE_NEXT_SOF_MS 500 |
---|
45 | 45 | |
---|
.. | .. |
---|
659 | 659 | struct vfe_device *vfe = to_vfe(line); |
---|
660 | 660 | struct vfe_output *output = &line->output; |
---|
661 | 661 | const struct vfe_hw_ops *ops = vfe->ops; |
---|
| 662 | + struct media_entity *sensor; |
---|
662 | 663 | unsigned long flags; |
---|
| 664 | + unsigned int frame_skip = 0; |
---|
663 | 665 | unsigned int i; |
---|
664 | 666 | u16 ub_size; |
---|
665 | 667 | |
---|
666 | 668 | ub_size = ops->get_ub_size(vfe->id); |
---|
667 | 669 | if (!ub_size) |
---|
668 | 670 | return -EINVAL; |
---|
| 671 | + |
---|
| 672 | + sensor = camss_find_sensor(&line->subdev.entity); |
---|
| 673 | + if (sensor) { |
---|
| 674 | + struct v4l2_subdev *subdev = |
---|
| 675 | + media_entity_to_v4l2_subdev(sensor); |
---|
| 676 | + |
---|
| 677 | + v4l2_subdev_call(subdev, sensor, g_skip_frames, &frame_skip); |
---|
| 678 | + /* Max frame skip is 29 frames */ |
---|
| 679 | + if (frame_skip > VFE_FRAME_DROP_VAL - 1) |
---|
| 680 | + frame_skip = VFE_FRAME_DROP_VAL - 1; |
---|
| 681 | + } |
---|
669 | 682 | |
---|
670 | 683 | spin_lock_irqsave(&vfe->output_lock, flags); |
---|
671 | 684 | |
---|
.. | .. |
---|
695 | 708 | |
---|
696 | 709 | switch (output->state) { |
---|
697 | 710 | case VFE_OUTPUT_SINGLE: |
---|
698 | | - vfe_output_frame_drop(vfe, output, 1); |
---|
| 711 | + vfe_output_frame_drop(vfe, output, 1 << frame_skip); |
---|
699 | 712 | break; |
---|
700 | 713 | case VFE_OUTPUT_CONTINUOUS: |
---|
701 | | - vfe_output_frame_drop(vfe, output, 3); |
---|
| 714 | + vfe_output_frame_drop(vfe, output, 3 << frame_skip); |
---|
702 | 715 | break; |
---|
703 | 716 | default: |
---|
704 | 717 | vfe_output_frame_drop(vfe, output, 0); |
---|
.. | .. |
---|
1252 | 1265 | |
---|
1253 | 1266 | ret = vfe_set_clock_rates(vfe); |
---|
1254 | 1267 | if (ret < 0) |
---|
1255 | | - goto error_clocks; |
---|
| 1268 | + goto error_pm_runtime_get; |
---|
1256 | 1269 | |
---|
1257 | 1270 | ret = camss_enable_clocks(vfe->nclocks, vfe->clock, |
---|
1258 | 1271 | vfe->camss->dev); |
---|
1259 | 1272 | if (ret < 0) |
---|
1260 | | - goto error_clocks; |
---|
| 1273 | + goto error_pm_runtime_get; |
---|
1261 | 1274 | |
---|
1262 | 1275 | ret = vfe_reset(vfe); |
---|
1263 | 1276 | if (ret < 0) |
---|
.. | .. |
---|
1269 | 1282 | } else { |
---|
1270 | 1283 | ret = vfe_check_clock_rates(vfe); |
---|
1271 | 1284 | if (ret < 0) |
---|
1272 | | - goto error_clocks; |
---|
| 1285 | + goto error_pm_runtime_get; |
---|
1273 | 1286 | } |
---|
1274 | 1287 | vfe->power_count++; |
---|
1275 | 1288 | |
---|
.. | .. |
---|
1280 | 1293 | error_reset: |
---|
1281 | 1294 | camss_disable_clocks(vfe->nclocks, vfe->clock); |
---|
1282 | 1295 | |
---|
1283 | | -error_clocks: |
---|
1284 | | - pm_runtime_put_sync(vfe->camss->dev); |
---|
1285 | | - |
---|
1286 | 1296 | error_pm_runtime_get: |
---|
| 1297 | + pm_runtime_put_sync(vfe->camss->dev); |
---|
1287 | 1298 | camss_pm_domain_off(vfe->camss, vfe->id); |
---|
1288 | 1299 | |
---|
1289 | 1300 | error_pm_domain: |
---|
.. | .. |
---|
2193 | 2204 | .queue_buffer = vfe_queue_buffer, |
---|
2194 | 2205 | .flush_buffers = vfe_flush_buffers, |
---|
2195 | 2206 | }; |
---|
2196 | | - |
---|
2197 | | -void msm_vfe_stop_streaming(struct vfe_device *vfe) |
---|
2198 | | -{ |
---|
2199 | | - int i; |
---|
2200 | | - |
---|
2201 | | - for (i = 0; i < ARRAY_SIZE(vfe->line); i++) |
---|
2202 | | - msm_video_stop_streaming(&vfe->line[i].video_out); |
---|
2203 | | -} |
---|
2204 | 2207 | |
---|
2205 | 2208 | /* |
---|
2206 | 2209 | * msm_vfe_register_entities - Register subdev node for VFE module |
---|