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

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

Merge "msm: camera: ope: Delay releasing of resources for last context" into camera-kernel.lnx.3.1

parents 6c58ed29 0c96fc99
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -2442,10 +2442,6 @@ static int cam_ope_mgr_release_ctx(struct cam_ope_hw_mgr *hw_mgr, int ctx_id)
	hw_mgr->ctx[ctx_id].req_cnt = 0;
	cam_ope_put_free_ctx(hw_mgr, ctx_id);

	rc = cam_ope_mgr_remove_bw(hw_mgr, ctx_id);
	if (rc)
		CAM_ERR(CAM_OPE, "OPE remove bw failed: %d", rc);

	rc = cam_ope_mgr_ope_clk_remove(hw_mgr, ctx_id);
	if (rc)
		CAM_ERR(CAM_OPE, "OPE clk update failed: %d", rc);
@@ -2518,6 +2514,21 @@ static int cam_ope_mgr_release_hw(void *hw_priv, void *hw_release_args)
		cam_ope_device_timer_stop(hw_mgr);
	}

	rc = cam_ope_mgr_remove_bw(hw_mgr, ctx_id);
	if (rc)
		CAM_ERR(CAM_OPE, "OPE remove bw failed: %d", rc);

	if (!hw_mgr->ope_ctx_cnt) {
		for (i = 0; i < ope_hw_mgr->num_ope; i++) {
			dev_intf = hw_mgr->ope_dev_intf[i];
			rc = dev_intf->hw_ops.stop(
				hw_mgr->ope_dev_intf[i]->hw_priv,
				NULL, 0);
			if (rc)
				CAM_ERR(CAM_OPE, "stop failed: %d", rc);
		}
	}

	mutex_unlock(&hw_mgr->hw_mgr_mutex);

	CAM_DBG(CAM_OPE, "Release done for ctx_id %d", ctx_id);
+23 −8
Original line number Diff line number Diff line
@@ -96,7 +96,29 @@ int cam_ope_start(void *hw_priv, void *start_args, uint32_t arg_size)

int cam_ope_stop(void *hw_priv, void *start_args, uint32_t arg_size)
{
	return 0;
	struct cam_hw_info *ope_dev = hw_priv;
	struct cam_ope_device_core_info *core_info = NULL;
	int rc = 0;

	if (!hw_priv) {
		CAM_ERR(CAM_OPE, "Invalid cam_dev_info");
		return -EINVAL;
	}

	core_info = (struct cam_ope_device_core_info *)ope_dev->core_info;
	if (!core_info) {
		CAM_ERR(CAM_OPE, "core_info = %pK", core_info);
		return -EINVAL;
	}

	if (core_info->cpas_start) {
		if (cam_cpas_stop(core_info->cpas_handle))
			CAM_ERR(CAM_OPE, "cpas stop is failed");
		else
			core_info->cpas_start = false;
	}

	return rc;
}

int cam_ope_flush(void *hw_priv, void *flush_args, uint32_t arg_size)
@@ -251,13 +273,6 @@ int cam_ope_deinit_hw(void *device_priv,
		CAM_ERR(CAM_OPE, "soc disable is failed : %d", rc);
	core_info->clk_enable = false;

	if (core_info->cpas_start) {
		if (cam_cpas_stop(core_info->cpas_handle))
			CAM_ERR(CAM_OPE, "cpas stop is failed");
		else
			core_info->cpas_start = false;
	}

	return rc;
}