From 6ceb84f1b7356d926aaffe309a6de51154b750ae Mon Sep 17 00:00:00 2001 From: Karthik Anantha Ram Date: Mon, 22 Jul 2019 10:36:56 -0700 Subject: [PATCH] msm: camera: icp: log cleanup and header update This change cleans up a few logs and updates the HFI headers in line with the current FW. CRs-Fixed: 2513094 Change-Id: I8853ac3711ad3bf36ce59f6860082fa29dca0bf6 Signed-off-by: Karthik Anantha Ram --- drivers/cam_icp/fw_inc/hfi_session_defs.h | 20 ++++++++++++++--- drivers/cam_icp/fw_inc/hfi_sys_defs.h | 15 +++++++++++++ .../icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c | 22 +++++++++++++------ 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/drivers/cam_icp/fw_inc/hfi_session_defs.h b/drivers/cam_icp/fw_inc/hfi_session_defs.h index e50b5d147a2f..9ba7803d4f44 100644 --- a/drivers/cam_icp/fw_inc/hfi_session_defs.h +++ b/drivers/cam_icp/fw_inc/hfi_session_defs.h @@ -1,6 +1,6 @@ /* 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_HFI_SESSION_DEFS_H @@ -272,10 +272,20 @@ enum hfi_ipe_io_images { IPE_OUTPUT_IMAGE_DS4_REF, IPE_OUTPUT_IMAGE_DS16_REF, IPE_OUTPUT_IMAGE_DS64_REF, + IPE_INPUT2_IMAGE_FULL, + IPE_INPUT2_IMAGE_DSX, + IPE_INPUT_OUTPUT_SCRATCHBUFFER, IPE_INPUT_IMAGE_FIRST = IPE_INPUT_IMAGE_FULL, IPE_INPUT_IMAGE_LAST = IPE_INPUT_IMAGE_DS64_REF, + IPE_INPUT_IMAGE_REF_FIRST = IPE_INPUT_IMAGE_FULL_REF, + IPE_INPUT_IMAGE_REF_LAST = IPE_INPUT_IMAGE_DS64_REF, IPE_OUTPUT_IMAGE_FIRST = IPE_OUTPUT_IMAGE_DISPLAY, IPE_OUTPUT_IMAGE_LAST = IPE_OUTPUT_IMAGE_DS64_REF, + IPE_OUTPUT_IMAGE_REF_FIRST = IPE_OUTPUT_IMAGE_FULL_REF, + IPE_OUTPUT_IMAGE_REF_LAST = IPE_OUTPUT_IMAGE_DS64_REF, + IPE_INPUT2_IMAGE_FIRST = IPE_INPUT2_IMAGE_FULL, + IPE_INPUT2_IMAGE_LAST = IPE_INPUT2_IMAGE_DSX, + IPE_INPUT_OUTPUT_IMAGE_LAST = IPE_INPUT_OUTPUT_SCRATCHBUFFER, IPE_IO_IMAGES_MAX }; @@ -300,7 +310,6 @@ struct frame_buffer { } __packed; struct bps_frame_process_data { - struct frame_buffer buffers[BPS_IO_IMAGES_MAX]; uint32_t max_num_cores; uint32_t target_time; uint32_t ubwc_stats_buffer_addr; @@ -311,6 +320,7 @@ struct bps_frame_process_data { uint32_t strip_lib_out_addr; uint32_t cdm_prog_addr; uint32_t request_id; + struct frame_buffer buffers[BPS_IO_IMAGES_MAX]; }; enum hfi_ipe_image_format { @@ -465,7 +475,6 @@ struct ica_stab_params { struct frame_set { struct frame_buffer buffers[IPE_IO_IMAGES_MAX]; - struct ica_stab_params ica_params; uint32_t cdm_ica1_addr; uint32_t cdm_ica2_addr; } __packed; @@ -492,6 +501,11 @@ struct ipe_frame_process_data { uint32_t cdm_tf_ds4; uint32_t cdm_tf_ds16; uint32_t cdm_tf_ds64; + uint32_t cdm_dsx_dc4; + uint32_t cdm_dsx_dc16; + uint32_t cdm_dsz_dc64; + uint32_t cdm_mfhdr_full_pass; + uint32_t cdm_mfhdr_dcx; uint32_t request_id; uint32_t frames_in_batch; struct frame_set framesets[MAX_HFR_GROUP]; diff --git a/drivers/cam_icp/fw_inc/hfi_sys_defs.h b/drivers/cam_icp/fw_inc/hfi_sys_defs.h index ddd9bf15c6aa..905b85a53633 100644 --- a/drivers/cam_icp/fw_inc/hfi_sys_defs.h +++ b/drivers/cam_icp/fw_inc/hfi_sys_defs.h @@ -67,6 +67,21 @@ #define HFI_CMD_SYS_PING (HFI_CMD_COMMON_START + 0x5) #define HFI_CMD_SYS_RESET (HFI_CMD_COMMON_START + 0x6) +/* General Frame process errors */ +#define CAMERAICP_SUCCESS 0 +#define CAMERAICP_EFAILED 1 +#define CAMERAICP_ENOMEMORY 2 +#define CAMERAICP_EBADSTATE 3 +#define CAMERAICP_EBADPARM 4 +#define CAMERAICP_EBADITEM 5 +#define CAMERAICP_EINVALIDFORMAT 6 +#define CAMERAICP_EUNSUPPORTED 7 +#define CAMERAICP_EOUTOFBOUND 8 +#define CAMERAICP_ETIMEDOUT 9 +#define CAMERAICP_EABORTED 10 +#define CAMERAICP_EHWVIOLATION 11 +#define CAMERAICP_ECDMERROR 12 + /* Core level commands */ /* IPE/BPS core Commands */ #define HFI_CMD_IPE_BPS_COMMON_START \ diff --git a/drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c b/drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c index 4da5c65412dc..c1ec110ea1d5 100644 --- a/drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c +++ b/drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c @@ -1943,10 +1943,20 @@ static int cam_icp_mgr_handle_frame_process(uint32_t *msg_ptr, int flag) } idx = i; - if (flag == ICP_FRAME_PROCESS_FAILURE) - CAM_ERR(CAM_ICP, "Done with error: ctx_id %d req %llu dev %d", - ctx_data->ctx_id, request_id, - ctx_data->icp_dev_acquire_info->dev_type); + if (flag == ICP_FRAME_PROCESS_FAILURE) { + if (ioconfig_ack->err_type == CAMERAICP_EABORTED) + CAM_WARN(CAM_ICP, + "ctx_id %d req %llu dev %d has been aborted[flushed]", + ctx_data->ctx_id, request_id, + ctx_data->icp_dev_acquire_info->dev_type); + else + CAM_ERR(CAM_ICP, + "Done with error: %u on ctx_id %d dev %d for req %llu", + ioconfig_ack->err_type, + ctx_data->ctx_id, + ctx_data->icp_dev_acquire_info->dev_type, + request_id); + } buf_data.request_id = hfi_frame_process->request_id[idx]; ctx_data->ctxt_event_cb(ctx_data->context_priv, flag, &buf_data); @@ -1975,9 +1985,7 @@ static int cam_icp_mgr_process_msg_frame_process(uint32_t *msg_ptr) } ioconfig_ack = (struct hfi_msg_ipebps_async_ack *)msg_ptr; - if (ioconfig_ack->err_type != HFI_ERR_SYS_NONE) { - CAM_ERR(CAM_ICP, "failed with error : %u", - ioconfig_ack->err_type); + if (ioconfig_ack->err_type != CAMERAICP_SUCCESS) { cam_icp_mgr_handle_frame_process(msg_ptr, ICP_FRAME_PROCESS_FAILURE); return -EIO;