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

Commit f880996d authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: Add LCR in axi bw vote and checks for memory free"

parents bc85ba53 0615d61c
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -102,12 +102,17 @@ int cam_cpas_node_tree_cleanup(struct cam_cpas *cpas_core,
	}

	for (i = 0; i < CAM_CPAS_MAX_TREE_LEVELS; i++) {
		if (soc_private->level_node[i]) {
			of_node_put(soc_private->level_node[i]);
			soc_private->level_node[i] = NULL;
		}
	}

	if (soc_private->camera_bus_node) {
		of_node_put(soc_private->camera_bus_node);
		soc_private->camera_bus_node = NULL;
	}

	mutex_destroy(&cpas_core->tree_lock);

	return 0;
+1 −1
Original line number Diff line number Diff line
@@ -4118,7 +4118,7 @@ static int cam_icp_packet_generic_blob_handler(void *user_data,

	switch (blob_type) {
	case CAM_ICP_CMD_GENERIC_BLOB_CLK:
		CAM_WARN(CAM_ICP,
		CAM_WARN_RATE_LIMIT_CUSTOM(CAM_ICP, 300, 1,
			"Using deprecated blob type GENERIC_BLOB_CLK");
		if (blob_size != sizeof(struct cam_icp_clk_bw_request)) {
			CAM_ERR(CAM_ICP, "Mismatch blob size %d expected %lu",
+10 −29
Original line number Diff line number Diff line
@@ -2715,7 +2715,8 @@ static int cam_isp_classify_vote_info(

	if ((hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_CAMIF)
		|| (hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_RD) ||
		(hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_PDLIB)) {
		(hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_PDLIB) ||
		(hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_LCR)) {
		if (split_idx == CAM_ISP_HW_SPLIT_LEFT) {
			if (*camif_l_bw_updated)
				return rc;
@@ -2890,8 +2891,11 @@ static int cam_isp_blob_bw_update(
			if (!hw_mgr_res->hw_res[i])
				continue;

			if ((hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_CAMIF)
			|| (hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_RD))
			if ((hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_CAMIF) ||
				(hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_RD) ||
				(hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_PDLIB)
				|| (hw_mgr_res->res_id ==
				CAM_ISP_HW_VFE_IN_LCR))
				if (i == CAM_ISP_HW_SPLIT_LEFT) {
					if (camif_l_bw_updated)
						continue;
@@ -2925,32 +2929,8 @@ static int cam_isp_blob_bw_update(
					bw_config->rdi_vote[idx].cam_bw_bps;
				ext_bw_bps =
					bw_config->rdi_vote[idx].ext_bw_bps;
			} else if (hw_mgr_res->res_id ==
				CAM_ISP_HW_VFE_IN_PDLIB) {
				if (i == CAM_ISP_HW_SPLIT_LEFT) {
					if (camif_l_bw_updated)
						continue;

					cam_bw_bps =
					bw_config->left_pix_vote.cam_bw_bps;
					ext_bw_bps =
					bw_config->left_pix_vote.ext_bw_bps;

					camif_l_bw_updated = true;
			} else {
					if (camif_r_bw_updated)
						continue;

					cam_bw_bps =
					bw_config->right_pix_vote.cam_bw_bps;
					ext_bw_bps =
					bw_config->right_pix_vote.ext_bw_bps;

					camif_r_bw_updated = true;
				}
			} else {
				if (hw_mgr_res->res_id != CAM_ISP_HW_VFE_IN_LCR
					&& hw_mgr_res->hw_res[i]) {
				if (hw_mgr_res->hw_res[i]) {
					CAM_ERR(CAM_ISP, "Invalid res_id %u",
						hw_mgr_res->res_id);
					rc = -EINVAL;
@@ -4625,7 +4605,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data,
		struct cam_isp_bw_config    *bw_config;
		struct cam_isp_prepare_hw_update_data   *prepare_hw_data;

		CAM_WARN(CAM_ISP, "Deprecated Blob TYPE_BW_CONFIG");
		CAM_WARN_RATE_LIMIT_CUSTOM(CAM_ISP, 300, 1,
			"Deprecated Blob TYPE_BW_CONFIG");
		if (blob_size < sizeof(struct cam_isp_bw_config)) {
			CAM_ERR(CAM_ISP, "Invalid blob size %u", blob_size);
			return -EINVAL;
+79 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 */

#ifndef _CAM_DEBUG_UTIL_H_
@@ -109,7 +109,7 @@ const char *cam_get_module_name(unsigned int module_id);
 * @args     :  Arguments which needs to be print in log
 */
#define CAM_INFO_RATE_LIMIT(__module, fmt, args...)                 \
	pr_err_ratelimited("CAM_INFO: %s: %s: %d " fmt "\n",            \
	pr_info_ratelimited("CAM_INFO: %s: %s: %d " fmt "\n",            \
		cam_get_module_name(__module), __func__,  __LINE__, ##args)

/*
@@ -130,5 +130,82 @@ const char *cam_get_module_name(unsigned int module_id);
#define CAM_ERR_RATE_LIMIT(__module, fmt, args...)                 \
	pr_err_ratelimited("CAM_ERR: %s: %s: %d " fmt "\n",            \
		cam_get_module_name(__module), __func__,  __LINE__, ##args)
/*
 * CAM_WARN_RATE_LIMIT
 * @brief    :  This Macro will print warning logs with ratelimit
 *
 * @__module :  Respective module id which is been calling this Macro
 * @fmt      :  Formatted string which needs to be print in log
 * @args     :  Arguments which needs to be print in log
 */
#define CAM_WARN_RATE_LIMIT(__module, fmt, args...)                 \
	pr_warn_ratelimited("CAM_WARN: %s: %s: %d " fmt "\n",           \
		cam_get_module_name(__module), __func__,  __LINE__, ##args)

/*
 * CAM_WARN_RATE_LIMIT_CUSTOM
 * @brief    :  This Macro will print warn logs with custom ratelimit
 *
 * @__module :  Respective module id which is been calling this Macro
 * @interval :  Time interval in seconds
 * @burst    :  No of logs to print in interval time
 * @fmt      :  Formatted string which needs to be print in log
 * @args     :  Arguments which needs to be print in log
 */
#define CAM_WARN_RATE_LIMIT_CUSTOM(__module, interval, burst, fmt, args...) \
	({                                                                  \
		static DEFINE_RATELIMIT_STATE(_rs,                          \
			(interval * HZ),                                    \
			burst);                                             \
		if (__ratelimit(&_rs))                                      \
			pr_warn(                                            \
				"CAM_WARN: %s: %s: %d " fmt "\n",           \
				cam_get_module_name(__module), __func__,    \
				__LINE__, ##args);                          \
	})

/*
 * CAM_INFO_RATE_LIMIT_CUSTOM
 * @brief    :  This Macro will print info logs with custom ratelimit
 *
 * @__module :  Respective module id which is been calling this Macro
 * @interval :  Time interval in seconds
 * @burst    :  No of logs to print in interval time
 * @fmt      :  Formatted string which needs to be print in log
 * @args     :  Arguments which needs to be print in log
 */
#define CAM_INFO_RATE_LIMIT_CUSTOM(__module, interval, burst, fmt, args...) \
	({                                                                  \
		static DEFINE_RATELIMIT_STATE(_rs,                          \
			(interval * HZ),                                    \
			burst);                                             \
		if (__ratelimit(&_rs))                                      \
			pr_info(                                            \
				"CAM_INFO: %s: %s: %d " fmt "\n",           \
				cam_get_module_name(__module), __func__,    \
				__LINE__, ##args);                          \
	})

/*
 * CAM_ERR_RATE_LIMIT_CUSTOM
 * @brief    :  This Macro will print error logs with custom ratelimit
 *
 * @__module :  Respective module id which is been calling this Macro
 * @interval :  Time interval in seconds
 * @burst    :  No of logs to print in interval time
 * @fmt      :  Formatted string which needs to be print in log
 * @args     :  Arguments which needs to be print in log
 */
#define CAM_ERR_RATE_LIMIT_CUSTOM(__module, interval, burst, fmt, args...) \
	({                                                                 \
		static DEFINE_RATELIMIT_STATE(_rs,                         \
			(interval * HZ),                                   \
			burst);                                            \
		if (__ratelimit(&_rs))                                     \
			pr_err(                                            \
				"CAM_ERR: %s: %s: %d " fmt "\n",           \
				cam_get_module_name(__module), __func__,   \
				__LINE__, ##args);                         \
	})

#endif /* _CAM_DEBUG_UTIL_H_ */