mm: camera: isp: send PD stats buffer earlier
Save pdaf buf address in sof event and send it with stats notify event. Change-Id: If147a229f3f007f30ef563469d11b678b887ed57 Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org> Signed-off-by: Junzhe Zou <jnzhezou@codeaurora.org>
This commit is contained in:
parent
2dc96b1cbb
commit
8081806088
4 changed files with 57 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 and
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -451,7 +451,7 @@ struct msm_vfe_axi_stream {
|
||||||
|
|
||||||
uint32_t runtime_num_burst_capture;
|
uint32_t runtime_num_burst_capture;
|
||||||
uint32_t runtime_output_format;
|
uint32_t runtime_output_format;
|
||||||
enum msm_stream_memory_input_t memory_input;
|
enum msm_stream_rdi_input_type rdi_input_type;
|
||||||
struct msm_isp_sw_framskip sw_skip;
|
struct msm_isp_sw_framskip sw_skip;
|
||||||
uint8_t sw_ping_pong_bit;
|
uint8_t sw_ping_pong_bit;
|
||||||
|
|
||||||
|
@ -820,6 +820,8 @@ struct vfe_device {
|
||||||
uint32_t bus_err_ign_mask;
|
uint32_t bus_err_ign_mask;
|
||||||
uint32_t recovery_irq0_mask;
|
uint32_t recovery_irq0_mask;
|
||||||
uint32_t recovery_irq1_mask;
|
uint32_t recovery_irq1_mask;
|
||||||
|
/* Store the buf_idx for pd stats RDI stream */
|
||||||
|
uint8_t pd_buf_idx;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vfe_parent_device {
|
struct vfe_parent_device {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 and
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -921,6 +921,37 @@ void msm_isp_increment_frame_id(struct vfe_device *vfe_dev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void msm_isp_update_pd_stats_idx(struct vfe_device *vfe_dev,
|
||||||
|
enum msm_vfe_input_src frame_src)
|
||||||
|
{
|
||||||
|
struct msm_vfe_axi_stream *pd_stream_info = NULL;
|
||||||
|
uint32_t pingpong_status = 0, pingpong_bit = 0;
|
||||||
|
struct msm_isp_buffer *done_buf = NULL;
|
||||||
|
int vfe_idx = -1;
|
||||||
|
|
||||||
|
if (frame_src < VFE_RAW_0 || frame_src > VFE_RAW_2)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pd_stream_info = msm_isp_get_stream_common_data(vfe_dev,
|
||||||
|
RDI_INTF_0 + frame_src - VFE_RAW_0);
|
||||||
|
|
||||||
|
if (pd_stream_info && (pd_stream_info->state == ACTIVE) &&
|
||||||
|
(pd_stream_info->rdi_input_type ==
|
||||||
|
MSM_CAMERA_RDI_PDAF)) {
|
||||||
|
vfe_idx = msm_isp_get_vfe_idx_for_stream(
|
||||||
|
vfe_dev, pd_stream_info);
|
||||||
|
pingpong_status = vfe_dev->hw_info->vfe_ops.axi_ops.
|
||||||
|
get_pingpong_status(vfe_dev);
|
||||||
|
pingpong_bit = ((pingpong_status >>
|
||||||
|
pd_stream_info->wm[vfe_idx][0]) & 0x1);
|
||||||
|
done_buf = pd_stream_info->buf[pingpong_bit];
|
||||||
|
if (done_buf)
|
||||||
|
vfe_dev->pd_buf_idx = done_buf->buf_idx;
|
||||||
|
else
|
||||||
|
vfe_dev->pd_buf_idx = 0xF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void msm_isp_notify(struct vfe_device *vfe_dev, uint32_t event_type,
|
void msm_isp_notify(struct vfe_device *vfe_dev, uint32_t event_type,
|
||||||
enum msm_vfe_input_src frame_src, struct msm_isp_timestamp *ts)
|
enum msm_vfe_input_src frame_src, struct msm_isp_timestamp *ts)
|
||||||
{
|
{
|
||||||
|
@ -955,9 +986,8 @@ void msm_isp_notify(struct vfe_device *vfe_dev, uint32_t event_type,
|
||||||
vfe_dev->isp_raw2_debug++;
|
vfe_dev->isp_raw2_debug++;
|
||||||
}
|
}
|
||||||
|
|
||||||
ISP_DBG("%s: vfe %d frame_src %d frame id: %u\n", __func__,
|
ISP_DBG("%s: vfe %d frame_src %d\n", __func__,
|
||||||
vfe_dev->pdev->id, frame_src,
|
vfe_dev->pdev->id, frame_src);
|
||||||
vfe_dev->axi_data.src_info[frame_src].frame_id);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Cannot support dual_cam and framedrop same time in union.
|
* Cannot support dual_cam and framedrop same time in union.
|
||||||
|
@ -1002,6 +1032,12 @@ void msm_isp_notify(struct vfe_device *vfe_dev, uint32_t event_type,
|
||||||
if (frame_src == VFE_PIX_0)
|
if (frame_src == VFE_PIX_0)
|
||||||
msm_isp_check_for_output_error(vfe_dev, ts,
|
msm_isp_check_for_output_error(vfe_dev, ts,
|
||||||
&event_data.u.sof_info);
|
&event_data.u.sof_info);
|
||||||
|
/*
|
||||||
|
* Get and store the buf idx for PD stats
|
||||||
|
* this is to send the PD stats buffer address
|
||||||
|
* in BF stats done.
|
||||||
|
*/
|
||||||
|
msm_isp_update_pd_stats_idx(vfe_dev, frame_src);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -1174,7 +1210,7 @@ int msm_isp_request_axi_stream(struct vfe_device *vfe_dev, void *arg)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream_info->memory_input = stream_cfg_cmd->memory_input;
|
stream_info->rdi_input_type = stream_cfg_cmd->rdi_input_type;
|
||||||
vfe_dev->reg_update_requested &=
|
vfe_dev->reg_update_requested &=
|
||||||
~(BIT(SRC_TO_INTF(stream_info->stream_src)));
|
~(BIT(SRC_TO_INTF(stream_info->stream_src)));
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 and
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -224,6 +224,11 @@ static int32_t msm_isp_stats_buf_divert(struct vfe_device *vfe_dev,
|
||||||
stats_event->stats_buf_idxs
|
stats_event->stats_buf_idxs
|
||||||
[stream_info->stats_type] =
|
[stream_info->stats_type] =
|
||||||
done_buf->buf_idx;
|
done_buf->buf_idx;
|
||||||
|
|
||||||
|
stats_event->pd_stats_idx = 0xF;
|
||||||
|
if (stream_info->stats_type == MSM_ISP_STATS_BF)
|
||||||
|
stats_event->pd_stats_idx = vfe_dev->pd_buf_idx;
|
||||||
|
|
||||||
if (comp_stats_type_mask == NULL) {
|
if (comp_stats_type_mask == NULL) {
|
||||||
stats_event->stats_mask =
|
stats_event->stats_mask =
|
||||||
1 << stream_info->stats_type;
|
1 << stream_info->stats_type;
|
||||||
|
|
|
@ -293,9 +293,10 @@ struct msm_vfe_axi_plane_cfg {
|
||||||
uint8_t rdi_cid;/*CID 1-16*/
|
uint8_t rdi_cid;/*CID 1-16*/
|
||||||
};
|
};
|
||||||
|
|
||||||
enum msm_stream_memory_input_t {
|
enum msm_stream_rdi_input_type {
|
||||||
MEMORY_INPUT_DISABLED,
|
MSM_CAMERA_RDI_MIN,
|
||||||
MEMORY_INPUT_ENABLED
|
MSM_CAMERA_RDI_PDAF,
|
||||||
|
MSM_CAMERA_RDI_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct msm_vfe_axi_stream_request_cmd {
|
struct msm_vfe_axi_stream_request_cmd {
|
||||||
|
@ -318,7 +319,7 @@ struct msm_vfe_axi_stream_request_cmd {
|
||||||
uint32_t controllable_output;
|
uint32_t controllable_output;
|
||||||
uint32_t burst_len;
|
uint32_t burst_len;
|
||||||
/* Flag indicating memory input stream */
|
/* Flag indicating memory input stream */
|
||||||
enum msm_stream_memory_input_t memory_input;
|
enum msm_stream_rdi_input_type rdi_input_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct msm_vfe_axi_stream_release_cmd {
|
struct msm_vfe_axi_stream_release_cmd {
|
||||||
|
@ -726,6 +727,7 @@ struct msm_isp_fetch_eng_event {
|
||||||
struct msm_isp_stats_event {
|
struct msm_isp_stats_event {
|
||||||
uint32_t stats_mask; /* 4 bytes */
|
uint32_t stats_mask; /* 4 bytes */
|
||||||
uint8_t stats_buf_idxs[MSM_ISP_STATS_MAX]; /* 11 bytes */
|
uint8_t stats_buf_idxs[MSM_ISP_STATS_MAX]; /* 11 bytes */
|
||||||
|
uint8_t pd_stats_idx;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct msm_isp_stream_ack {
|
struct msm_isp_stream_ack {
|
||||||
|
|
Loading…
Add table
Reference in a new issue