ソースを参照

msm: camera: icp: Remove Unnecessary Structure Fields

Remove unnecessary fields in ICP hw mgr structure to reduce
the size of icp hw mgr structure.

CRs-Fixed: 3446300
Change-Id: I7c11487d559ce91d7d1cc016f8235aa9de38035c
Signed-off-by: Sokchetra Eung <[email protected]>
Sokchetra Eung 2 年 前
コミット
6dcee46d95

+ 4 - 3
drivers/cam_core/cam_context_utils.c

@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/debugfs.h>
@@ -728,8 +728,9 @@ int32_t cam_context_acquire_dev_to_hw(struct cam_context *ctx,
 	rc = ctx->hw_mgr_intf->hw_acquire(ctx->hw_mgr_intf->hw_mgr_priv,
 		&param);
 	if (rc != 0) {
-		CAM_ERR(CAM_CTXT, "[%s][%d] Acquire device failed",
-			ctx->dev_name, ctx->ctx_id);
+		CAM_ERR(CAM_CTXT,
+			"[%s][%d] Acquire device failed session hdl: 0x%x dev hdl: 0x%x",
+			ctx->dev_name, ctx->ctx_id, ctx->session_hdl, ctx->dev_hdl);
 		goto end;
 	}
 

+ 11 - 28
drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c

@@ -4318,9 +4318,6 @@ static int cam_icp_mgr_destroy_handle(
 	destroy_cmd->fw_handles[0] = ctx_data->fw_handle;
 	destroy_cmd->user_data1 = PTR_TO_U64(ctx_data);
 	destroy_cmd->user_data2 = (uint64_t)0x0;
-	if (opcode == HFI_CMD_IPEBPS_ASYNC_COMMAND_DIRECT)
-		memcpy(destroy_cmd->payload.direct, &ctx_data->temp_payload,
-			sizeof(uint64_t));
 
 	reinit_completion(&ctx_data->wait_complete);
 
@@ -4996,11 +4993,7 @@ static int cam_icp_mgr_send_config_io(struct cam_icp_hw_ctx_data *ctx_data,
 
 	task = cam_req_mgr_workq_get_task(hw_mgr->cmd_work);
 	if (!task) {
-		CAM_ERR_RATE_LIMIT(CAM_ICP,
-			"%s: No free task Dev hdl:0x%x session hdl:0x%x dev_type:%d",
-			ctx_data->ctx_id_string, ctx_data->acquire_dev_cmd.dev_handle,
-			ctx_data->acquire_dev_cmd.session_handle,
-			ctx_data->icp_dev_acquire_info->dev_type);
+		CAM_ERR_RATE_LIMIT(CAM_ICP, "%s: No free cmd task", ctx_data->ctx_id_string);
 		return -ENOMEM;
 	}
 
@@ -5042,11 +5035,8 @@ static int cam_icp_mgr_send_config_io(struct cam_icp_hw_ctx_data *ctx_data,
 	rc = cam_req_mgr_workq_enqueue_task(task, hw_mgr,
 		CRM_TASK_PRIORITY_0);
 	if (rc) {
-		CAM_ERR_RATE_LIMIT(CAM_ICP,
-			"%s: Enqueue task failed dev hdl:0x%x session hdl:0x%x dev_type:%d",
-			ctx_data->ctx_id_string, ctx_data->acquire_dev_cmd.dev_handle,
-			ctx_data->acquire_dev_cmd.session_handle,
-			ctx_data->icp_dev_acquire_info->dev_type);
+		CAM_ERR_RATE_LIMIT(CAM_ICP, "%s: Failed to enqueue io config task",
+			ctx_data->ctx_id_string);
 		return rc;
 	}
 
@@ -5643,6 +5633,7 @@ static int cam_icp_packet_generic_blob_handler(void *user_data,
 	struct icp_cmd_generic_blob *blob;
 	struct cam_icp_hw_ctx_data *ctx_data;
 	struct cam_icp_hw_mgr *hw_mgr;
+	struct cam_icp_acquire_dev_info dev_io_info;
 	uint32_t index;
 	size_t io_buf_size, clk_update_size;
 	int rc = 0;
@@ -5788,18 +5779,15 @@ static int cam_icp_packet_generic_blob_handler(void *user_data,
 	case CAM_ICP_CMD_GENERIC_BLOB_CFG_IO:
 		CAM_DBG(CAM_ICP, "%s: CAM_ICP_CMD_GENERIC_BLOB_CFG_IO", ctx_data->ctx_id_string);
 		pResource = *((uint32_t *)blob_data);
-		if (copy_from_user(&ctx_data->icp_dev_io_info,
+		if (copy_from_user(&dev_io_info,
 			(void __user *)pResource,
 			sizeof(struct cam_icp_acquire_dev_info))) {
 			CAM_ERR(CAM_ICP, "%s: Failed in copy from user", ctx_data->ctx_id_string);
 			return -EFAULT;
 		}
-		CAM_DBG(CAM_ICP, "%s: buf handle %d",
-			ctx_data->ctx_id_string,
-			ctx_data->icp_dev_io_info.io_config_cmd_handle);
-		rc = cam_mem_get_io_buf(
-			ctx_data->icp_dev_io_info.io_config_cmd_handle,
-			hw_mgr->iommu_hdl,
+		CAM_DBG(CAM_ICP, "%s: buf handle %d", ctx_data->ctx_id_string,
+			dev_io_info.io_config_cmd_handle);
+		rc = cam_mem_get_io_buf(dev_io_info.io_config_cmd_handle, hw_mgr->iommu_hdl,
 			blob->io_buf_addr, &io_buf_size, NULL);
 		if (rc)
 			CAM_ERR(CAM_ICP, "%s: Failed in blob update", ctx_data->ctx_id_string);
@@ -7030,10 +7018,8 @@ static int cam_icp_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
 			kzalloc(bitmap_size, GFP_KERNEL);
 	if (!ctx_data->hfi_frame_process.bitmap) {
 		CAM_ERR_RATE_LIMIT(CAM_ICP,
-			"%s: hfi frame bitmap failed dev hdl:0x%x session hdl:0x%x dev type %d",
-			ctx_data->ctx_id_string, ctx_data->acquire_dev_cmd.dev_handle,
-			ctx_data->acquire_dev_cmd.session_handle,
-			ctx_data->icp_dev_acquire_info->dev_type);
+			"%s: failed to allocate hfi frame bitmap", ctx_data->ctx_id_string);
+			rc = -ENOMEM;
 		goto ioconfig_failed;
 	}
 
@@ -7048,10 +7034,7 @@ static int cam_icp_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
 		icp_dev_acquire_info,
 		sizeof(struct cam_icp_acquire_dev_info))) {
 		CAM_ERR_RATE_LIMIT(CAM_ICP,
-			"%s: copy from user failed dev hdl:0x%x session hdl:0x%x dev type %d",
-			ctx_data->ctx_id_string, ctx_data->acquire_dev_cmd.dev_handle,
-			ctx_data->acquire_dev_cmd.session_handle,
-			ctx_data->icp_dev_acquire_info->dev_type);
+			"%s: copy from user failed", ctx_data->ctx_id_string);
 		goto copy_to_user_failed;
 	}
 

+ 1 - 7
drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.h

@@ -263,7 +263,7 @@ struct hfi_frame_process_info {
 	uint32_t out_resource[CAM_FRAME_CMD_MAX][CAM_MAX_OUT_RES];
 	uint32_t in_resource[CAM_FRAME_CMD_MAX];
 	uint32_t in_free_resource[CAM_FRAME_CMD_MAX];
-	uint32_t fw_process_flag[CAM_FRAME_CMD_MAX];
+	bool fw_process_flag[CAM_FRAME_CMD_MAX];
 	struct cam_icp_clk_bw_request clk_info[CAM_FRAME_CMD_MAX];
 	struct cam_icp_clk_bw_req_internal_v2 clk_info_v2[CAM_FRAME_CMD_MAX];
 	struct icp_frame_info frame_info[CAM_FRAME_CMD_MAX];
@@ -304,7 +304,6 @@ struct cam_ctx_clk_info {
  * @ctx_mutex: Mutex for context
  * @fw_handle: Firmware handle
  * @scratch_mem_size: Scratch memory size
- * @acquire_dev_cmd: Acquire command
  * @icp_dev_acquire_info: Acquire device info
  * @ctxt_event_cb: Context callback function
  * @state: context state
@@ -312,13 +311,11 @@ struct cam_ctx_clk_info {
  * @chain_ctx: Peer context
  * @hfi_frame_process: Frame process command
  * @wait_complete: Completion info
- * @temp_payload: Payload for destroy handle data
  * @ctx_id: Context Id
  * @bw_config_version: BW config version indicator
  * @clk_info: Current clock info of a context
  * @watch_dog: watchdog timer handle
  * @watch_dog_reset_counter: Counter for watch dog reset
- * @icp_dev_io_info: io config resource
  * @last_flush_req: last flush req for this ctx
  * @perf_stats: performance statistics info
  * @evt_inject_params: Event injection data for hw_mgr_ctx
@@ -332,7 +329,6 @@ struct cam_icp_hw_ctx_data {
 	struct mutex ctx_mutex;
 	uint32_t fw_handle;
 	uint32_t scratch_mem_size;
-	struct cam_acquire_dev_cmd acquire_dev_cmd;
 	struct cam_icp_acquire_dev_info *icp_dev_acquire_info;
 	cam_hw_event_cb_func ctxt_event_cb;
 	uint32_t state;
@@ -340,13 +336,11 @@ struct cam_icp_hw_ctx_data {
 	struct cam_icp_hw_ctx_data *chain_ctx;
 	struct hfi_frame_process_info hfi_frame_process;
 	struct completion wait_complete;
-	struct hfi_cmd_destroy temp_payload;
 	uint32_t ctx_id;
 	uint32_t bw_config_version;
 	struct cam_ctx_clk_info clk_info;
 	struct cam_req_mgr_timer *watch_dog;
 	uint32_t watch_dog_reset_counter;
-	struct cam_icp_acquire_dev_info icp_dev_io_info;
 	uint64_t last_flush_req;
 	char ctx_id_string[128];
 	struct cam_icp_ctx_perf_stats perf_stats;