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

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

Merge "msm: camera: cpas: fix for Shima-CAMNOC RDI latency buffer corruption"...

Merge "msm: camera: cpas: fix for Shima-CAMNOC RDI latency buffer corruption" into camera-kernel.lnx.4.0
parents 62e9a9d2 f86171a1
Loading
Loading
Loading
Loading
+9 −8
Original line number Original line Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/* SPDX-License-Identifier: GPL-2.0-only */
/*
/*
 * Copyright (c) 2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2021, The Linux Foundation. All rights reserved.
 */
 */


#ifndef _CPASTOP_V570_200_H_
#ifndef _CPASTOP_V570_200_H_
@@ -270,7 +270,7 @@ static struct cam_camnoc_specific
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.masked_value = 0,
			.masked_value = 0,
			.offset = 0xA30, /* IFE_LINEAR_PRIORITYLUT_LOW */
			.offset = 0xA30, /* IFE_LINEAR_PRIORITYLUT_LOW */
			.value = 0x66665433,
			.value = 0x66666666,
		},
		},
		.priority_lut_high = {
		.priority_lut_high = {
			.enable = true,
			.enable = true,
@@ -402,7 +402,7 @@ static struct cam_camnoc_specific
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.masked_value = 0,
			.masked_value = 0,
			.offset = 0x1430, /* IFE_RDI_WR_0_PRIORITYLUT_LOW */
			.offset = 0x1430, /* IFE_RDI_WR_0_PRIORITYLUT_LOW */
			.value = 0x66665433,
			.value = 0x66666666,
		},
		},
		.priority_lut_high = {
		.priority_lut_high = {
			.enable = true,
			.enable = true,
@@ -468,7 +468,7 @@ static struct cam_camnoc_specific
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.masked_value = 0,
			.masked_value = 0,
			.offset = 0x1A30, /* IFE_UBWC_STATS_0_PRIORITYLUT_LOW */
			.offset = 0x1A30, /* IFE_UBWC_STATS_0_PRIORITYLUT_LOW */
			.value = 0x66665433,
			.value = 0x66666666,
		},
		},
		.priority_lut_high = {
		.priority_lut_high = {
			.enable = true,
			.enable = true,
@@ -595,14 +595,14 @@ static struct cam_camnoc_specific
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.masked_value = 0,
			.masked_value = 0,
			.offset = 0x2220, /* IPE0_RD_QOSGEN_SHAPING_LOW */
			.offset = 0x2220, /* IPE0_RD_QOSGEN_SHAPING_LOW */
			.value = 0x13131313,
			.value = 0x12121212,
		},
		},
		.qosgen_shaping_high = {
		.qosgen_shaping_high = {
			.enable = true,
			.enable = true,
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.masked_value = 0,
			.masked_value = 0,
			.offset = 0x2224, /* IPE0_RD_QOSGEN_SHAPING_HIGH */
			.offset = 0x2224, /* IPE0_RD_QOSGEN_SHAPING_HIGH */
			.value = 0x13131313,
			.value = 0x12121212,
		},
		},
	},
	},
	{
	{
@@ -662,19 +662,20 @@ static struct cam_camnoc_specific
			.offset = 0x2308, /* IPE1_BPS_RD_QOSGEN_MAINCTL */
			.offset = 0x2308, /* IPE1_BPS_RD_QOSGEN_MAINCTL */
			.value = 0x2,
			.value = 0x2,
		},
		},
		//  TITAN_A_CAMNOC_cam_noc_amm_nrt_niu_0_qosgen_Shaping_Low
		.qosgen_shaping_low = {
		.qosgen_shaping_low = {
			.enable = true,
			.enable = true,
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.masked_value = 0,
			.masked_value = 0,
			.offset = 0x2320, /* IPE1_BPS_RD_QOSGEN_SHAPING_LOW */
			.offset = 0x2320, /* IPE1_BPS_RD_QOSGEN_SHAPING_LOW */
			.value = 0x24242424,
			.value = 0x23232323,
		},
		},
		.qosgen_shaping_high = {
		.qosgen_shaping_high = {
			.enable = true,
			.enable = true,
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.masked_value = 0,
			.masked_value = 0,
			.offset = 0x2324, /* IPE1_BPS_RD_QOSGEN_SHAPING_HIGH */
			.offset = 0x2324, /* IPE1_BPS_RD_QOSGEN_SHAPING_HIGH */
			.value = 0x24242424,
			.value = 0x23232323,
		},
		},
	},
	},
	{
	{
+2 −2
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
 */
 */


#include <linux/of.h>
#include <linux/of.h>
@@ -430,7 +430,7 @@ int cam_ipe_process_cmd(void *device_priv, uint32_t cmd_type,
		}
		}
		CAM_DBG(CAM_PERF, "clock rate %d", clk_rate);
		CAM_DBG(CAM_PERF, "clock rate %d", clk_rate);


		rc = cam_ipe_update_clk_rate(soc_info, clk_rate);
		rc = cam_ipe_update_clk_rate(soc_info, &clk_rate);
		if (rc)
		if (rc)
			CAM_ERR(CAM_PERF, "Failed to update clk %d", clk_rate);
			CAM_ERR(CAM_PERF, "Failed to update clk %d", clk_rate);


+6 −6
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
 */
 */


#include <linux/io.h>
#include <linux/io.h>
@@ -140,7 +140,7 @@ int cam_ipe_disable_soc_resources(struct cam_hw_soc_info *soc_info,
}
}


int cam_ipe_update_clk_rate(struct cam_hw_soc_info *soc_info,
int cam_ipe_update_clk_rate(struct cam_hw_soc_info *soc_info,
	uint32_t clk_rate)
	uint32_t *clk_rate)
{
{
	int32_t src_clk_idx;
	int32_t src_clk_idx;


@@ -151,14 +151,14 @@ int cam_ipe_update_clk_rate(struct cam_hw_soc_info *soc_info,


	if ((soc_info->clk_level_valid[CAM_TURBO_VOTE] == true) &&
	if ((soc_info->clk_level_valid[CAM_TURBO_VOTE] == true) &&
		(soc_info->clk_rate[CAM_TURBO_VOTE][src_clk_idx] != 0) &&
		(soc_info->clk_rate[CAM_TURBO_VOTE][src_clk_idx] != 0) &&
		(clk_rate > soc_info->clk_rate[CAM_TURBO_VOTE][src_clk_idx])) {
		(*clk_rate > soc_info->clk_rate[CAM_TURBO_VOTE][src_clk_idx])) {
		CAM_DBG(CAM_PERF, "clk_rate %d greater than max, reset to %d",
		CAM_DBG(CAM_PERF, "clk_rate %d greater than max, reset to %d",
			clk_rate,
			*clk_rate,
			soc_info->clk_rate[CAM_TURBO_VOTE][src_clk_idx]);
			soc_info->clk_rate[CAM_TURBO_VOTE][src_clk_idx]);
		clk_rate = soc_info->clk_rate[CAM_TURBO_VOTE][src_clk_idx];
		*clk_rate = soc_info->clk_rate[CAM_TURBO_VOTE][src_clk_idx];
	}
	}


	return cam_soc_util_set_src_clk_rate(soc_info, clk_rate);
	return cam_soc_util_set_src_clk_rate(soc_info, *clk_rate);
}
}


int cam_ipe_toggle_clk(struct cam_hw_soc_info *soc_info, bool clk_enable)
int cam_ipe_toggle_clk(struct cam_hw_soc_info *soc_info, bool clk_enable)
+2 −2
Original line number Original line Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/* SPDX-License-Identifier: GPL-2.0-only */
/*
/*
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
 */
 */


#ifndef CAM_IPE_SOC_H
#ifndef CAM_IPE_SOC_H
@@ -21,7 +21,7 @@ int cam_ipe_get_gdsc_control(struct cam_hw_soc_info *soc_info);
int cam_ipe_transfer_gdsc_control(struct cam_hw_soc_info *soc_info);
int cam_ipe_transfer_gdsc_control(struct cam_hw_soc_info *soc_info);


int cam_ipe_update_clk_rate(struct cam_hw_soc_info *soc_info,
int cam_ipe_update_clk_rate(struct cam_hw_soc_info *soc_info,
	uint32_t clk_rate);
	uint32_t *clk_rate);
int cam_ipe_toggle_clk(struct cam_hw_soc_info *soc_info, bool clk_enable);
int cam_ipe_toggle_clk(struct cam_hw_soc_info *soc_info, bool clk_enable);
void cam_ipe_deinit_soc_resources(struct cam_hw_soc_info *soc_info);
void cam_ipe_deinit_soc_resources(struct cam_hw_soc_info *soc_info);
#endif /* CAM_IPE_SOC_H */
#endif /* CAM_IPE_SOC_H */