mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
media: cif: add stream sequence conifg strategy
Change-Id: If6dca4ca1243f218f3e429a6628aae56a35d9058 Signed-off-by: Vicent Chi <vicent.chi@rock-chips.com>
This commit is contained in:
@@ -2345,6 +2345,7 @@ static int rkcif_start_streaming(struct vb2_queue *queue, unsigned int count)
|
||||
struct rkcif_sensor_info *sensor_info = dev->active_sensor;
|
||||
struct rkcif_sensor_info *terminal_sensor = &dev->terminal_sensor;
|
||||
struct rkmodule_hdr_cfg hdr_cfg;
|
||||
int rkmodule_stream_seq = RKMODULE_START_STREAM_DEFAULT;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&dev->stream_lock);
|
||||
@@ -2380,6 +2381,13 @@ static int rkcif_start_streaming(struct vb2_queue *queue, unsigned int count)
|
||||
if (ret)
|
||||
terminal_sensor->fi.interval = (struct v4l2_fract) {1, 30};
|
||||
|
||||
ret = v4l2_subdev_call(terminal_sensor->sd,
|
||||
core, ioctl,
|
||||
RKMODULE_GET_START_STREAM_SEQ,
|
||||
&rkmodule_stream_seq);
|
||||
if (ret)
|
||||
rkmodule_stream_seq = RKMODULE_START_STREAM_DEFAULT;
|
||||
|
||||
rkcif_sync_crop_info(stream);
|
||||
}
|
||||
|
||||
@@ -2414,7 +2422,8 @@ static int rkcif_start_streaming(struct vb2_queue *queue, unsigned int count)
|
||||
* can be rising or fallling after powering on cif.
|
||||
* To keep the coherence of edge, open sensor in advance.
|
||||
*/
|
||||
if (sensor_info->mbus.type == V4L2_MBUS_PARALLEL) {
|
||||
if (sensor_info->mbus.type == V4L2_MBUS_PARALLEL ||
|
||||
rkmodule_stream_seq == RKMODULE_START_STREAM_FRONT) {
|
||||
ret = dev->pipe.set_stream(&dev->pipe, true);
|
||||
if (ret < 0)
|
||||
goto runtime_put;
|
||||
@@ -2443,7 +2452,8 @@ static int rkcif_start_streaming(struct vb2_queue *queue, unsigned int count)
|
||||
goto pipe_stream_off;
|
||||
}
|
||||
|
||||
if (sensor_info->mbus.type != V4L2_MBUS_PARALLEL) {
|
||||
if (sensor_info->mbus.type != V4L2_MBUS_PARALLEL &&
|
||||
rkmodule_stream_seq != RKMODULE_START_STREAM_FRONT) {
|
||||
ret = dev->pipe.set_stream(&dev->pipe, true);
|
||||
if (ret < 0)
|
||||
goto stop_stream;
|
||||
|
||||
@@ -66,6 +66,9 @@
|
||||
#define RKMODULE_GET_VC_HOTPLUG_INFO \
|
||||
_IOR('V', BASE_VIDIOC_PRIVATE + 13, struct rkmodule_vc_hotplug_info)
|
||||
|
||||
#define RKMODULE_GET_START_STREAM_SEQ \
|
||||
_IOR('V', BASE_VIDIOC_PRIVATE + 14, __u32)
|
||||
|
||||
/**
|
||||
* struct rkmodule_base_inf - module base information
|
||||
*
|
||||
@@ -355,4 +358,16 @@ struct rkmodule_vc_hotplug_info {
|
||||
__u8 detect_status;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
/* sensor start stream sequence
|
||||
* RKMODULE_START_STREAM_DEFAULT: by default
|
||||
* RKMODULE_START_STREAM_BEHIND : sensor start stream should be behind the controller
|
||||
* RKMODULE_START_STREAM_FRONT : sensor start stream should be in front of the controller
|
||||
*/
|
||||
enum rkmodule_start_stream_seq {
|
||||
RKMODULE_START_STREAM_DEFAULT = 0,
|
||||
RKMODULE_START_STREAM_BEHIND,
|
||||
RKMODULE_START_STREAM_FRONT,
|
||||
};
|
||||
|
||||
#endif /* _UAPI_RKMODULE_CAMERA_H */
|
||||
|
||||
Reference in New Issue
Block a user