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

Commit f0c8c0f2 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 0d649632 on remote branch

Change-Id: Idffe4cf142d3c805063436b55f6de3bd11a9a3ce
parents 5ba82554 0d649632
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -669,6 +669,8 @@ static void cam_ife_hw_mgr_print_acquire_info(
	struct cam_ife_hw_mgr_res    *hw_mgr_res = NULL;
	struct cam_ife_hw_mgr_res    *hw_mgr_res_temp = NULL;
	struct cam_isp_resource_node *hw_res = NULL;
	struct cam_hw_intf           *hw_intf = NULL;
	struct cam_vfe_num_of_acquired_resources num_rsrc;
	int hw_idx[CAM_ISP_HW_SPLIT_MAX] = {-1, -1};
	int i = 0;

@@ -688,6 +690,27 @@ static void cam_ife_hw_mgr_print_acquire_info(
	if (acquire_failed)
		goto fail;

	hw_mgr_res = list_first_entry(&hw_mgr_ctx->res_list_ife_src,
		struct cam_ife_hw_mgr_res, list);
	for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
		if (!hw_mgr_res->hw_res[i])
			continue;

		hw_intf = hw_mgr_res->hw_res[i]->hw_intf;

		if (hw_intf->hw_ops.process_cmd) {
			num_rsrc.num_pix_rsrc = num_pix_port;
			num_rsrc.num_pd_rsrc = num_pd_port;
			num_rsrc.num_rdi_rsrc = num_rdi_port;

			hw_intf->hw_ops.process_cmd(hw_intf->hw_priv,
				CAM_ISP_HW_CMD_SET_NUM_OF_ACQUIRED_RESOURCE,
				&num_rsrc,
				sizeof(
				struct cam_vfe_num_of_acquired_resources));
		}
	}

	CAM_INFO(CAM_ISP,
		"Successfully acquire %s IFE[%d %d] with [%u pix] [%u pd] [%u rdi] ports for ctx:%u",
		(hw_mgr_ctx->is_dual) ? "dual" : "single",
+9 −1
Original line number Diff line number Diff line
// 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 <media/cam_defs.h>
@@ -140,6 +140,14 @@ static int cam_isp_update_dual_config(
		}

		hw_mgr_res = &res_list_isp_out[i];
		if (!hw_mgr_res) {
			CAM_ERR(CAM_ISP,
				"Invalid isp out resource i %d num_out_res %d",
				i, dual_config->num_ports);
			rc = -EINVAL;
			goto end;
		}

		for (j = 0; j < CAM_ISP_HW_SPLIT_MAX; j++) {
			if (!hw_mgr_res->hw_res[j])
				continue;
+3 −1
Original line number Diff line number Diff line
/* 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_ISP_HW_H_
@@ -113,6 +113,8 @@ enum cam_isp_hw_cmd_type {
	CAM_ISP_HW_CMD_CSID_CHANGE_HALT_MODE,
	CAM_ISP_HW_CMD_GET_IRQ_REGISTER_DUMP,
	CAM_ISP_HW_CMD_CSID_CLOCK_DUMP,
	CAM_ISP_HW_CMD_SET_NUM_OF_ACQUIRED_RESOURCE,
	CAM_ISP_HW_CMD_GET_NUM_OF_ACQUIRED_RESOURCE,
	CAM_ISP_HW_CMD_MAX,
};

+13 −0
Original line number Diff line number Diff line
@@ -253,6 +253,19 @@ struct cam_vfe_bw_update_args {
	uint64_t                           external_bw_bytes;
};

/*
 * struct cam_vfe_num_of_acquired_resources:
 *
 * @num_pix_rsrc:            Number of pix resources acquired in context
 * @num_pd_rsrc:             Number of pd resources acquired in context
 * @num_rdi_rsrc:            Number of rdi resources acquired in context
 */
struct cam_vfe_num_of_acquired_resources {
	uint32_t      num_pix_rsrc;
	uint32_t      num_pd_rsrc;
	uint32_t      num_rdi_rsrc;
};

/*
 * struct cam_vfe_fe_update_args:
 *
+16 −3
Original line number Diff line number Diff line
// 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/delay.h>
@@ -147,6 +147,7 @@ int cam_vfe_init_hw(void *hw_priv, void *init_hw_args, uint32_t arg_size)
	struct cam_hw_soc_info            *soc_info = NULL;
	struct cam_vfe_hw_core_info       *core_info = NULL;
	struct cam_isp_resource_node      *isp_res = NULL;
	struct cam_vfe_num_of_acquired_resources num_rsrc;
	int rc = 0;
	uint32_t                           reset_core_args =
					CAM_VFE_HW_RESET_HW_AND_REG;
@@ -169,16 +170,26 @@ int cam_vfe_init_hw(void *hw_priv, void *init_hw_args, uint32_t arg_size)

	soc_info = &vfe_hw->soc_info;
	core_info = (struct cam_vfe_hw_core_info *)vfe_hw->core_info;
	isp_res   = (struct cam_isp_resource_node *)init_hw_args;

	rc = core_info->vfe_top->hw_ops.process_cmd(
		core_info->vfe_top->top_priv,
		CAM_ISP_HW_CMD_GET_NUM_OF_ACQUIRED_RESOURCE,
		&num_rsrc,
		sizeof(struct cam_vfe_num_of_acquired_resources));
	if (rc)
		CAM_ERR(CAM_ISP, "Failed to get the port information rc=%d",
			rc);

	/* Turn ON Regulators, Clocks and other SOC resources */
	rc = cam_vfe_enable_soc_resources(soc_info);
	rc = cam_vfe_enable_soc_resources(soc_info, num_rsrc.num_pix_rsrc,
		num_rsrc.num_pd_rsrc, num_rsrc.num_rdi_rsrc);
	if (rc) {
		CAM_ERR(CAM_ISP, "Enable SOC failed");
		rc = -EFAULT;
		goto decrement_open_cnt;
	}

	isp_res   = (struct cam_isp_resource_node *)init_hw_args;
	if (isp_res && isp_res->init) {
		rc = isp_res->init(isp_res, NULL, 0);
		if (rc) {
@@ -598,6 +609,8 @@ int cam_vfe_process_cmd(void *hw_priv, uint32_t cmd_type,
	case CAM_ISP_HW_CMD_QUERY_DSP_MODE:
	case CAM_ISP_HW_CMD_CAMIF_DATA:
	case CAM_ISP_HW_CMD_GET_IRQ_REGISTER_DUMP:
	case CAM_ISP_HW_CMD_SET_NUM_OF_ACQUIRED_RESOURCE:
	case CAM_ISP_HW_CMD_GET_NUM_OF_ACQUIRED_RESOURCE:
		rc = core_info->vfe_top->hw_ops.process_cmd(
			core_info->vfe_top->top_priv, cmd_type, cmd_args,
			arg_size);
Loading