msm: camera: isp: Stop stats stream properly

When the camif input is disabled the stats streams need to be
turned off as well. Stop the stats stream by following the
correct stop sequence instead of just turning off the
stats write masters.

CRs-Fixed: 1098562
Change-Id: I4789bf9e837b1c0af7288e26ff02c4068638337a
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
This commit is contained in:
Shubhraprakash Das 2016-11-22 15:21:28 -08:00
parent 97587bf5cb
commit f230f0f67b
3 changed files with 42 additions and 18 deletions

View file

@ -13,6 +13,7 @@
#include <media/v4l2-subdev.h>
#include <asm/div64.h>
#include "msm_isp_util.h"
#include "msm_isp_stats_util.h"
#include "msm_isp_axi_util.h"
#include "msm_isp48.h"
@ -2759,12 +2760,11 @@ static void __msm_isp_stop_axi_streams(struct vfe_device *vfe_dev,
if (!update_vfes[k])
continue;
vfe_dev = update_vfes[k];
axi_data = &vfe_dev->axi_data;
if (axi_data->src_info[VFE_PIX_0].active == 0) {
vfe_dev->hw_info->vfe_ops.stats_ops.enable_module(
vfe_dev, 0xFF, 0);
}
/* make sure all stats are stopped if camif is stopped */
if (vfe_dev->axi_data.src_info[VFE_PIX_0].active == 0)
msm_isp_stop_all_stats_stream(vfe_dev);
}
for (i = 0; i < num_streams; i++) {
stream_info = streams[i];
spin_lock_irqsave(&stream_info->lock, flags);

View file

@ -548,19 +548,52 @@ int msm_isp_release_stats_stream(struct vfe_device *vfe_dev, void *arg)
return 0;
}
void msm_isp_stop_all_stats_stream(struct vfe_device *vfe_dev)
{
struct msm_vfe_stats_stream_cfg_cmd stream_cfg_cmd;
struct msm_vfe_stats_stream *stream_info;
int i;
int vfe_idx;
unsigned long flags;
stream_cfg_cmd.enable = 0;
stream_cfg_cmd.num_streams = 0;
for (i = 0; i < MSM_ISP_STATS_MAX; i++) {
stream_info = msm_isp_get_stats_stream_common_data(vfe_dev, i);
spin_lock_irqsave(&stream_info->lock, flags);
if (stream_info->state == STATS_AVAILABLE ||
stream_info->state == STATS_INACTIVE) {
spin_unlock_irqrestore(&stream_info->lock, flags);
continue;
}
vfe_idx = msm_isp_get_vfe_idx_for_stats_stream_user(vfe_dev,
stream_info);
if (vfe_idx == -ENOTTY) {
spin_unlock_irqrestore(&stream_info->lock, flags);
continue;
}
stream_cfg_cmd.stream_handle[
stream_cfg_cmd.num_streams] =
stream_info->stream_handle[vfe_idx];
stream_cfg_cmd.num_streams++;
spin_unlock_irqrestore(&stream_info->lock, flags);
}
if (stream_cfg_cmd.num_streams)
msm_isp_cfg_stats_stream(vfe_dev, &stream_cfg_cmd);
}
void msm_isp_release_all_stats_stream(struct vfe_device *vfe_dev)
{
struct msm_vfe_stats_stream_release_cmd
stream_release_cmd[MSM_ISP_STATS_MAX];
struct msm_vfe_stats_stream_cfg_cmd stream_cfg_cmd;
struct msm_vfe_stats_stream *stream_info;
int i;
int vfe_idx;
int num_stream = 0;
unsigned long flags;
stream_cfg_cmd.enable = 0;
stream_cfg_cmd.num_streams = 0;
msm_isp_stop_all_stats_stream(vfe_dev);
for (i = 0; i < MSM_ISP_STATS_MAX; i++) {
stream_info = msm_isp_get_stats_stream_common_data(vfe_dev, i);
@ -577,18 +610,8 @@ void msm_isp_release_all_stats_stream(struct vfe_device *vfe_dev)
}
stream_release_cmd[num_stream++].stream_handle =
stream_info->stream_handle[vfe_idx];
if (stream_info->state == STATS_INACTIVE) {
spin_unlock_irqrestore(&stream_info->lock, flags);
continue;
}
stream_cfg_cmd.stream_handle[
stream_cfg_cmd.num_streams] =
stream_info->stream_handle[vfe_idx];
stream_cfg_cmd.num_streams++;
spin_unlock_irqrestore(&stream_info->lock, flags);
}
if (stream_cfg_cmd.num_streams)
msm_isp_cfg_stats_stream(vfe_dev, &stream_cfg_cmd);
for (i = 0; i < num_stream; i++)
msm_isp_release_stats_stream(vfe_dev, &stream_release_cmd[i]);

View file

@ -29,6 +29,7 @@ int msm_isp_stats_restart(struct vfe_device *vfe_dev);
void msm_isp_release_all_stats_stream(struct vfe_device *vfe_dev);
void msm_isp_process_stats_reg_upd_epoch_irq(struct vfe_device *vfe_dev,
enum msm_isp_comp_irq_types irq);
void msm_isp_stop_all_stats_stream(struct vfe_device *vfe_dev);
static inline int msm_isp_get_vfe_idx_for_stats_stream_user(
struct vfe_device *vfe_dev,