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

Commit 3d5e5360 authored by Ramesh V's avatar Ramesh V Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: isp: Handle standby mode for B+M



Handle the Sleep and awake call from backend to
remove ab/ib voting for Mono.

Change-Id: I14d3c81f5d1adf8466a612ba872fc062a65fe3c8
Signed-off-by: default avatarRamesh V <ramev@codeaurora.org>
parent 623814b0
Loading
Loading
Loading
Loading
+18 −9
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
#include "msm_isp_axi_util.h"

#define ISP_SOF_DEBUG_COUNT 0

static int msm_isp_update_dual_HW_ms_info_at_start(
	struct vfe_device *vfe_dev,
	enum msm_vfe_input_src stream_src,
@@ -2186,9 +2185,10 @@ static void msm_isp_update_camif_output_count(
/*Factor in Q2 format*/
#define ISP_DEFAULT_FORMAT_FACTOR 6
#define ISP_BUS_UTILIZATION_FACTOR 6
static int msm_isp_update_stream_bandwidth(struct vfe_device *vfe_dev)
int msm_isp_update_stream_bandwidth(struct vfe_device *vfe_dev,
	enum msm_vfe_hw_state hw_state)
{
	int i, rc = 0;
	int i, rc = 0, frame_src, ms_type;
	struct msm_vfe_axi_stream *stream_info;
	struct msm_vfe_axi_shared_data *axi_data = &vfe_dev->axi_data;
	uint64_t total_pix_bandwidth = 0, total_rdi_bandwidth = 0;
@@ -2197,6 +2197,15 @@ static int msm_isp_update_stream_bandwidth(struct vfe_device *vfe_dev)

	for (i = 0; i < VFE_AXI_SRC_MAX; i++) {
		stream_info = &axi_data->stream_info[i];
		frame_src = SRC_TO_INTF(stream_info->stream_src);
		ms_type = vfe_dev->axi_data.src_info[frame_src].
			dual_hw_ms_info.dual_hw_ms_type;
		if (hw_state == HW_STATE_SLEEP) {
			rc = msm_isp_update_bandwidth(
				ISP_VFE0 + vfe_dev->pdev->id, 0, 0);
			return rc;
		}

		if (stream_info->state == ACTIVE ||
			stream_info->state == START_PENDING) {
			if (stream_info->stream_src < RDI_INTF_0) {
@@ -2207,11 +2216,11 @@ static int msm_isp_update_stream_bandwidth(struct vfe_device *vfe_dev)
			}
		}
	}

	total_bandwidth = total_pix_bandwidth + total_rdi_bandwidth;
		rc = msm_isp_update_bandwidth(ISP_VFE0 + vfe_dev->pdev->id,
			(total_bandwidth + vfe_dev->hw_info->min_ab),
			(total_bandwidth + vfe_dev->hw_info->min_ib));

	if (rc < 0)
		pr_err("%s: update failed\n", __func__);

@@ -2822,7 +2831,7 @@ static int msm_isp_start_axi_stream(struct vfe_device *vfe_dev,
			}
		}
	}
	msm_isp_update_stream_bandwidth(vfe_dev);
	msm_isp_update_stream_bandwidth(vfe_dev, stream_cfg_cmd->hw_state);
	vfe_dev->hw_info->vfe_ops.axi_ops.reload_wm(vfe_dev,
		vfe_dev->vfe_base, wm_reload_mask);
	msm_isp_update_camif_output_count(vfe_dev, stream_cfg_cmd);
@@ -3001,7 +3010,7 @@ static int msm_isp_stop_axi_stream(struct vfe_device *vfe_dev,
	}

	msm_isp_update_camif_output_count(vfe_dev, stream_cfg_cmd);
	msm_isp_update_stream_bandwidth(vfe_dev);
	msm_isp_update_stream_bandwidth(vfe_dev, stream_cfg_cmd->hw_state);

	for (i = 0; i < stream_cfg_cmd->num_streams; i++) {
		stream_info = &axi_data->stream_info[
+2 −0
Original line number Diff line number Diff line
@@ -52,6 +52,8 @@ void msm_isp_reset_framedrop(struct vfe_device *vfe_dev,
int msm_isp_request_axi_stream(struct vfe_device *vfe_dev, void *arg);
void msm_isp_get_avtimer_ts(struct msm_isp_timestamp *time_stamp);
int msm_isp_cfg_axi_stream(struct vfe_device *vfe_dev, void *arg);
int msm_isp_update_stream_bandwidth(struct vfe_device *vfe_dev,
	enum msm_vfe_hw_state hw_state);
int msm_isp_release_axi_stream(struct vfe_device *vfe_dev, void *arg);
int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg);
void msm_isp_axi_cfg_update(struct vfe_device *vfe_dev,
+6 −0
Original line number Diff line number Diff line
@@ -829,6 +829,12 @@ static long msm_isp_ioctl_unlocked(struct v4l2_subdev *sd,
		rc = msm_isp_cfg_axi_stream(vfe_dev, arg);
		mutex_unlock(&vfe_dev->core_mutex);
		break;
	case VIDIOC_MSM_ISP_CFG_HW_STATE:
		mutex_lock(&vfe_dev->core_mutex);
		rc = msm_isp_update_stream_bandwidth(vfe_dev,
			*(enum msm_vfe_hw_state *)arg);
		mutex_unlock(&vfe_dev->core_mutex);
		break;
	case VIDIOC_MSM_ISP_AXI_HALT:
		mutex_lock(&vfe_dev->core_mutex);
		rc = msm_isp_axi_halt(vfe_dev, arg);
+12 −0
Original line number Diff line number Diff line
@@ -330,11 +330,18 @@ enum msm_vfe_axi_stream_cmd {
	STOP_IMMEDIATELY,
};

enum msm_vfe_hw_state {
	HW_STATE_NONE,
	HW_STATE_SLEEP,
	HW_STATE_AWAKE,
};

struct msm_vfe_axi_stream_cfg_cmd {
	uint8_t num_streams;
	uint32_t stream_handle[VFE_AXI_SRC_MAX];
	enum msm_vfe_axi_stream_cmd cmd;
	uint8_t sync_frame_id_src;
	enum msm_vfe_hw_state hw_state;
};

enum msm_vfe_axi_stream_update_type {
@@ -876,6 +883,7 @@ enum msm_isp_ioctl_cmd_code {
	MSM_ISP_UNMAP_BUF,
	MSM_ISP_FETCH_ENG_MULTI_PASS_START,
	MSM_ISP_MAP_BUF_START_MULTI_PASS_FE,
	MSM_ISP_CFG_HW_STATE,
};

#define VIDIOC_MSM_VFE_REG_CFG \
@@ -988,4 +996,8 @@ enum msm_isp_ioctl_cmd_code {
#define VIDIOC_MSM_ISP_MAP_BUF_START_MULTI_PASS_FE \
	_IOWR('V', MSM_ISP_MAP_BUF_START_MULTI_PASS_FE, \
		struct msm_vfe_fetch_eng_multi_pass_start)

#define VIDIOC_MSM_ISP_CFG_HW_STATE \
	_IOWR('V', MSM_ISP_CFG_HW_STATE, \
		struct msm_vfe_axi_stream_cfg_cmd)
#endif /* __MSMB_ISP__ */