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

Commit 9c32372e authored by Jeyaprakash Soundrapandian's avatar Jeyaprakash Soundrapandian Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: isp: Disable the rdi sof in none RDI only session" into dev/msm-4.9-camx

parents 0d5bb702 4f1b8381
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -203,7 +203,8 @@ static int cam_ife_hw_mgr_init_hw_res(
}

static int cam_ife_hw_mgr_start_hw_res(
	struct cam_ife_hw_mgr_res   *isp_hw_res)
	struct cam_ife_hw_mgr_res   *isp_hw_res,
	struct cam_ife_hw_mgr_ctx   *ctx)
{
	int i;
	int rc = -1;
@@ -214,6 +215,8 @@ static int cam_ife_hw_mgr_start_hw_res(
			continue;
		hw_intf = isp_hw_res->hw_res[i]->hw_intf;
		if (hw_intf->hw_ops.start) {
			isp_hw_res->hw_res[i]->rdi_only_ctx =
				ctx->is_rdi_only_context;
			rc = hw_intf->hw_ops.start(hw_intf->hw_priv,
				isp_hw_res->hw_res[i],
				sizeof(struct cam_isp_resource_node));
@@ -1749,7 +1752,8 @@ static int cam_ife_mgr_restart_hw(void *start_hw_args)

	/* start the IFE out devices */
	for (i = 0; i < CAM_IFE_HW_OUT_RES_MAX; i++) {
		rc = cam_ife_hw_mgr_start_hw_res(&ctx->res_list_ife_out[i]);
		rc = cam_ife_hw_mgr_start_hw_res(
			&ctx->res_list_ife_out[i], ctx);
		if (rc) {
			CAM_ERR(CAM_ISP, "Can not start IFE OUT (%d)", i);
			goto err;
@@ -1759,7 +1763,7 @@ static int cam_ife_mgr_restart_hw(void *start_hw_args)
	CAM_DBG(CAM_ISP, "START IFE SRC ... in ctx id:%d", ctx->ctx_index);
	/* Start the IFE mux in devices */
	list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_src, list) {
		rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res);
		rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res, ctx);
		if (rc) {
			CAM_ERR(CAM_ISP, "Can not start IFE MUX (%d)",
				 hw_mgr_res->res_id);
@@ -1770,7 +1774,7 @@ static int cam_ife_mgr_restart_hw(void *start_hw_args)
	CAM_DBG(CAM_ISP, "START CSID HW ... in ctx id:%d", ctx->ctx_index);
	/* Start the IFE CSID HW devices */
	list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_csid, list) {
		rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res);
		rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res, ctx);
		if (rc) {
			CAM_ERR(CAM_ISP, "Can not start IFE CSID (%d)",
				 hw_mgr_res->res_id);
@@ -1909,7 +1913,8 @@ static int cam_ife_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args)
		ctx->ctx_index);
	/* start the IFE out devices */
	for (i = 0; i < CAM_IFE_HW_OUT_RES_MAX; i++) {
		rc = cam_ife_hw_mgr_start_hw_res(&ctx->res_list_ife_out[i]);
		rc = cam_ife_hw_mgr_start_hw_res(
			&ctx->res_list_ife_out[i], ctx);
		if (rc) {
			CAM_ERR(CAM_ISP, "Can not start IFE OUT (%d)",
				 i);
@@ -1921,7 +1926,7 @@ static int cam_ife_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args)
		ctx->ctx_index);
	/* Start the IFE mux in devices */
	list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_src, list) {
		rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res);
		rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res, ctx);
		if (rc) {
			CAM_ERR(CAM_ISP, "Can not start IFE MUX (%d)",
				 hw_mgr_res->res_id);
@@ -1933,7 +1938,7 @@ static int cam_ife_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args)
		ctx->ctx_index);
	/* Start the IFE CSID HW devices */
	list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_csid, list) {
		rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res);
		rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res, ctx);
		if (rc) {
			CAM_ERR(CAM_ISP, "Can not start IFE CSID (%d)",
				 hw_mgr_res->res_id);
@@ -1945,7 +1950,7 @@ static int cam_ife_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args)
		ctx->ctx_index);
	/* Start the IFE CID HW devices */
	list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_cid, list) {
		rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res);
		rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res, ctx);
		if (rc) {
			CAM_ERR(CAM_ISP, "Can not start IFE CSID (%d)",
				hw_mgr_res->res_id);
+2 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ enum cam_isp_hw_cmd_type {
 * @tasklet_info:                 Tasklet structure that will be used to
 *                                schedule IRQ events related to this resource
 * @irq_handle:                   handle returned on subscribing for IRQ event
 * @rdi_only_ctx:                 resouce belong to rdi only context or not
 * @init:                         function pointer to init the HW resource
 * @deinit:                       function pointer to deinit the HW resource
 * @start:                        function pointer to start the HW resource
@@ -131,6 +132,7 @@ struct cam_isp_resource_node {
	void                          *cdm_ops;
	void                          *tasklet_info;
	int                            irq_handle;
	int                            rdi_only_ctx;

	int (*init)(struct cam_isp_resource_node *rsrc_node,
		void *init_args, uint32_t arg_size);
+63 −28
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ static uint32_t camif_irq_reg_mask[CAM_IFE_IRQ_REGISTERS_MAX] = {

static uint32_t camif_irq_err_reg_mask[CAM_IFE_IRQ_REGISTERS_MAX] = {
	0x00000000,
	0x0FFF7E80,
	0x0FFF7EBC,
};

static uint32_t rdi_irq_reg_mask[CAM_IFE_IRQ_REGISTERS_MAX] = {
@@ -531,7 +531,7 @@ int cam_vfe_start(void *hw_priv, void *start_args, uint32_t arg_size)
	struct cam_vfe_hw_core_info       *core_info = NULL;
	struct cam_hw_info                *vfe_hw  = hw_priv;
	struct cam_isp_resource_node      *isp_res;
	int rc = -ENODEV;
	int rc = 0;

	if (!hw_priv || !start_args ||
		(arg_size != sizeof(struct cam_isp_resource_node))) {
@@ -545,39 +545,70 @@ int cam_vfe_start(void *hw_priv, void *start_args, uint32_t arg_size)

	mutex_lock(&vfe_hw->hw_mutex);
	if (isp_res->res_type == CAM_ISP_RESOURCE_VFE_IN) {
		if (isp_res->res_id == CAM_ISP_HW_VFE_IN_CAMIF)
			isp_res->irq_handle = cam_irq_controller_subscribe_irq(
		if (isp_res->res_id == CAM_ISP_HW_VFE_IN_CAMIF) {
			isp_res->irq_handle =
				cam_irq_controller_subscribe_irq(
					core_info->vfe_irq_controller,
					CAM_IRQ_PRIORITY_1,
				camif_irq_reg_mask, &core_info->irq_payload,
				cam_vfe_irq_top_half, cam_ife_mgr_do_tasklet,
				isp_res->tasklet_info, cam_tasklet_enqueue_cmd);
		else
			isp_res->irq_handle = cam_irq_controller_subscribe_irq(
					camif_irq_reg_mask,
					&core_info->irq_payload,
					cam_vfe_irq_top_half,
					cam_ife_mgr_do_tasklet,
					isp_res->tasklet_info,
					cam_tasklet_enqueue_cmd);
			if (isp_res->irq_handle < 1)
				rc = -ENOMEM;
		} else if (isp_res->rdi_only_ctx) {
			isp_res->irq_handle =
				cam_irq_controller_subscribe_irq(
					core_info->vfe_irq_controller,
					CAM_IRQ_PRIORITY_1,
				rdi_irq_reg_mask, &core_info->irq_payload,
				cam_vfe_irq_top_half, cam_ife_mgr_do_tasklet,
				isp_res->tasklet_info, cam_tasklet_enqueue_cmd);

		core_info->irq_err_handle = cam_irq_controller_subscribe_irq(
			core_info->vfe_irq_controller, CAM_IRQ_PRIORITY_0,
			camif_irq_err_reg_mask, &core_info->irq_payload,
			cam_vfe_irq_err_top_half, cam_ife_mgr_do_tasklet,
			core_info->tasklet_info, cam_tasklet_enqueue_cmd);
					rdi_irq_reg_mask,
					&core_info->irq_payload,
					cam_vfe_irq_top_half,
					cam_ife_mgr_do_tasklet,
					isp_res->tasklet_info,
					cam_tasklet_enqueue_cmd);
			if (isp_res->irq_handle < 1)
				rc = -ENOMEM;
		}

		if (isp_res->irq_handle > 0)
		if (rc == 0) {
			rc = core_info->vfe_top->hw_ops.start(
				core_info->vfe_top->top_priv, isp_res,
				sizeof(struct cam_isp_resource_node));
		else
			if (rc)
				CAM_ERR(CAM_ISP, "Start failed. type:%d",
					isp_res->res_type);
		} else {
			CAM_ERR(CAM_ISP,
				"Error! subscribe irq controller failed");
		}
	} else if (isp_res->res_type == CAM_ISP_RESOURCE_VFE_OUT) {
		rc = core_info->vfe_bus->hw_ops.start(isp_res, NULL, 0);
	} else {
		CAM_ERR(CAM_ISP, "Invalid res type:%d", isp_res->res_type);
		rc = -EFAULT;
	}

	if (!core_info->irq_err_handle) {
		core_info->irq_err_handle =
			cam_irq_controller_subscribe_irq(
				core_info->vfe_irq_controller,
				CAM_IRQ_PRIORITY_0,
				camif_irq_err_reg_mask,
				&core_info->irq_payload,
				cam_vfe_irq_err_top_half,
				cam_ife_mgr_do_tasklet,
				core_info->tasklet_info,
				cam_tasklet_enqueue_cmd);
		if (core_info->irq_err_handle < 1) {
			CAM_ERR(CAM_ISP, "Error handle subscribe failure");
			rc = -ENOMEM;
			core_info->irq_err_handle = 0;
		}
	}

	mutex_unlock(&vfe_hw->hw_mutex);

	return rc;
@@ -607,15 +638,19 @@ int cam_vfe_stop(void *hw_priv, void *stop_args, uint32_t arg_size)
			core_info->vfe_top->top_priv, isp_res,
			sizeof(struct cam_isp_resource_node));

	cam_irq_controller_unsubscribe_irq(
		core_info->vfe_irq_controller, core_info->irq_err_handle);

	} else if (isp_res->res_type == CAM_ISP_RESOURCE_VFE_OUT) {
		rc = core_info->vfe_bus->hw_ops.stop(isp_res, NULL, 0);
	} else {
		CAM_ERR(CAM_ISP, "Invalid res type:%d", isp_res->res_type);
	}

	if (core_info->irq_err_handle) {
		cam_irq_controller_unsubscribe_irq(
			core_info->vfe_irq_controller,
			core_info->irq_err_handle);
		core_info->irq_err_handle = 0;
	}

	mutex_unlock(&vfe_hw->hw_mutex);

	return rc;