Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee869c28 authored by Konstantin Motov's avatar Konstantin Motov
Browse files

msm: camera: reduce logging in case of ISP iommu page fault



VFE iommu page faults cause excessive logging. Because of
that performance of entire system is impacted. In order to reduce
impact disable all WMs in case of ISP iommu page fault.

Change-Id: I9c46ee9033bff07df739a530fb81bab10b0e16f3
Signed-off-by: default avatarKonstantin Motov <kmotov@codeaurora.org>
parent 0f7d8a53
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -2128,3 +2128,29 @@ void msm_isp_process_axi_irq(struct vfe_device *vfe_dev,
	}
	return;
}

void msm_isp_axi_disable_all_wm(struct vfe_device *vfe_dev)
{
	struct msm_vfe_axi_stream *stream_info;
	struct msm_vfe_axi_shared_data *axi_data = &vfe_dev->axi_data;
	int i, j;

	if (!vfe_dev || !axi_data) {
		pr_err("%s: error %p %p\n", __func__, vfe_dev, axi_data);
		return;
	}

	for (i = 0; i < MAX_NUM_STREAM; i++) {
		stream_info = &axi_data->stream_info[i];

		if (stream_info->state != ACTIVE)
			continue;

		for (j = 0; j < stream_info->num_planes; j++)
			vfe_dev->hw_info->vfe_ops.axi_ops.enable_wm(vfe_dev,
				stream_info->wm[j], 0);

		vfe_dev->hw_info->vfe_ops.core_ops.reg_update(vfe_dev,
			SRC_TO_INTF(stream_info->stream_src));
	}
}
+4 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 *
 * 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
@@ -68,4 +68,7 @@ void msm_isp_notify(struct vfe_device *vfe_dev, uint32_t event_type,
void msm_isp_process_axi_irq(struct vfe_device *vfe_dev,
	uint32_t irq_status0, uint32_t irq_status1,
	struct msm_isp_timestamp *ts);

void msm_isp_axi_disable_all_wm(struct vfe_device *vfe_dev);

#endif /* __MSM_ISP_AXI_UTIL_H__ */
+16 −0
Original line number Diff line number Diff line
@@ -764,3 +764,19 @@ int msm_isp_update_stats_stream(struct vfe_device *vfe_dev, void *arg)
	}
	return rc;
}

void msm_isp_stats_disable(struct vfe_device *vfe_dev)
{
	int i;
	unsigned int mask = 0;

	if (!vfe_dev) {
		pr_err("%s: error NULL ptr\n", __func__);
		return;
	}

	for (i = 0; i < vfe_dev->hw_info->stats_hw_info->num_stats_type; i++)
		mask |= 1 << i;

	vfe_dev->hw_info->vfe_ops.stats_ops.enable_module(vfe_dev, mask, 0);
}
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 *
 * 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
@@ -24,4 +24,5 @@ int msm_isp_update_stats_stream(struct vfe_device *vfe_dev, void *arg);
int msm_isp_release_stats_stream(struct vfe_device *vfe_dev, void *arg);
int msm_isp_request_stats_stream(struct vfe_device *vfe_dev, void *arg);
void msm_isp_update_stats_framedrop_reg(struct vfe_device *vfe_dev);
void msm_isp_stats_disable(struct vfe_device *vfe_dev);
#endif /* __MSM_ISP_STATS_UTIL_H__ */
+2 −0
Original line number Diff line number Diff line
@@ -1808,6 +1808,8 @@ static int msm_vfe_iommu_fault_handler(struct iommu_domain *domain,

	if (token) {
		vfe_dev = (struct vfe_device *)token;
		msm_isp_axi_disable_all_wm(vfe_dev);
		msm_isp_stats_disable(vfe_dev);
		if (!vfe_dev->buf_mgr || !vfe_dev->buf_mgr->ops) {
			pr_err("%s:%d] buf_mgr %p\n", __func__,
				__LINE__, vfe_dev->buf_mgr);