summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShubhraprakash Das <sadas@codeaurora.org>2016-11-22 15:21:28 -0800
committerShubhraprakash Das <sadas@codeaurora.org>2016-12-07 13:47:50 -0800
commitf230f0f67bdd137a02230b0ba32cd5ff9075c231 (patch)
treebc60640ceab4371b48747e4e2e85c77baba6c1e8
parent97587bf5cb1b60e49b24af480ddad47571784da5 (diff)
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>
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c10
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.c45
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.h1
3 files changed, 40 insertions, 16 deletions
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
index aa3a0e239d87..ae032c588888 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
@@ -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);
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.c
index da4ceb400683..38ce78d941c9 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.c
@@ -548,15 +548,12 @@ int msm_isp_release_stats_stream(struct vfe_device *vfe_dev, void *arg)
return 0;
}
-void msm_isp_release_all_stats_stream(struct vfe_device *vfe_dev)
+void msm_isp_stop_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;
@@ -565,7 +562,8 @@ void msm_isp_release_all_stats_stream(struct vfe_device *vfe_dev)
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) {
+ if (stream_info->state == STATS_AVAILABLE ||
+ stream_info->state == STATS_INACTIVE) {
spin_unlock_irqrestore(&stream_info->lock, flags);
continue;
}
@@ -575,12 +573,6 @@ void msm_isp_release_all_stats_stream(struct vfe_device *vfe_dev)
spin_unlock_irqrestore(&stream_info->lock, flags);
continue;
}
- 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];
@@ -589,6 +581,37 @@ void msm_isp_release_all_stats_stream(struct vfe_device *vfe_dev)
}
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 *stream_info;
+ int i;
+ int vfe_idx;
+ int num_stream = 0;
+ unsigned long flags;
+
+ 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);
+ spin_lock_irqsave(&stream_info->lock, flags);
+ if (stream_info->state == STATS_AVAILABLE) {
+ 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_release_cmd[num_stream++].stream_handle =
+ stream_info->stream_handle[vfe_idx];
+ spin_unlock_irqrestore(&stream_info->lock, flags);
+ }
for (i = 0; i < num_stream; i++)
msm_isp_release_stats_stream(vfe_dev, &stream_release_cmd[i]);
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.h b/drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.h
index e9728f33fae1..2e3a24dd1f0d 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.h
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_stats_util.h
@@ -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,