msm: camera: icp: Symbols Renamed to Accommodate for OFE

Rename symbols in ICP driver to accommodate for newly added
OFE driver. Symbols that specifically contain string "ipe_bps"
or "ipebps" are renamed to "dev" or "device" to make the symbol
generic and adaptable to any distinct HW names such as OFE.

CRs-fixed: 3266661
Change-Id: I141342e40d52cbb3c676389a13f1428435054913
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
This commit is contained in:
Sokchetra Eung
2022-07-28 12:12:09 -07:00
committed by Camera Software Integration
parent 1f4e9d51a6
commit 4e06429fc8
9 changed files with 121 additions and 119 deletions

View File

@@ -149,14 +149,14 @@ int hfi_set_fw_dump_level(uint32_t lvl);
int hfi_send_freq_info(int32_t freq); int hfi_send_freq_info(int32_t freq);
/** /**
* hfi_enable_ipe_bps_pc() - Enable interframe pc * hfi_enable_dev_pc() - Enable interframe pc
* Host sends a command to firmware to enable interframe * Host sends a command to firmware to enable interframe
* power collapse for IPE and BPS hardware. * power collapse for ICP's controlled hardware.
* *
* @enable: flag to enable/disable * @enable: flag to enable/disable
* @core_info: Core information to firmware * @core_info: Core information to firmware
*/ */
int hfi_enable_ipe_bps_pc(bool enable, uint32_t core_info); int hfi_enable_dev_pc(bool enable, uint32_t core_info);
/** /**
* hfi_cmd_ubwc_config_ext() - UBWC configuration to firmware * hfi_cmd_ubwc_config_ext() - UBWC configuration to firmware

View File

@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
/* /*
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*/ */
#ifndef _CAM_HFI_SESSION_DEFS_H #ifndef _CAM_HFI_SESSION_DEFS_H
@@ -96,7 +97,7 @@ struct hfi_cmd_abort {
* struct hfi_cmd_abort_destroy * struct hfi_cmd_abort_destroy
* @user_data: user supplied data * @user_data: user supplied data
* *
* IPE/BPS destroy/abort command * Device destroy/abort command
* @HFI_IPEBPS_CMD_OPCODE_IPE_ABORT * @HFI_IPEBPS_CMD_OPCODE_IPE_ABORT
* @HFI_IPEBPS_CMD_OPCODE_BPS_ABORT * @HFI_IPEBPS_CMD_OPCODE_BPS_ABORT
* @HFI_IPEBPS_CMD_OPCODE_IPE_DESTROY * @HFI_IPEBPS_CMD_OPCODE_IPE_DESTROY
@@ -126,7 +127,7 @@ struct hfi_cmd_chaining_ops {
* struct hfi_cmd_create_handle * struct hfi_cmd_create_handle
* @size: packet size in bytes * @size: packet size in bytes
* @pkt_type: opcode of a packet * @pkt_type: opcode of a packet
* @handle_type: IPE/BPS firmware session handle type * @handle_type: device firmware session handle type
* @user_data1: caller provided data1 * @user_data1: caller provided data1
* @user_data2: caller provided data2 * @user_data2: caller provided data2
* *
@@ -141,28 +142,28 @@ struct hfi_cmd_create_handle {
} __packed; } __packed;
/** /**
* struct hfi_cmd_ipebps_async * struct hfi_cmd_dev_async
* @size: packet size in bytes * @size: packet size in bytes
* @pkt_type: opcode of a packet * @pkt_type: opcode of a packet
* @opcode: opcode for IPE/BPS async operation * @opcode: opcode for devices' async operation
* CONFIG_IO: configures I/O for IPE/BPS handle * CONFIG_IO: configures I/O for device handle
* FRAME_PROCESS: image frame to be processed by IPE/BPS * FRAME_PROCESS: image frame to be processed by device
* ABORT: abort all processing frames of IPE/BPS handle * ABORT: abort all processing frames of device handle
* DESTROY: destroy earlier created IPE/BPS handle * DESTROY: destroy earlier created device handle
* BPS_WAITS_FOR_IPE: sync for BPS to wait for IPE * BPS_WAITS_FOR_IPE: sync for BPS to wait for IPE
* BPS_WAITS_FOR_BPS: sync for BPS to wait for BPS * BPS_WAITS_FOR_BPS: sync for BPS to wait for BPS
* IPE_WAITS_FOR_IPE: sync for IPE to wait for IPE * IPE_WAITS_FOR_IPE: sync for IPE to wait for IPE
* IPE_WAITS_FOR_BPS: sync for IPE to wait for BPS * IPE_WAITS_FOR_BPS: sync for IPE to wait for BPS
* @num_fw_handles: number of IPE/BPS firmware handles in fw_handles array * @num_fw_handles: number of device firmware handles in fw_handles array
* @fw_handles: IPE/BPS handles array * @fw_handles: device handles array
* @payload: command payload for IPE/BPS opcodes * @payload: command payload for device opcodes
* @direct: points to actual payload * @direct: points to actual payload
* @indirect: points to address of payload * @indirect: points to address of payload
* *
* sends async command to the earlier created IPE or BPS handle * sends async command to the earlier created device handle
* for asynchronous operation. * for asynchronous operation.
*/ */
struct hfi_cmd_ipebps_async { struct hfi_cmd_dev_async {
uint32_t size; uint32_t size;
uint32_t pkt_type; uint32_t pkt_type;
uint32_t opcode; uint32_t opcode;
@@ -181,11 +182,11 @@ struct hfi_cmd_ipebps_async {
* @size: packet size in bytes * @size: packet size in bytes
* @pkt_type: opcode of a packet * @pkt_type: opcode of a packet
* @err_type: error code * @err_type: error code
* @fw_handle: output param for IPE/BPS handle * @fw_handle: output param for device handle
* @user_data1: user provided data1 * @user_data1: user provided data1
* @user_data2: user provided data2 * @user_data2: user provided data2
* *
* ack for create handle command of IPE/BPS * ack for create handle command of ICP's controlled HW
* @HFI_MSG_IPEBPS_CREATE_HANDLE_ACK * @HFI_MSG_IPEBPS_CREATE_HANDLE_ACK
*/ */
struct hfi_msg_create_handle_ack { struct hfi_msg_create_handle_ack {
@@ -198,19 +199,19 @@ struct hfi_msg_create_handle_ack {
} __packed; } __packed;
/** /**
* struct hfi_msg_ipebps_async * struct hfi_msg_dev_async_ack
* @size: packet size in bytes * @size: packet size in bytes
* @pkt_type: opcode of a packet * @pkt_type: opcode of a packet
* @opcode: opcode of IPE/BPS async operation * @opcode: opcode of the device async operation
* @user_data1: user provided data1 * @user_data1: user provided data1
* @user_data2: user provided data2 * @user_data2: user provided data2
* @err_type: error code * @err_type: error code
* @msg_data: IPE/BPS async done message data * @msg_data: device async done message data
* *
* result of IPE/BPS async command * result of device async command
* @HFI_MSG_IPEBPS_ASYNC_COMMAND_ACK * @HFI_MSG_IPEBPS_ASYNC_COMMAND_ACK
*/ */
struct hfi_msg_ipebps_async_ack { struct hfi_msg_dev_async_ack {
uint32_t size; uint32_t size;
uint32_t pkt_type; uint32_t pkt_type;
uint32_t opcode; uint32_t opcode;
@@ -235,7 +236,7 @@ struct hfi_msg_frame_process_done {
* @status: return status * @status: return status
* @user_data: user data provided as part of chaining ops * @user_data: user data provided as part of chaining ops
* *
* IPE/BPS wait response * Device wait response
*/ */
struct hfi_msg_chaining_op { struct hfi_msg_chaining_op {
uint32_t status; uint32_t status;
@@ -247,7 +248,7 @@ struct hfi_msg_chaining_op {
* @status: return status * @status: return status
* @user_data: user data provided as part of abort/destroy ops * @user_data: user data provided as part of abort/destroy ops
* *
* IPE/BPS abort/destroy response * Device abort/destroy response
*/ */
struct hfi_msg_abort_destroy { struct hfi_msg_abort_destroy {
uint32_t status; uint32_t status;
@@ -556,10 +557,10 @@ struct hfi_msg_bps_common {
} __packed; } __packed;
/** /**
* struct ipe_bps_destroy * struct icp_dev_destroy
* @user_data: user data * @user_data: user data
*/ */
struct ipe_bps_destroy { struct icp_dev_destroy {
uint64_t userdata; uint64_t userdata;
}; };

View File

@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
/* /*
* Copyright (c) 2017-2019, 2021 The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, 2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*/ */
#ifndef _HFI_DEFS_H_ #ifndef _HFI_DEFS_H_
@@ -278,12 +279,12 @@ struct hfi_debug {
} __packed; } __packed;
/** /**
* struct hfi_ipe_bps_pc * struct hfi_dev_pc
* payload structure to configure HFI_PROPERTY_SYS_IPEBPS_PC * payload structure to configure HFI_PROPERTY_SYS_DEV_PC
* @enable: Flag to enable IPE, BPS interfrane power collapse * @enable: Flag to enable IPE, BPS interfrane power collapse
* @core_info: Core information to firmware * @core_info: Core information to firmware
*/ */
struct hfi_ipe_bps_pc { struct hfi_dev_pc {
uint32_t enable; uint32_t enable;
uint32_t core_info; uint32_t core_info;
} __packed; } __packed;

View File

@@ -421,14 +421,14 @@ int hfi_cmd_ubwc_config_ext(uint32_t *ubwc_ipe_cfg,
} }
int hfi_enable_ipe_bps_pc(bool enable, uint32_t core_info) int hfi_enable_dev_pc(bool enable, uint32_t core_info)
{ {
uint8_t *prop; uint8_t *prop;
struct hfi_cmd_prop *dbg_prop; struct hfi_cmd_prop *dbg_prop;
uint32_t size = 0; uint32_t size = 0;
size = sizeof(struct hfi_cmd_prop) + size = sizeof(struct hfi_cmd_prop) +
sizeof(struct hfi_ipe_bps_pc); sizeof(struct hfi_dev_pc);
prop = kzalloc(size, GFP_KERNEL); prop = kzalloc(size, GFP_KERNEL);
if (!prop) if (!prop)

View File

@@ -430,7 +430,7 @@ int cam_bps_process_cmd(void *device_priv, uint32_t cmd_type,
CAM_DBG(CAM_PERF, "bps_src_clk rate = %d", (int)clk_rate); CAM_DBG(CAM_PERF, "bps_src_clk rate = %d", (int)clk_rate);
if (!core_info->clk_enable) { if (!core_info->clk_enable) {
if (clk_upd_cmd->ipe_bps_pc_enable) { if (clk_upd_cmd->dev_pc_enable) {
cam_bps_handle_pc(bps_dev); cam_bps_handle_pc(bps_dev);
cam_cpas_reg_write(core_info->cpas_handle, cam_cpas_reg_write(core_info->cpas_handle,
CAM_CPAS_REG_CPASTOP, CAM_CPAS_REG_CPASTOP,
@@ -441,7 +441,7 @@ int cam_bps_process_cmd(void *device_priv, uint32_t cmd_type,
CAM_ERR(CAM_ICP, "Enable failed"); CAM_ERR(CAM_ICP, "Enable failed");
else else
core_info->clk_enable = true; core_info->clk_enable = true;
if (clk_upd_cmd->ipe_bps_pc_enable) { if (clk_upd_cmd->dev_pc_enable) {
rc = cam_bps_handle_resume(bps_dev); rc = cam_bps_handle_resume(bps_dev);
if (rc) if (rc)
CAM_ERR(CAM_ICP, "BPS resume failed"); CAM_ERR(CAM_ICP, "BPS resume failed");

View File

@@ -427,7 +427,7 @@ static int32_t cam_icp_deinit_idle_clk(void *priv, void *data)
CAM_DBG(CAM_PERF, "Disable %d", clk_info->hw_type); CAM_DBG(CAM_PERF, "Disable %d", clk_info->hw_type);
clk_upd_cmd.ipe_bps_pc_enable = icp_hw_mgr.ipe_bps_pc_flag; clk_upd_cmd.dev_pc_enable = icp_hw_mgr.dev_pc_flag;
dev_intf->hw_ops.process_cmd(dev_intf->hw_priv, id, dev_intf->hw_ops.process_cmd(dev_intf->hw_priv, id,
&clk_upd_cmd, sizeof(clk_upd_cmd)); &clk_upd_cmd, sizeof(clk_upd_cmd));
@@ -1505,7 +1505,7 @@ static int cam_icp_update_clk_rate(struct cam_icp_hw_mgr *hw_mgr,
CAM_DBG(CAM_PERF, "clk_rate %u for dev_type %d", curr_clk_rate, CAM_DBG(CAM_PERF, "clk_rate %u for dev_type %d", curr_clk_rate,
ctx_data->icp_dev_acquire_info->dev_type); ctx_data->icp_dev_acquire_info->dev_type);
clk_upd_cmd.curr_clk_rate = curr_clk_rate; clk_upd_cmd.curr_clk_rate = curr_clk_rate;
clk_upd_cmd.ipe_bps_pc_enable = icp_hw_mgr.ipe_bps_pc_flag; clk_upd_cmd.dev_pc_enable = icp_hw_mgr.dev_pc_flag;
clk_upd_cmd.clk_level = -1; clk_upd_cmd.clk_level = -1;
dev_intf->hw_ops.process_cmd(dev_intf->hw_priv, id, dev_intf->hw_ops.process_cmd(dev_intf->hw_priv, id,
@@ -1645,7 +1645,7 @@ static int cam_icp_update_cpas_vote(struct cam_icp_hw_mgr *hw_mgr,
return rc; return rc;
} }
static int cam_icp_mgr_ipe_bps_clk_update(struct cam_icp_hw_mgr *hw_mgr, static int cam_icp_mgr_dev_clk_update(struct cam_icp_hw_mgr *hw_mgr,
struct cam_icp_hw_ctx_data *ctx_data, int idx) struct cam_icp_hw_ctx_data *ctx_data, int idx)
{ {
int rc = 0; int rc = 0;
@@ -1659,7 +1659,7 @@ static int cam_icp_mgr_ipe_bps_clk_update(struct cam_icp_hw_mgr *hw_mgr,
return rc; return rc;
} }
static int cam_icp_mgr_ipe_bps_resume(struct cam_icp_hw_mgr *hw_mgr, static int cam_icp_mgr_device_resume(struct cam_icp_hw_mgr *hw_mgr,
struct cam_icp_hw_ctx_data *ctx_data) struct cam_icp_hw_ctx_data *ctx_data)
{ {
struct cam_hw_intf *ipe0_dev_intf = NULL; struct cam_hw_intf *ipe0_dev_intf = NULL;
@@ -1685,7 +1685,7 @@ static int cam_icp_mgr_ipe_bps_resume(struct cam_icp_hw_mgr *hw_mgr,
bps_dev_intf->hw_priv, NULL, 0); bps_dev_intf->hw_priv, NULL, 0);
hw_mgr->bps_clk_state = true; hw_mgr->bps_clk_state = true;
} }
if (icp_hw_mgr.ipe_bps_pc_flag) { if (icp_hw_mgr.dev_pc_flag) {
bps_dev_intf->hw_ops.process_cmd( bps_dev_intf->hw_ops.process_cmd(
bps_dev_intf->hw_priv, bps_dev_intf->hw_priv,
CAM_ICP_BPS_CMD_POWER_RESUME, NULL, 0); CAM_ICP_BPS_CMD_POWER_RESUME, NULL, 0);
@@ -1697,7 +1697,7 @@ static int cam_icp_mgr_ipe_bps_resume(struct cam_icp_hw_mgr *hw_mgr,
if (!hw_mgr->ipe_clk_state) if (!hw_mgr->ipe_clk_state)
ipe0_dev_intf->hw_ops.init( ipe0_dev_intf->hw_ops.init(
ipe0_dev_intf->hw_priv, NULL, 0); ipe0_dev_intf->hw_priv, NULL, 0);
if (icp_hw_mgr.ipe_bps_pc_flag) { if (icp_hw_mgr.dev_pc_flag) {
ipe0_dev_intf->hw_ops.process_cmd( ipe0_dev_intf->hw_ops.process_cmd(
ipe0_dev_intf->hw_priv, ipe0_dev_intf->hw_priv,
CAM_ICP_IPE_CMD_POWER_RESUME, NULL, 0); CAM_ICP_IPE_CMD_POWER_RESUME, NULL, 0);
@@ -1709,7 +1709,7 @@ static int cam_icp_mgr_ipe_bps_resume(struct cam_icp_hw_mgr *hw_mgr,
ipe1_dev_intf->hw_ops.init(ipe1_dev_intf->hw_priv, ipe1_dev_intf->hw_ops.init(ipe1_dev_intf->hw_priv,
NULL, 0); NULL, 0);
if (icp_hw_mgr.ipe_bps_pc_flag) { if (icp_hw_mgr.dev_pc_flag) {
ipe1_dev_intf->hw_ops.process_cmd( ipe1_dev_intf->hw_ops.process_cmd(
ipe1_dev_intf->hw_priv, ipe1_dev_intf->hw_priv,
CAM_ICP_IPE_CMD_POWER_RESUME, CAM_ICP_IPE_CMD_POWER_RESUME,
@@ -1727,15 +1727,15 @@ static int cam_icp_mgr_ipe_bps_resume(struct cam_icp_hw_mgr *hw_mgr,
} }
CAM_DBG(CAM_PERF, "core_info %X", core_info_mask); CAM_DBG(CAM_PERF, "core_info %X", core_info_mask);
if (icp_hw_mgr.ipe_bps_pc_flag) if (icp_hw_mgr.dev_pc_flag)
rc = hfi_enable_ipe_bps_pc(true, core_info_mask); rc = hfi_enable_dev_pc(true, core_info_mask);
else else
rc = hfi_enable_ipe_bps_pc(false, core_info_mask); rc = hfi_enable_dev_pc(false, core_info_mask);
end: end:
return rc; return rc;
} }
static int cam_icp_mgr_ipe_bps_power_collapse(struct cam_icp_hw_mgr *hw_mgr, static int cam_icp_mgr_dev_power_collapse(struct cam_icp_hw_mgr *hw_mgr,
struct cam_icp_hw_ctx_data *ctx_data, int dev_type) struct cam_icp_hw_ctx_data *ctx_data, int dev_type)
{ {
int rc = 0, dev; int rc = 0, dev;
@@ -1765,7 +1765,7 @@ static int cam_icp_mgr_ipe_bps_power_collapse(struct cam_icp_hw_mgr *hw_mgr,
if (hw_mgr->bps_ctxt_cnt) if (hw_mgr->bps_ctxt_cnt)
goto end; goto end;
if (icp_hw_mgr.ipe_bps_pc_flag && if (icp_hw_mgr.dev_pc_flag &&
!atomic_read(&hw_mgr->recovery)) { !atomic_read(&hw_mgr->recovery)) {
rc = bps_dev_intf->hw_ops.process_cmd( rc = bps_dev_intf->hw_ops.process_cmd(
bps_dev_intf->hw_priv, bps_dev_intf->hw_priv,
@@ -1786,7 +1786,7 @@ static int cam_icp_mgr_ipe_bps_power_collapse(struct cam_icp_hw_mgr *hw_mgr,
if (hw_mgr->ipe_ctxt_cnt) if (hw_mgr->ipe_ctxt_cnt)
goto end; goto end;
if (icp_hw_mgr.ipe_bps_pc_flag && if (icp_hw_mgr.dev_pc_flag &&
!atomic_read(&hw_mgr->recovery)) { !atomic_read(&hw_mgr->recovery)) {
rc = ipe0_dev_intf->hw_ops.process_cmd( rc = ipe0_dev_intf->hw_ops.process_cmd(
ipe0_dev_intf->hw_priv, ipe0_dev_intf->hw_priv,
@@ -1798,7 +1798,7 @@ static int cam_icp_mgr_ipe_bps_power_collapse(struct cam_icp_hw_mgr *hw_mgr,
ipe0_dev_intf->hw_priv, NULL, 0); ipe0_dev_intf->hw_priv, NULL, 0);
if (ipe1_dev_intf) { if (ipe1_dev_intf) {
if (icp_hw_mgr.ipe_bps_pc_flag && if (icp_hw_mgr.dev_pc_flag &&
!atomic_read(&hw_mgr->recovery)) { !atomic_read(&hw_mgr->recovery)) {
rc = ipe1_dev_intf->hw_ops.process_cmd( rc = ipe1_dev_intf->hw_ops.process_cmd(
ipe1_dev_intf->hw_priv, ipe1_dev_intf->hw_priv,
@@ -1818,7 +1818,7 @@ end:
return rc; return rc;
} }
static int cam_icp_mgr_ipe_bps_get_gdsc_control( static int cam_icp_mgr_dev_get_gdsc_control(
struct cam_icp_hw_mgr *hw_mgr) struct cam_icp_hw_mgr *hw_mgr)
{ {
int rc = 0; int rc = 0;
@@ -1835,7 +1835,7 @@ static int cam_icp_mgr_ipe_bps_get_gdsc_control(
return -EINVAL; return -EINVAL;
} }
if (icp_hw_mgr.ipe_bps_pc_flag) { if (icp_hw_mgr.dev_pc_flag) {
rc = bps_dev_intf->hw_ops.process_cmd( rc = bps_dev_intf->hw_ops.process_cmd(
bps_dev_intf->hw_priv, bps_dev_intf->hw_priv,
CAM_ICP_BPS_CMD_POWER_COLLAPSE, CAM_ICP_BPS_CMD_POWER_COLLAPSE,
@@ -2032,8 +2032,8 @@ static int cam_icp_hw_mgr_create_debugfs_entry(void)
debugfs_create_bool("icp_pc", 0644, icp_hw_mgr.dentry, debugfs_create_bool("icp_pc", 0644, icp_hw_mgr.dentry,
&icp_hw_mgr.icp_pc_flag); &icp_hw_mgr.icp_pc_flag);
debugfs_create_bool("ipe_bps_pc", 0644, icp_hw_mgr.dentry, debugfs_create_bool("dev_interframe_pc", 0644, icp_hw_mgr.dentry,
&icp_hw_mgr.ipe_bps_pc_flag); &icp_hw_mgr.dev_pc_flag);
debugfs_create_file("icp_debug_clk", 0644, debugfs_create_file("icp_debug_clk", 0644,
icp_hw_mgr.dentry, NULL, &cam_icp_debug_default_clk); icp_hw_mgr.dentry, NULL, &cam_icp_debug_default_clk);
@@ -2325,7 +2325,7 @@ static int cam_icp_mgr_handle_frame_process(uint32_t *msg_ptr, int flag)
uint32_t idx; uint32_t idx;
uint64_t request_id; uint64_t request_id;
struct cam_icp_hw_ctx_data *ctx_data = NULL; struct cam_icp_hw_ctx_data *ctx_data = NULL;
struct hfi_msg_ipebps_async_ack *ioconfig_ack = NULL; struct hfi_msg_dev_async_ack *ioconfig_ack = NULL;
struct hfi_frame_process_info *hfi_frame_process; struct hfi_frame_process_info *hfi_frame_process;
struct cam_hw_done_event_data buf_data = {0}; struct cam_hw_done_event_data buf_data = {0};
struct cam_icp_hw_buf_done_evt_data icp_done_evt; struct cam_icp_hw_buf_done_evt_data icp_done_evt;
@@ -2333,7 +2333,7 @@ static int cam_icp_mgr_handle_frame_process(uint32_t *msg_ptr, int flag)
uint32_t clk_type, event_id; uint32_t clk_type, event_id;
struct cam_hangdump_mem_regions *mem_regions = NULL; struct cam_hangdump_mem_regions *mem_regions = NULL;
ioconfig_ack = (struct hfi_msg_ipebps_async_ack *)msg_ptr; ioconfig_ack = (struct hfi_msg_dev_async_ack *)msg_ptr;
request_id = ioconfig_ack->user_data2; request_id = ioconfig_ack->user_data2;
ctx_data = (struct cam_icp_hw_ctx_data *) ctx_data = (struct cam_icp_hw_ctx_data *)
U64_TO_PTR(ioconfig_ack->user_data1); U64_TO_PTR(ioconfig_ack->user_data1);
@@ -2475,7 +2475,7 @@ static int cam_icp_mgr_handle_frame_process(uint32_t *msg_ptr, int flag)
static int cam_icp_mgr_process_msg_frame_process(uint32_t *msg_ptr) static int cam_icp_mgr_process_msg_frame_process(uint32_t *msg_ptr)
{ {
struct hfi_msg_ipebps_async_ack *ioconfig_ack = NULL; struct hfi_msg_dev_async_ack *ioconfig_ack = NULL;
struct hfi_msg_frame_process_done *frame_done; struct hfi_msg_frame_process_done *frame_done;
if (!msg_ptr) { if (!msg_ptr) {
@@ -2483,7 +2483,7 @@ static int cam_icp_mgr_process_msg_frame_process(uint32_t *msg_ptr)
return -EINVAL; return -EINVAL;
} }
ioconfig_ack = (struct hfi_msg_ipebps_async_ack *)msg_ptr; ioconfig_ack = (struct hfi_msg_dev_async_ack *)msg_ptr;
if (ioconfig_ack->err_type != CAMERAICP_SUCCESS) { if (ioconfig_ack->err_type != CAMERAICP_SUCCESS) {
cam_icp_mgr_handle_frame_process(msg_ptr, cam_icp_mgr_handle_frame_process(msg_ptr,
ICP_FRAME_PROCESS_FAILURE); ICP_FRAME_PROCESS_FAILURE);
@@ -2509,7 +2509,7 @@ static int cam_icp_mgr_process_msg_frame_process(uint32_t *msg_ptr)
static int cam_icp_mgr_process_msg_config_io(uint32_t *msg_ptr) static int cam_icp_mgr_process_msg_config_io(uint32_t *msg_ptr)
{ {
struct cam_icp_hw_ctx_data *ctx_data = NULL; struct cam_icp_hw_ctx_data *ctx_data = NULL;
struct hfi_msg_ipebps_async_ack *ioconfig_ack = NULL; struct hfi_msg_dev_async_ack *ioconfig_ack = NULL;
struct hfi_msg_ipe_config *ipe_config_ack = NULL; struct hfi_msg_ipe_config *ipe_config_ack = NULL;
struct hfi_msg_bps_common *bps_config_ack = NULL; struct hfi_msg_bps_common *bps_config_ack = NULL;
@@ -2518,7 +2518,7 @@ static int cam_icp_mgr_process_msg_config_io(uint32_t *msg_ptr)
return -EINVAL; return -EINVAL;
} }
ioconfig_ack = (struct hfi_msg_ipebps_async_ack *)msg_ptr; ioconfig_ack = (struct hfi_msg_dev_async_ack *)msg_ptr;
if (ioconfig_ack->opcode == HFI_IPEBPS_CMD_OPCODE_IPE_CONFIG_IO) { if (ioconfig_ack->opcode == HFI_IPEBPS_CMD_OPCODE_IPE_CONFIG_IO) {
ipe_config_ack = ipe_config_ack =
@@ -2655,7 +2655,7 @@ static int cam_icp_mgr_process_indirect_ack_msg(uint32_t *msg_ptr)
static int cam_icp_mgr_process_direct_ack_msg(uint32_t *msg_ptr) static int cam_icp_mgr_process_direct_ack_msg(uint32_t *msg_ptr)
{ {
struct cam_icp_hw_ctx_data *ctx_data = NULL; struct cam_icp_hw_ctx_data *ctx_data = NULL;
struct hfi_msg_ipebps_async_ack *ioconfig_ack = NULL; struct hfi_msg_dev_async_ack *ioconfig_ack = NULL;
int rc = 0; int rc = 0;
if (!msg_ptr) if (!msg_ptr)
@@ -2664,7 +2664,7 @@ static int cam_icp_mgr_process_direct_ack_msg(uint32_t *msg_ptr)
switch (msg_ptr[ICP_PACKET_OPCODE]) { switch (msg_ptr[ICP_PACKET_OPCODE]) {
case HFI_IPEBPS_CMD_OPCODE_IPE_ABORT: case HFI_IPEBPS_CMD_OPCODE_IPE_ABORT:
case HFI_IPEBPS_CMD_OPCODE_BPS_ABORT: case HFI_IPEBPS_CMD_OPCODE_BPS_ABORT:
ioconfig_ack = (struct hfi_msg_ipebps_async_ack *)msg_ptr; ioconfig_ack = (struct hfi_msg_dev_async_ack *)msg_ptr;
ctx_data = (struct cam_icp_hw_ctx_data *) ctx_data = (struct cam_icp_hw_ctx_data *)
U64_TO_PTR(ioconfig_ack->user_data1); U64_TO_PTR(ioconfig_ack->user_data1);
@@ -2691,7 +2691,7 @@ static int cam_icp_mgr_process_direct_ack_msg(uint32_t *msg_ptr)
break; break;
case HFI_IPEBPS_CMD_OPCODE_IPE_DESTROY: case HFI_IPEBPS_CMD_OPCODE_IPE_DESTROY:
case HFI_IPEBPS_CMD_OPCODE_BPS_DESTROY: case HFI_IPEBPS_CMD_OPCODE_BPS_DESTROY:
ioconfig_ack = (struct hfi_msg_ipebps_async_ack *)msg_ptr; ioconfig_ack = (struct hfi_msg_dev_async_ack *)msg_ptr;
ctx_data = (struct cam_icp_hw_ctx_data *) ctx_data = (struct cam_icp_hw_ctx_data *)
U64_TO_PTR(ioconfig_ack->user_data1); U64_TO_PTR(ioconfig_ack->user_data1);
if ((ctx_data->state == CAM_ICP_CTX_STATE_RELEASE) || if ((ctx_data->state == CAM_ICP_CTX_STATE_RELEASE) ||
@@ -2702,7 +2702,7 @@ static int cam_icp_mgr_process_direct_ack_msg(uint32_t *msg_ptr)
ctx_data->state); ctx_data->state);
break; break;
case HFI_IPEBPS_CMD_OPCODE_MEM_MAP: case HFI_IPEBPS_CMD_OPCODE_MEM_MAP:
ioconfig_ack = (struct hfi_msg_ipebps_async_ack *)msg_ptr; ioconfig_ack = (struct hfi_msg_dev_async_ack *)msg_ptr;
ctx_data = ctx_data =
(struct cam_icp_hw_ctx_data *)ioconfig_ack->user_data1; (struct cam_icp_hw_ctx_data *)ioconfig_ack->user_data1;
if (ctx_data->state != CAM_ICP_CTX_STATE_FREE) if (ctx_data->state != CAM_ICP_CTX_STATE_FREE)
@@ -2716,7 +2716,7 @@ static int cam_icp_mgr_process_direct_ack_msg(uint32_t *msg_ptr)
ioconfig_ack->err_type)); ioconfig_ack->err_type));
break; break;
case HFI_IPEBPS_CMD_OPCODE_MEM_UNMAP: case HFI_IPEBPS_CMD_OPCODE_MEM_UNMAP:
ioconfig_ack = (struct hfi_msg_ipebps_async_ack *)msg_ptr; ioconfig_ack = (struct hfi_msg_dev_async_ack *)msg_ptr;
ctx_data = ctx_data =
(struct cam_icp_hw_ctx_data *)ioconfig_ack->user_data1; (struct cam_icp_hw_ctx_data *)ioconfig_ack->user_data1;
if (ctx_data->state != CAM_ICP_CTX_STATE_FREE) if (ctx_data->state != CAM_ICP_CTX_STATE_FREE)
@@ -2738,7 +2738,7 @@ static int cam_icp_mgr_process_direct_ack_msg(uint32_t *msg_ptr)
return rc; return rc;
} }
static int cam_icp_ipebps_reset(struct cam_icp_hw_mgr *hw_mgr) static int cam_icp_dev_reset(struct cam_icp_hw_mgr *hw_mgr)
{ {
int rc = 0; int rc = 0;
struct cam_hw_intf *ipe0_dev_intf; struct cam_hw_intf *ipe0_dev_intf;
@@ -2797,8 +2797,8 @@ static int cam_icp_mgr_trigger_recovery(struct cam_icp_hw_mgr *hw_mgr)
CAM_WARN(CAM_ICP, "SFR:%s", sfr_buffer->msg); CAM_WARN(CAM_ICP, "SFR:%s", sfr_buffer->msg);
cam_icp_dump_debug_info(false); cam_icp_dump_debug_info(false);
cam_icp_mgr_ipe_bps_get_gdsc_control(hw_mgr); cam_icp_mgr_dev_get_gdsc_control(hw_mgr);
cam_icp_ipebps_reset(hw_mgr); cam_icp_dev_reset(hw_mgr);
atomic_set(&hw_mgr->recovery, 1); atomic_set(&hw_mgr->recovery, 1);
@@ -2931,14 +2931,14 @@ static int cam_icp_process_msg_pkt_type(
CAM_DBG(CAM_ICP, "received ASYNC_INDIRECT_ACK"); CAM_DBG(CAM_ICP, "received ASYNC_INDIRECT_ACK");
rc = cam_icp_mgr_process_indirect_ack_msg(msg_ptr); rc = cam_icp_mgr_process_indirect_ack_msg(msg_ptr);
size_processed = ( size_processed = (
(struct hfi_msg_ipebps_async_ack *)msg_ptr)->size; (struct hfi_msg_dev_async_ack *)msg_ptr)->size;
break; break;
case HFI_MSG_IPEBPS_ASYNC_COMMAND_DIRECT_ACK: case HFI_MSG_IPEBPS_ASYNC_COMMAND_DIRECT_ACK:
CAM_DBG(CAM_ICP, "received ASYNC_DIRECT_ACK"); CAM_DBG(CAM_ICP, "received ASYNC_DIRECT_ACK");
rc = cam_icp_mgr_process_direct_ack_msg(msg_ptr); rc = cam_icp_mgr_process_direct_ack_msg(msg_ptr);
size_processed = ( size_processed = (
(struct hfi_msg_ipebps_async_ack *)msg_ptr)->size; (struct hfi_msg_dev_async_ack *)msg_ptr)->size;
break; break;
case HFI_MSG_EVENT_NOTIFY: case HFI_MSG_EVENT_NOTIFY:
@@ -3519,7 +3519,7 @@ static int cam_icp_mgr_send_pc_prep(struct cam_icp_hw_mgr *hw_mgr)
return rc; return rc;
} }
static int cam_ipe_bps_deint(struct cam_icp_hw_mgr *hw_mgr) static int cam_icp_device_deint(struct cam_icp_hw_mgr *hw_mgr)
{ {
struct cam_hw_intf *ipe0_dev_intf = NULL; struct cam_hw_intf *ipe0_dev_intf = NULL;
struct cam_hw_intf *ipe1_dev_intf = NULL; struct cam_hw_intf *ipe1_dev_intf = NULL;
@@ -3821,7 +3821,7 @@ static int cam_icp_mgr_abort_handle_wq(
size_t packet_size; size_t packet_size;
struct hfi_cmd_work_data *task_data = NULL; struct hfi_cmd_work_data *task_data = NULL;
struct cam_icp_hw_ctx_data *ctx_data; struct cam_icp_hw_ctx_data *ctx_data;
struct hfi_cmd_ipebps_async *abort_cmd; struct hfi_cmd_dev_async *abort_cmd;
if (!data || !priv) { if (!data || !priv) {
CAM_ERR(CAM_ICP, "Invalid params %pK %pK", data, priv); CAM_ERR(CAM_ICP, "Invalid params %pK %pK", data, priv);
@@ -3832,9 +3832,9 @@ static int cam_icp_mgr_abort_handle_wq(
ctx_data = ctx_data =
(struct cam_icp_hw_ctx_data *)task_data->data; (struct cam_icp_hw_ctx_data *)task_data->data;
packet_size = packet_size =
sizeof(struct hfi_cmd_ipebps_async) + sizeof(struct hfi_cmd_dev_async) +
sizeof(struct hfi_cmd_abort) - sizeof(struct hfi_cmd_abort) -
sizeof(((struct hfi_cmd_ipebps_async *)0)->payload.direct); sizeof(((struct hfi_cmd_dev_async *)0)->payload.direct);
abort_cmd = kzalloc(packet_size, GFP_KERNEL); abort_cmd = kzalloc(packet_size, GFP_KERNEL);
CAM_DBG(CAM_ICP, "abort pkt size = %d", (int) packet_size); CAM_DBG(CAM_ICP, "abort pkt size = %d", (int) packet_size);
if (!abort_cmd) { if (!abort_cmd) {
@@ -3873,12 +3873,12 @@ static int cam_icp_mgr_abort_handle(
unsigned long rem_jiffies = 0; unsigned long rem_jiffies = 0;
size_t packet_size; size_t packet_size;
int timeout = 2000; int timeout = 2000;
struct hfi_cmd_ipebps_async *abort_cmd; struct hfi_cmd_dev_async *abort_cmd;
packet_size = packet_size =
sizeof(struct hfi_cmd_ipebps_async) + sizeof(struct hfi_cmd_dev_async) +
sizeof(struct hfi_cmd_abort) - sizeof(struct hfi_cmd_abort) -
sizeof(((struct hfi_cmd_ipebps_async *)0)->payload.direct); sizeof(((struct hfi_cmd_dev_async *)0)->payload.direct);
abort_cmd = kzalloc(packet_size, GFP_KERNEL); abort_cmd = kzalloc(packet_size, GFP_KERNEL);
CAM_DBG(CAM_ICP, "abort pkt size = %d", (int) packet_size); CAM_DBG(CAM_ICP, "abort pkt size = %d", (int) packet_size);
if (!abort_cmd) { if (!abort_cmd) {
@@ -3928,12 +3928,12 @@ static int cam_icp_mgr_destroy_handle(
int timeout = 1000; int timeout = 1000;
unsigned long rem_jiffies; unsigned long rem_jiffies;
size_t packet_size; size_t packet_size;
struct hfi_cmd_ipebps_async *destroy_cmd; struct hfi_cmd_dev_async *destroy_cmd;
packet_size = packet_size =
sizeof(struct hfi_cmd_ipebps_async) + sizeof(struct hfi_cmd_dev_async) +
sizeof(struct hfi_cmd_abort_destroy) - sizeof(struct hfi_cmd_abort_destroy) -
sizeof(((struct hfi_cmd_ipebps_async *)0)->payload.direct); sizeof(((struct hfi_cmd_dev_async *)0)->payload.direct);
destroy_cmd = kzalloc(packet_size, GFP_KERNEL); destroy_cmd = kzalloc(packet_size, GFP_KERNEL);
if (!destroy_cmd) { if (!destroy_cmd) {
rc = -ENOMEM; rc = -ENOMEM;
@@ -4003,7 +4003,7 @@ static int cam_icp_mgr_release_ctx(struct cam_icp_hw_mgr *hw_mgr, int ctx_id)
ctx_id, hw_mgr->ctx_data[ctx_id].state); ctx_id, hw_mgr->ctx_data[ctx_id].state);
return 0; return 0;
} }
cam_icp_mgr_ipe_bps_power_collapse(hw_mgr, cam_icp_mgr_dev_power_collapse(hw_mgr,
&hw_mgr->ctx_data[ctx_id], 0); &hw_mgr->ctx_data[ctx_id], 0);
hw_mgr->ctx_data[ctx_id].state = CAM_ICP_CTX_STATE_RELEASE; hw_mgr->ctx_data[ctx_id].state = CAM_ICP_CTX_STATE_RELEASE;
CAM_DBG(CAM_ICP, "E: ctx_id = %d recovery = %d", CAM_DBG(CAM_ICP, "E: ctx_id = %d recovery = %d",
@@ -4069,7 +4069,7 @@ static unsigned long cam_icp_hw_mgr_mini_dump_cb(void *dst, unsigned long len)
md->ipe1_enable = hw_mgr->ipe1_enable; md->ipe1_enable = hw_mgr->ipe1_enable;
md->bps_enable = hw_mgr->bps_enable; md->bps_enable = hw_mgr->bps_enable;
md->icp_pc_flag = hw_mgr->icp_pc_flag; md->icp_pc_flag = hw_mgr->icp_pc_flag;
md->ipe_bps_pc_flag = hw_mgr->ipe_bps_pc_flag; md->dev_pc_flag = hw_mgr->dev_pc_flag;
md->icp_use_pil = hw_mgr->icp_use_pil; md->icp_use_pil = hw_mgr->icp_use_pil;
dumped_len += sizeof(*md); dumped_len += sizeof(*md);
remain_len = len - dumped_len; remain_len = len - dumped_len;
@@ -4537,7 +4537,7 @@ static int cam_icp_mgr_hw_open(void *hw_mgr_priv, void *download_fw_args)
CAM_INFO(CAM_ICP, "FW download done successfully"); CAM_INFO(CAM_ICP, "FW download done successfully");
rc = cam_ipe_bps_deint(hw_mgr); rc = cam_icp_device_deint(hw_mgr);
if (rc) if (rc)
CAM_ERR(CAM_ICP, "Failed in ipe bps deinit rc %d", rc); CAM_ERR(CAM_ICP, "Failed in ipe bps deinit rc %d", rc);
@@ -4545,7 +4545,7 @@ static int cam_icp_mgr_hw_open(void *hw_mgr_priv, void *download_fw_args)
icp_pc = *((bool *)download_fw_args); icp_pc = *((bool *)download_fw_args);
if (download_fw_args && icp_pc == true && hw_mgr->icp_pc_flag) { if (download_fw_args && icp_pc == true && hw_mgr->icp_pc_flag) {
rc = cam_ipe_bps_deint(hw_mgr); rc = cam_icp_device_deint(hw_mgr);
if (rc) if (rc)
CAM_ERR(CAM_ICP, "Failed in ipe bps deinit with icp_pc rc %d", rc); CAM_ERR(CAM_ICP, "Failed in ipe bps deinit with icp_pc rc %d", rc);
@@ -4555,7 +4555,7 @@ static int cam_icp_mgr_hw_open(void *hw_mgr_priv, void *download_fw_args)
if (download_fw_args && icp_pc == true) if (download_fw_args && icp_pc == true)
return rc; return rc;
rc = cam_ipe_bps_deint(hw_mgr); rc = cam_icp_device_deint(hw_mgr);
if (rc) if (rc)
CAM_ERR(CAM_ICP, "Failed in ipe bps deinit rc %d", rc); CAM_ERR(CAM_ICP, "Failed in ipe bps deinit rc %d", rc);
@@ -4608,7 +4608,7 @@ static int cam_icp_mgr_enqueue_config(struct cam_icp_hw_mgr *hw_mgr,
uint64_t request_id = 0; uint64_t request_id = 0;
struct crm_workq_task *task; struct crm_workq_task *task;
struct hfi_cmd_work_data *task_data; struct hfi_cmd_work_data *task_data;
struct hfi_cmd_ipebps_async *hfi_cmd; struct hfi_cmd_dev_async *hfi_cmd;
struct cam_hw_update_entry *hw_update_entries; struct cam_hw_update_entry *hw_update_entries;
struct icp_frame_info *frame_info = NULL; struct icp_frame_info *frame_info = NULL;
@@ -4625,7 +4625,7 @@ static int cam_icp_mgr_enqueue_config(struct cam_icp_hw_mgr *hw_mgr,
task_data = (struct hfi_cmd_work_data *)task->payload; task_data = (struct hfi_cmd_work_data *)task->payload;
task_data->data = (void *)hw_update_entries->addr; task_data->data = (void *)hw_update_entries->addr;
hfi_cmd = (struct hfi_cmd_ipebps_async *)hw_update_entries->addr; hfi_cmd = (struct hfi_cmd_dev_async *)hw_update_entries->addr;
task_data->request_id = request_id; task_data->request_id = request_id;
task_data->type = ICP_WORKQ_TASK_CMD_TYPE; task_data->type = ICP_WORKQ_TASK_CMD_TYPE;
task->process_cb = cam_icp_mgr_process_cmd; task->process_cb = cam_icp_mgr_process_cmd;
@@ -4640,7 +4640,7 @@ static int cam_icp_mgr_send_config_io(struct cam_icp_hw_ctx_data *ctx_data,
{ {
int rc = 0; int rc = 0;
struct hfi_cmd_work_data *task_data; struct hfi_cmd_work_data *task_data;
struct hfi_cmd_ipebps_async ioconfig_cmd; struct hfi_cmd_dev_async ioconfig_cmd;
unsigned long rem_jiffies; unsigned long rem_jiffies;
int timeout = 5000; int timeout = 5000;
struct crm_workq_task *task; struct crm_workq_task *task;
@@ -4656,7 +4656,7 @@ static int cam_icp_mgr_send_config_io(struct cam_icp_hw_ctx_data *ctx_data,
return -ENOMEM; return -ENOMEM;
} }
ioconfig_cmd.size = sizeof(struct hfi_cmd_ipebps_async); ioconfig_cmd.size = sizeof(struct hfi_cmd_dev_async);
ioconfig_cmd.pkt_type = HFI_CMD_IPEBPS_ASYNC_COMMAND_INDIRECT; ioconfig_cmd.pkt_type = HFI_CMD_IPEBPS_ASYNC_COMMAND_INDIRECT;
if (ctx_data->unified_dev_type == CAM_ICP_RES_TYPE_BPS) if (ctx_data->unified_dev_type == CAM_ICP_RES_TYPE_BPS)
ioconfig_cmd.opcode = HFI_IPEBPS_CMD_OPCODE_BPS_CONFIG_IO; ioconfig_cmd.opcode = HFI_IPEBPS_CMD_OPCODE_BPS_CONFIG_IO;
@@ -4703,7 +4703,7 @@ static int cam_icp_mgr_send_config_io(struct cam_icp_hw_ctx_data *ctx_data,
} }
static int cam_icp_mgr_send_recfg_io(struct cam_icp_hw_ctx_data *ctx_data, static int cam_icp_mgr_send_recfg_io(struct cam_icp_hw_ctx_data *ctx_data,
struct hfi_cmd_ipebps_async *ioconfig_cmd, uint64_t req_id) struct hfi_cmd_dev_async *ioconfig_cmd, uint64_t req_id)
{ {
int rc = 0; int rc = 0;
struct hfi_cmd_work_data *task_data; struct hfi_cmd_work_data *task_data;
@@ -4780,7 +4780,7 @@ static int cam_icp_mgr_config_hw(void *hw_mgr_priv, void *config_hw_args)
hw_mgr->iommu_hdl); hw_mgr->iommu_hdl);
} }
cam_icp_mgr_ipe_bps_clk_update(hw_mgr, ctx_data, idx); cam_icp_mgr_dev_clk_update(hw_mgr, ctx_data, idx);
ctx_data->hfi_frame_process.fw_process_flag[idx] = true; ctx_data->hfi_frame_process.fw_process_flag[idx] = true;
ctx_data->hfi_frame_process.submit_timestamp[idx] = ktime_get(); ctx_data->hfi_frame_process.submit_timestamp[idx] = ktime_get();
@@ -4822,11 +4822,11 @@ config_err:
static int cam_icp_mgr_prepare_frame_process_cmd( static int cam_icp_mgr_prepare_frame_process_cmd(
struct cam_icp_hw_ctx_data *ctx_data, struct cam_icp_hw_ctx_data *ctx_data,
struct hfi_cmd_ipebps_async *hfi_cmd, struct hfi_cmd_dev_async *hfi_cmd,
uint64_t request_id, uint64_t request_id,
uint32_t fw_cmd_buf_iova_addr) uint32_t fw_cmd_buf_iova_addr)
{ {
hfi_cmd->size = sizeof(struct hfi_cmd_ipebps_async); hfi_cmd->size = sizeof(struct hfi_cmd_dev_async);
hfi_cmd->pkt_type = HFI_CMD_IPEBPS_ASYNC_COMMAND_INDIRECT; hfi_cmd->pkt_type = HFI_CMD_IPEBPS_ASYNC_COMMAND_INDIRECT;
if (ctx_data->unified_dev_type == CAM_ICP_RES_TYPE_BPS) if (ctx_data->unified_dev_type == CAM_ICP_RES_TYPE_BPS)
hfi_cmd->opcode = HFI_IPEBPS_CMD_OPCODE_BPS_FRAME_PROCESS; hfi_cmd->opcode = HFI_IPEBPS_CMD_OPCODE_BPS_FRAME_PROCESS;
@@ -5093,7 +5093,7 @@ static int cam_icp_process_stream_settings(
unsigned long rem_jiffies; unsigned long rem_jiffies;
int timeout = 5000; int timeout = 5000;
struct hfi_cmd_ipe_bps_map *map_cmd; struct hfi_cmd_ipe_bps_map *map_cmd;
struct hfi_cmd_ipebps_async *async_direct; struct hfi_cmd_dev_async *async_direct;
map_cmd_size = map_cmd_size =
sizeof(struct hfi_cmd_ipe_bps_map) + sizeof(struct hfi_cmd_ipe_bps_map) +
@@ -5130,11 +5130,11 @@ static int cam_icp_process_stream_settings(
map_cmd->user_data = 0; map_cmd->user_data = 0;
packet_size = packet_size =
sizeof(struct hfi_cmd_ipebps_async) + sizeof(struct hfi_cmd_dev_async) +
(sizeof(struct hfi_cmd_ipe_bps_map) + (sizeof(struct hfi_cmd_ipe_bps_map) +
((cmd_mem_regions->num_regions - 1) * ((cmd_mem_regions->num_regions - 1) *
sizeof(struct mem_map_region_data))) - sizeof(struct mem_map_region_data))) -
sizeof(((struct hfi_cmd_ipebps_async *)0)->payload.direct); sizeof(((struct hfi_cmd_dev_async *)0)->payload.direct);
async_direct = kzalloc(packet_size, GFP_KERNEL); async_direct = kzalloc(packet_size, GFP_KERNEL);
if (!async_direct) { if (!async_direct) {
@@ -5486,11 +5486,11 @@ static int cam_icp_process_generic_cmd_buffer(
static int cam_icp_mgr_process_cfg_io_cmd( static int cam_icp_mgr_process_cfg_io_cmd(
struct cam_icp_hw_ctx_data *ctx_data, struct cam_icp_hw_ctx_data *ctx_data,
struct hfi_cmd_ipebps_async *ioconfig_cmd, struct hfi_cmd_dev_async *ioconfig_cmd,
uint64_t request_id, uint64_t request_id,
uint64_t io_config) uint64_t io_config)
{ {
ioconfig_cmd->size = sizeof(struct hfi_cmd_ipebps_async); ioconfig_cmd->size = sizeof(struct hfi_cmd_dev_async);
ioconfig_cmd->pkt_type = HFI_CMD_IPEBPS_ASYNC_COMMAND_INDIRECT; ioconfig_cmd->pkt_type = HFI_CMD_IPEBPS_ASYNC_COMMAND_INDIRECT;
if (ctx_data->unified_dev_type == CAM_ICP_RES_TYPE_BPS) if (ctx_data->unified_dev_type == CAM_ICP_RES_TYPE_BPS)
ioconfig_cmd->opcode = HFI_IPEBPS_CMD_OPCODE_BPS_CONFIG_IO; ioconfig_cmd->opcode = HFI_IPEBPS_CMD_OPCODE_BPS_CONFIG_IO;
@@ -5513,7 +5513,7 @@ static int cam_icp_mgr_update_hfi_frame_process(
int32_t *idx) int32_t *idx)
{ {
int32_t index, rc; int32_t index, rc;
struct hfi_cmd_ipebps_async *hfi_cmd = NULL; struct hfi_cmd_dev_async *hfi_cmd = NULL;
index = find_first_zero_bit(ctx_data->hfi_frame_process.bitmap, index = find_first_zero_bit(ctx_data->hfi_frame_process.bitmap,
ctx_data->hfi_frame_process.bits); ctx_data->hfi_frame_process.bits);
@@ -5538,7 +5538,7 @@ static int cam_icp_mgr_update_hfi_frame_process(
} }
if (ctx_data->hfi_frame_process.frame_info[index].io_config) { if (ctx_data->hfi_frame_process.frame_info[index].io_config) {
hfi_cmd = (struct hfi_cmd_ipebps_async *) hfi_cmd = (struct hfi_cmd_dev_async *)
&ctx_data->hfi_frame_process.frame_info[index].hfi_cfg_io_cmd; &ctx_data->hfi_frame_process.frame_info[index].hfi_cfg_io_cmd;
rc = cam_icp_mgr_process_cfg_io_cmd(ctx_data, hfi_cmd, rc = cam_icp_mgr_process_cfg_io_cmd(ctx_data, hfi_cmd,
packet->header.request_id, packet->header.request_id,
@@ -5603,7 +5603,7 @@ static int cam_icp_mgr_prepare_hw_update(void *hw_mgr_priv,
uint32_t fw_cmd_buf_iova_addr; uint32_t fw_cmd_buf_iova_addr;
struct cam_icp_hw_ctx_data *ctx_data = NULL; struct cam_icp_hw_ctx_data *ctx_data = NULL;
struct cam_packet *packet = NULL; struct cam_packet *packet = NULL;
struct hfi_cmd_ipebps_async *hfi_cmd = NULL; struct hfi_cmd_dev_async *hfi_cmd = NULL;
struct cam_icp_hw_mgr *hw_mgr = hw_mgr_priv; struct cam_icp_hw_mgr *hw_mgr = hw_mgr_priv;
struct cam_hw_prepare_update_args *prepare_args = struct cam_hw_prepare_update_args *prepare_args =
prepare_hw_update_args; prepare_hw_update_args;
@@ -5669,7 +5669,7 @@ static int cam_icp_mgr_prepare_hw_update(void *hw_mgr_priv,
return rc; return rc;
} }
hfi_cmd = (struct hfi_cmd_ipebps_async *) hfi_cmd = (struct hfi_cmd_dev_async *)
&ctx_data->hfi_frame_process.hfi_frame_cmd[idx]; &ctx_data->hfi_frame_process.hfi_frame_cmd[idx];
cam_icp_mgr_prepare_frame_process_cmd( cam_icp_mgr_prepare_frame_process_cmd(
ctx_data, hfi_cmd, packet->header.request_id, ctx_data, hfi_cmd, packet->header.request_id,
@@ -6019,7 +6019,7 @@ hw_dump:
*mgr_addr++ = icp_mgr->ipe1_enable; *mgr_addr++ = icp_mgr->ipe1_enable;
*mgr_addr++ = icp_mgr->bps_enable; *mgr_addr++ = icp_mgr->bps_enable;
*mgr_addr++ = icp_mgr->icp_pc_flag; *mgr_addr++ = icp_mgr->icp_pc_flag;
*mgr_addr++ = icp_mgr->ipe_bps_pc_flag; *mgr_addr++ = icp_mgr->dev_pc_flag;
*mgr_addr++ = icp_mgr->icp_use_pil; *mgr_addr++ = icp_mgr->icp_use_pil;
hdr->size = hdr->word_size * (mgr_addr - mgr_start); hdr->size = hdr->word_size * (mgr_addr - mgr_start);
dump_args->offset += (hdr->size + sizeof(struct cam_icp_dump_header)); dump_args->offset += (hdr->size + sizeof(struct cam_icp_dump_header));
@@ -6166,7 +6166,7 @@ static int cam_icp_mgr_release_hw(void *hw_mgr_priv, void *release_hw_args)
CAM_DBG(CAM_ICP, "Last Release"); CAM_DBG(CAM_ICP, "Last Release");
cam_icp_mgr_icp_power_collapse(hw_mgr); cam_icp_mgr_icp_power_collapse(hw_mgr);
cam_icp_hw_mgr_reset_clk_info(hw_mgr); cam_icp_hw_mgr_reset_clk_info(hw_mgr);
rc = cam_ipe_bps_deint(hw_mgr); rc = cam_icp_device_deint(hw_mgr);
} }
if ((!hw_mgr->bps_ctxt_cnt || !hw_mgr->ipe_ctxt_cnt)) if ((!hw_mgr->bps_ctxt_cnt || !hw_mgr->ipe_ctxt_cnt))
@@ -6441,9 +6441,9 @@ static int cam_icp_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
} }
rc = cam_icp_mgr_ipe_bps_resume(hw_mgr, ctx_data); rc = cam_icp_mgr_device_resume(hw_mgr, ctx_data);
if (rc) if (rc)
goto ipe_bps_resume_failed; goto icp_dev_resume_failed;
rc = cam_icp_mgr_send_ping(ctx_data); rc = cam_icp_mgr_send_ping(ctx_data);
if (rc) { if (rc) {
@@ -6597,8 +6597,8 @@ send_map_info_failed:
cam_icp_mgr_destroy_handle(ctx_data); cam_icp_mgr_destroy_handle(ctx_data);
create_handle_failed: create_handle_failed:
send_ping_failed: send_ping_failed:
cam_icp_mgr_ipe_bps_power_collapse(hw_mgr, ctx_data, 0); cam_icp_mgr_dev_power_collapse(hw_mgr, ctx_data, 0);
ipe_bps_resume_failed: icp_dev_resume_failed:
ubwc_cfg_failed: ubwc_cfg_failed:
if (!hw_mgr->ctxt_cnt) if (!hw_mgr->ctxt_cnt)
cam_icp_mgr_icp_power_collapse(hw_mgr); cam_icp_mgr_icp_power_collapse(hw_mgr);
@@ -6698,7 +6698,7 @@ static int cam_icp_mgr_alloc_devs(struct device_node *np)
icp_hw_mgr.devices[CAM_ICP_DEV_BPS] = devices; icp_hw_mgr.devices[CAM_ICP_DEV_BPS] = devices;
icp_hw_mgr.ipe_bps_pc_flag = of_property_read_bool(np, "ipe_bps_pc_en"); icp_hw_mgr.dev_pc_flag = of_property_read_bool(np, "ipe_bps_pc_en");
icp_hw_mgr.icp_pc_flag = of_property_read_bool(np, "icp_pc_en"); icp_hw_mgr.icp_pc_flag = of_property_read_bool(np, "icp_pc_en");
icp_hw_mgr.icp_use_pil = of_property_read_bool(np, "icp_use_pil"); icp_hw_mgr.icp_use_pil = of_property_read_bool(np, "icp_use_pil");

View File

@@ -151,7 +151,7 @@ struct clk_work_data {
struct icp_frame_info { struct icp_frame_info {
uint64_t request_id; uint64_t request_id;
dma_addr_t io_config; dma_addr_t io_config;
struct hfi_cmd_ipebps_async hfi_cfg_io_cmd; struct hfi_cmd_dev_async hfi_cfg_io_cmd;
struct cam_packet *pkt; struct cam_packet *pkt;
}; };
@@ -218,7 +218,7 @@ struct cam_icp_ctx_perf_stats {
* @hangdump_mem_regions: Mem regions for hangdump * @hangdump_mem_regions: Mem regions for hangdump
*/ */
struct hfi_frame_process_info { struct hfi_frame_process_info {
struct hfi_cmd_ipebps_async hfi_frame_cmd[CAM_FRAME_CMD_MAX]; struct hfi_cmd_dev_async hfi_frame_cmd[CAM_FRAME_CMD_MAX];
void *bitmap; void *bitmap;
size_t bits; size_t bits;
struct mutex lock; struct mutex lock;
@@ -302,7 +302,7 @@ struct cam_icp_hw_ctx_data {
struct cam_icp_hw_ctx_data *chain_ctx; struct cam_icp_hw_ctx_data *chain_ctx;
struct hfi_frame_process_info hfi_frame_process; struct hfi_frame_process_info hfi_frame_process;
struct completion wait_complete; struct completion wait_complete;
struct ipe_bps_destroy temp_payload; struct icp_dev_destroy temp_payload;
uint32_t ctx_id; uint32_t ctx_id;
uint32_t bw_config_version; uint32_t bw_config_version;
struct cam_ctx_clk_info clk_info; struct cam_ctx_clk_info clk_info;
@@ -386,7 +386,7 @@ struct cam_icp_clk_info {
* @bps_ctxt_cnt: BPS Active context count * @bps_ctxt_cnt: BPS Active context count
* @dentry: Debugfs entry * @dentry: Debugfs entry
* @icp_pc_flag: Flag to enable/disable power collapse * @icp_pc_flag: Flag to enable/disable power collapse
* @ipe_bps_pc_flag: Flag to enable/disable * @dev_pc_flag: Flag to enable/disable
* power collapse for ipe & bps * power collapse for ipe & bps
* @icp_use_pil: Flag to indicate usage of PIL framework * @icp_use_pil: Flag to indicate usage of PIL framework
* @icp_debug_clk: Set clock based on debug value * @icp_debug_clk: Set clock based on debug value
@@ -441,7 +441,7 @@ struct cam_icp_hw_mgr {
uint32_t bps_ctxt_cnt; uint32_t bps_ctxt_cnt;
struct dentry *dentry; struct dentry *dentry;
bool icp_pc_flag; bool icp_pc_flag;
bool ipe_bps_pc_flag; bool dev_pc_flag;
bool icp_use_pil; bool icp_use_pil;
uint64_t icp_debug_clk; uint64_t icp_debug_clk;
uint64_t icp_default_clk; uint64_t icp_default_clk;
@@ -537,7 +537,7 @@ struct cam_icp_hw_ctx_mini_dump {
* @ipe1_enable: Is IPE1 enabled * @ipe1_enable: Is IPE1 enabled
* @bps_enable: Is BPS enabled * @bps_enable: Is BPS enabled
* @icp_pc_flag: Is ICP PC enabled * @icp_pc_flag: Is ICP PC enabled
* @ipe_bps_pc_flag: Is IPE BPS PC enabled * @dev_pc_flag: Is IPE BPS PC enabled
* @icp_use_pil: Is PIL used * @icp_use_pil: Is PIL used
*/ */
struct cam_icp_hw_mini_dump_info { struct cam_icp_hw_mini_dump_info {
@@ -556,7 +556,7 @@ struct cam_icp_hw_mini_dump_info {
bool ipe1_enable; bool ipe1_enable;
bool bps_enable; bool bps_enable;
bool icp_pc_flag; bool icp_pc_flag;
bool ipe_bps_pc_flag; bool dev_pc_flag;
bool icp_use_pil; bool icp_use_pil;
}; };

View File

@@ -84,15 +84,15 @@ struct cam_icp_boot_args {
* struct cam_icp_clk_update_cmd - Payload for hw manager command * struct cam_icp_clk_update_cmd - Payload for hw manager command
* *
* @curr_clk_rate: clk rate to HW * @curr_clk_rate: clk rate to HW
* @ipe_bps_pc_enable power collpase enable flag
* @clk_level: clk level corresponding to the clk rate * @clk_level: clk level corresponding to the clk rate
* populated as output while the clk is being * populated as output while the clk is being
* updated to the given rate * updated to the given rate
* @dev_pc_enable: power collpase enable flag
*/ */
struct cam_icp_clk_update_cmd { struct cam_icp_clk_update_cmd {
uint32_t curr_clk_rate; uint32_t curr_clk_rate;
bool ipe_bps_pc_enable;
int32_t clk_level; int32_t clk_level;
bool dev_pc_enable;
}; };
#endif #endif

View File

@@ -420,7 +420,7 @@ int cam_ipe_process_cmd(void *device_priv, uint32_t cmd_type,
CAM_DBG(CAM_PERF, "ipe_src_clk rate = %d", (int)clk_rate); CAM_DBG(CAM_PERF, "ipe_src_clk rate = %d", (int)clk_rate);
if (!core_info->clk_enable) { if (!core_info->clk_enable) {
if (clk_upd_cmd->ipe_bps_pc_enable) { if (clk_upd_cmd->dev_pc_enable) {
cam_ipe_handle_pc(ipe_dev); cam_ipe_handle_pc(ipe_dev);
cam_cpas_reg_write(core_info->cpas_handle, cam_cpas_reg_write(core_info->cpas_handle,
CAM_CPAS_REG_CPASTOP, CAM_CPAS_REG_CPASTOP,
@@ -431,7 +431,7 @@ int cam_ipe_process_cmd(void *device_priv, uint32_t cmd_type,
CAM_ERR(CAM_ICP, "Enable failed"); CAM_ERR(CAM_ICP, "Enable failed");
else else
core_info->clk_enable = true; core_info->clk_enable = true;
if (clk_upd_cmd->ipe_bps_pc_enable) { if (clk_upd_cmd->dev_pc_enable) {
rc = cam_ipe_handle_resume(ipe_dev); rc = cam_ipe_handle_resume(ipe_dev);
if (rc) if (rc)
CAM_ERR(CAM_ICP, "bps resume failed"); CAM_ERR(CAM_ICP, "bps resume failed");