mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
msm: camera: handle simultaneous SOF and stat interrupts.
Sometimes a stat interrupt arrives just before the next SOF, such that the VFE bundles the two interrupts together into one. In such a scenario, the frame id sent along with the stat interrupt message will incorrectly carry the farme number for the next frame. This change checks for such occurences and adjusts the frame id accordingly. Change-Id: I9914c428baf74cab81aade62843b9043f20108f9 Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
This commit is contained in:
parent
c0ba06982b
commit
ccf43179ce
2 changed files with 32 additions and 1 deletions
|
@ -3762,6 +3762,8 @@ static void vfe_send_stats_msg(
|
|||
/* spin_lock_irqsave(&ctrl->state_lock, flags); */
|
||||
struct isp_msg_stats msgStats;
|
||||
msgStats.frameCounter = vfe32_ctrl->share_ctrl->vfeFrameId;
|
||||
if (vfe32_ctrl->simultaneous_sof_stat)
|
||||
msgStats.frameCounter--;
|
||||
msgStats.buffer = bufAddress;
|
||||
switch (statsNum) {
|
||||
case statsAeNum:{
|
||||
|
@ -3844,6 +3846,9 @@ static void vfe_send_comp_stats_msg(
|
|||
uint32_t temp;
|
||||
|
||||
msgStats.frame_id = vfe32_ctrl->share_ctrl->vfeFrameId;
|
||||
if (vfe32_ctrl->simultaneous_sof_stat)
|
||||
msgStats.frame_id--;
|
||||
|
||||
msgStats.status_bits = status_bits;
|
||||
|
||||
msgStats.aec.buff = vfe32_ctrl->aecStatsControl.bufToRender;
|
||||
|
@ -4204,7 +4209,9 @@ static void axi32_do_tasklet(unsigned long data)
|
|||
{
|
||||
unsigned long flags;
|
||||
struct axi_ctrl_t *axi_ctrl = (struct axi_ctrl_t *)data;
|
||||
struct vfe32_ctrl_type *vfe32_ctrl = axi_ctrl->share_ctrl->vfe32_ctrl;
|
||||
struct vfe32_isr_queue_cmd *qcmd = NULL;
|
||||
int stat_interrupt;
|
||||
|
||||
CDBG("=== axi32_do_tasklet start ===\n");
|
||||
|
||||
|
@ -4224,11 +4231,32 @@ static void axi32_do_tasklet(unsigned long data)
|
|||
spin_unlock_irqrestore(&axi_ctrl->tasklet_lock,
|
||||
flags);
|
||||
|
||||
if (axi_ctrl->share_ctrl->stats_comp) {
|
||||
stat_interrupt = (qcmd->vfeInterruptStatus0 &
|
||||
VFE_IRQ_STATUS0_STATS_COMPOSIT_MASK);
|
||||
} else {
|
||||
stat_interrupt =
|
||||
(qcmd->vfeInterruptStatus0 &
|
||||
VFE_IRQ_STATUS0_STATS_AEC) |
|
||||
(qcmd->vfeInterruptStatus0 &
|
||||
VFE_IRQ_STATUS0_STATS_AWB) |
|
||||
(qcmd->vfeInterruptStatus0 &
|
||||
VFE_IRQ_STATUS0_STATS_AF) |
|
||||
(qcmd->vfeInterruptStatus0 &
|
||||
VFE_IRQ_STATUS0_STATS_IHIST) |
|
||||
(qcmd->vfeInterruptStatus0 &
|
||||
VFE_IRQ_STATUS0_STATS_RS) |
|
||||
(qcmd->vfeInterruptStatus0 &
|
||||
VFE_IRQ_STATUS0_STATS_CS);
|
||||
}
|
||||
if (qcmd->vfeInterruptStatus0 &
|
||||
VFE_IRQ_STATUS0_CAMIF_SOF_MASK)
|
||||
VFE_IRQ_STATUS0_CAMIF_SOF_MASK) {
|
||||
if (stat_interrupt)
|
||||
vfe32_ctrl->simultaneous_sof_stat = 1;
|
||||
v4l2_subdev_notify(&axi_ctrl->subdev,
|
||||
NOTIFY_VFE_IRQ,
|
||||
(void *)VFE_IRQ_STATUS0_CAMIF_SOF_MASK);
|
||||
}
|
||||
|
||||
/* interrupt to be processed, *qcmd has the payload. */
|
||||
if (qcmd->vfeInterruptStatus0 &
|
||||
|
@ -4335,6 +4363,7 @@ static void axi32_do_tasklet(unsigned long data)
|
|||
(void *)VFE_IRQ_STATUS0_SYNC_TIMER2);
|
||||
}
|
||||
}
|
||||
vfe32_ctrl->simultaneous_sof_stat = 0;
|
||||
kfree(qcmd);
|
||||
}
|
||||
CDBG("=== axi32_do_tasklet end ===\n");
|
||||
|
|
|
@ -1006,6 +1006,8 @@ struct vfe32_ctrl_type {
|
|||
uint32_t snapshot_frame_cnt;
|
||||
struct msm_stats_bufq_ctrl stats_ctrl;
|
||||
struct msm_stats_ops stats_ops;
|
||||
|
||||
uint32_t simultaneous_sof_stat;
|
||||
};
|
||||
|
||||
#define statsAeNum 0
|
||||
|
|
Loading…
Reference in a new issue