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

Commit 7810cba1 authored by Camera Software Integration's avatar Camera Software Integration Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: ife: Acquire IFE which are HVX supported for HVX usecase"...

Merge "msm: camera: ife: Acquire IFE which are HVX supported for HVX usecase" into camera-kernel.lnx.1.0
parents 4c8c46f2 5969a17a
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -1553,6 +1553,7 @@ static int cam_ife_hw_mgr_acquire_csid_hw(
	int i;
	int rc = -1;
	struct cam_hw_intf  *hw_intf;
	struct cam_isp_hw_cmd_query vfe_query;

	if (!ife_hw_mgr || !csid_acquire) {
		CAM_ERR(CAM_ISP,
@@ -1567,11 +1568,13 @@ static int cam_ife_hw_mgr_acquire_csid_hw(
				continue;

			if (csid_acquire->in_port->dsp_mode) {
				vfe_query.query_cmd =
					CAM_ISP_HW_CMD_QUERY_DSP_MODE;
				rc = ife_hw_mgr->ife_devices[i]->hw_ops
					.process_cmd(
					ife_hw_mgr->ife_devices[i]->hw_priv,
					CAM_ISP_HW_CMD_QUERY_DSP_MODE,
					NULL, 0);
					CAM_ISP_HW_CMD_QUERY,
					&vfe_query, sizeof(vfe_query));
				if (rc)
					continue;
			}
@@ -1592,10 +1595,12 @@ static int cam_ife_hw_mgr_acquire_csid_hw(
			continue;

		if (csid_acquire->in_port->dsp_mode) {
			vfe_query.query_cmd =
				CAM_ISP_HW_CMD_QUERY_DSP_MODE;
			rc = ife_hw_mgr->ife_devices[i]->hw_ops.process_cmd(
				ife_hw_mgr->ife_devices[i]->hw_priv,
				CAM_ISP_HW_CMD_QUERY_DSP_MODE,
				NULL, 0);
				CAM_ISP_HW_CMD_QUERY,
				&vfe_query, sizeof(vfe_query));
			if (rc)
				continue;
		}
+12 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ enum cam_isp_hw_cmd_type {
	CAM_ISP_HW_CMD_WM_CONFIG_UPDATE,
	CAM_ISP_HW_CMD_CSID_QCFA_SUPPORTED,
	CAM_ISP_HW_CMD_QUERY_REGSPACE_DATA,
	CAM_ISP_HW_CMD_QUERY,
	CAM_ISP_HW_CMD_QUERY_DSP_MODE,
	CAM_ISP_HW_CMD_DUMP_HW,
	CAM_ISP_HW_CMD_FE_TRIGGER_CMD,
@@ -111,6 +112,17 @@ enum cam_isp_hw_cmd_type {
	CAM_ISP_HW_CMD_MAX,
};

/*
 * struct cam_isp_hw_cmd_query
 *
 * @Brief:              Structure representing query command to HW
 *
 * @query_cmd:          Command identifier
 */
struct cam_isp_hw_cmd_query {
	int query_cmd;
};

/*
 * struct cam_isp_resource_node:
 *
+1 −1
Original line number Diff line number Diff line
@@ -594,7 +594,7 @@ int cam_vfe_process_cmd(void *hw_priv, uint32_t cmd_type,
	case CAM_ISP_HW_CMD_CORE_CONFIG:
	case CAM_ISP_HW_CMD_BW_UPDATE_V2:
	case CAM_ISP_HW_CMD_DUMP_HW:
	case CAM_ISP_HW_CMD_QUERY_DSP_MODE:
	case CAM_ISP_HW_CMD_QUERY:
		rc = core_info->vfe_top->hw_ops.process_cmd(
			core_info->vfe_top->top_priv, cmd_type, cmd_args,
			arg_size);
+15 −5
Original line number Diff line number Diff line
@@ -599,28 +599,38 @@ int cam_vfe_top_write(void *device_priv,
	return -EPERM;
}

int cam_vfe_top_query_dsp_mode(struct cam_vfe_top_ver2_priv *top_priv,
int cam_vfe_top_query(struct cam_vfe_top_ver2_priv *top_priv,
		void *cmd_args, uint32_t arg_size)
{
	int rc = 0;
	struct cam_isp_hw_cmd_query     *vfe_query;
	struct cam_hw_soc_info          *soc_info = NULL;
	struct cam_vfe_soc_private      *soc_private = NULL;

	if (!top_priv) {
	if (!top_priv || !cmd_args) {
		CAM_ERR(CAM_ISP, "Error! Invalid arguments");
		return -EINVAL;
	}

	soc_info = top_priv->common_data.soc_info;
	soc_private = soc_info->soc_private;
	vfe_query = (struct cam_isp_hw_cmd_query *)cmd_args;

	if (!soc_private) {
		CAM_ERR(CAM_ISP, "Error soc_private NULL");
		return -EINVAL;
	}

	switch (vfe_query->query_cmd) {
	case CAM_ISP_HW_CMD_QUERY_DSP_MODE:
		if (soc_private->dsp_disabled)
			rc = -EINVAL;
		break;
	default:
		rc = -EINVAL;
		CAM_ERR(CAM_ISP, "Error, Invalid cmd:%d", vfe_query->query_cmd);
		break;
	}
	return rc;
}

@@ -676,8 +686,8 @@ int cam_vfe_top_process_cmd(void *device_priv, uint32_t cmd_type,
		rc = cam_vfe_hw_dump(top_priv,
			cmd_args, arg_size);
		break;
	case CAM_ISP_HW_CMD_QUERY_DSP_MODE:
		rc = cam_vfe_top_query_dsp_mode(top_priv, cmd_args, arg_size);
	case CAM_ISP_HW_CMD_QUERY:
		rc = cam_vfe_top_query(top_priv, cmd_args, arg_size);
		break;
	default:
		rc = -EINVAL;
+15 −6
Original line number Diff line number Diff line
@@ -508,28 +508,38 @@ int cam_vfe_top_ver3_write(void *device_priv,
	return -EPERM;
}

int cam_vfe_top_ver3_query_dsp_mode(struct cam_vfe_top_ver3_priv *top_priv,
int cam_vfe_top_ver3_query(struct cam_vfe_top_ver3_priv *top_priv,
	void *cmd_args, uint32_t arg_size)
{
	int rc = 0;
	struct cam_isp_hw_cmd_query     *vfe_query;
	struct cam_hw_soc_info          *soc_info = NULL;
	struct cam_vfe_soc_private      *soc_private = NULL;

	if (!top_priv) {
	if (!top_priv || !cmd_args) {
		CAM_ERR(CAM_ISP, "Error, Invalid arguments");
		return -EINVAL;
	}

	soc_info = top_priv->common_data.soc_info;
	soc_private = soc_info->soc_private;
	vfe_query = (struct cam_isp_hw_cmd_query *)cmd_args;

	if (!soc_private) {
		CAM_ERR(CAM_ISP, "Error soc_private NULL");
		return -EINVAL;
	}

	switch (vfe_query->query_cmd) {
	case CAM_ISP_HW_CMD_QUERY_DSP_MODE:
		if (soc_private->dsp_disabled)
			rc = -EINVAL;
		break;
	default:
		rc = -EINVAL;
		CAM_ERR(CAM_ISP, "Error, Invalid cmd:%d", vfe_query->query_cmd);
		break;
	}
	return rc;
}

@@ -586,9 +596,8 @@ int cam_vfe_top_ver3_process_cmd(void *device_priv, uint32_t cmd_type,
	case CAM_ISP_HW_CMD_CORE_CONFIG:
		rc = cam_vfe_core_config_control(top_priv, cmd_args, arg_size);
		break;
	case CAM_ISP_HW_CMD_QUERY_DSP_MODE:
		rc = cam_vfe_top_ver3_query_dsp_mode(top_priv, cmd_args,
			arg_size);
	case CAM_ISP_HW_CMD_QUERY:
		rc = cam_vfe_top_ver3_query(top_priv, cmd_args, arg_size);
		break;
	default:
		rc = -EINVAL;