media: rockchip: vicap: thunderboot support multi camera

if all cameras need deal by isp, only support readback mode

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: Id943e8150fec09e1e7d4eddc0fd92a23ce94c669
This commit is contained in:
Zefa Chen
2022-09-21 14:45:04 +08:00
committed by Tao Huang
parent 394f669714
commit 2b919461fe
3 changed files with 21 additions and 1 deletions

View File

@@ -7647,7 +7647,8 @@ static void rkcif_line_wake_up_rdbk(struct rkcif_stream *stream, int mipi_id)
if (stream->cur_stream_mode & RKCIF_STREAM_MODE_TOISP_RDBK) {
spin_lock_irqsave(&stream->vbq_lock, flags);
if (stream->cifdev->is_thunderboot &&
(stream->frame_idx - 1) == stream->last_rx_buf_idx) {
(stream->frame_idx - 1) == stream->last_rx_buf_idx &&
stream->cifdev->is_rdbk_to_online) {
stream->cur_stream_mode &= ~RKCIF_STREAM_MODE_TOISP_RDBK;
stream->cur_stream_mode |= RKCIF_STREAM_MODE_TOISP;
stream->cifdev->wait_line = 0;

View File

@@ -828,6 +828,7 @@ struct rkcif_device {
bool is_use_dummybuf;
bool is_notifier_isp;
bool is_thunderboot;
bool is_rdbk_to_online;
int rdbk_debug;
int sync_type;
int sditf_cnt;

View File

@@ -539,12 +539,30 @@ void sditf_change_to_online(struct sditf_priv *priv)
rkcif_free_rx_buf(&cif_dev->stream[2], priv->buf_num);
}
static void sditf_check_capture_mode(struct rkcif_device *cif_dev)
{
struct rkcif_device *dev = NULL;
int i = 0;
int toisp_cnt = 0;
for (i = 0; i < cif_dev->hw_dev->dev_num; i++) {
dev = cif_dev->hw_dev->cif_dev[i];
if (dev && dev->sditf_cnt)
toisp_cnt++;
}
if (cif_dev->is_thunderboot && toisp_cnt == 1)
cif_dev->is_rdbk_to_online = true;
else
cif_dev->is_rdbk_to_online = false;
}
static int sditf_start_stream(struct sditf_priv *priv)
{
struct rkcif_device *cif_dev = priv->cif_dev;
struct v4l2_subdev_format fmt;
unsigned int mode = RKCIF_STREAM_MODE_TOISP;
sditf_check_capture_mode(cif_dev);
sditf_get_set_fmt(&priv->sd, NULL, &fmt);
if (priv->mode.rdbk_mode == RKISP_VICAP_ONLINE) {
if (priv->toisp_inf.link_mode == TOISP0) {