aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVikram Sharma <vikramsa@codeaurora.org>2019-12-09 15:48:21 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2020-01-09 02:50:47 -0800
commitf609d3ff144d43013751abb9d27b060de4825e48 (patch)
treea07c8cf766ac45979b702c8b0a4d68868aa9be02
parent2c015401bec98ca7d6a7cfe3973280f29dbc593f (diff)
msm: camera: cam_icp: Update frame dump logic handling PFLA.UM.8.1.r1-13500-sm8150.0
While handling page fault in ICP we are dumping debug info which helps us to debug pf. In this handling we are dumping frame data while fetching it out of the context data. There was an issue in this dump logic that we were mapping cam_context to cntx_data one to one. This change is taking care of issue the by passing ctx. Change-Id: I33acb11f19f65ade6a31db5c1ff6f2570a189285 Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
-rw-r--r--drivers/media/platform/msm/camera/cam_core/cam_context_utils.c4
-rw-r--r--drivers/media/platform/msm/camera/cam_core/cam_hw_mgr_intf.h8
-rw-r--r--drivers/media/platform/msm/camera/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c21
3 files changed, 22 insertions, 11 deletions
diff --git a/drivers/media/platform/msm/camera/cam_core/cam_context_utils.c b/drivers/media/platform/msm/camera/cam_core/cam_context_utils.c
index 211146d36ea0..fffb0cb98bd9 100644
--- a/drivers/media/platform/msm/camera/cam_core/cam_context_utils.c
+++ b/drivers/media/platform/msm/camera/cam_core/cam_context_utils.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1033,7 +1033,7 @@ int32_t cam_context_dump_pf_info_to_hw(struct cam_context *ctx,
cmd_args.ctxt_to_hw_map = ctx->ctxt_to_hw_map;
cmd_args.cmd_type = CAM_HW_MGR_CMD_DUMP_PF_INFO;
cmd_args.u.pf_args.pf_data.packet = packet;
- cmd_args.u.pf_args.pf_data.ctx_id = ctx->ctx_id;
+ cmd_args.u.pf_args.pf_data.ctx = ctx;
cmd_args.u.pf_args.iova = iova;
cmd_args.u.pf_args.buf_info = buf_info;
cmd_args.u.pf_args.mem_found = mem_found;
diff --git a/drivers/media/platform/msm/camera/cam_core/cam_hw_mgr_intf.h b/drivers/media/platform/msm/camera/cam_core/cam_hw_mgr_intf.h
index 18c7bd908fd5..34b6d0b94130 100644
--- a/drivers/media/platform/msm/camera/cam_core/cam_hw_mgr_intf.h
+++ b/drivers/media/platform/msm/camera/cam_core/cam_hw_mgr_intf.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -144,11 +144,11 @@ struct cam_hw_stop_args {
* struct cam_hw_mgr_dump_pf_data - page fault debug data
*
* packet: pointer to packet
- * ctx_id: context id
+ * ctx: pointer to cam context
*/
struct cam_hw_mgr_dump_pf_data {
- void *packet;
- uint32_t ctx_id;
+ void *packet;
+ void *ctx;
};
/**
diff --git a/drivers/media/platform/msm/camera/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c b/drivers/media/platform/msm/camera/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c
index f7375794a71f..35645092aebf 100644
--- a/drivers/media/platform/msm/camera/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c
+++ b/drivers/media/platform/msm/camera/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -5275,7 +5275,7 @@ cmd_work_failed:
}
static int cam_icp_util_dump_frame_data(struct cam_packet *packet,
- struct cam_icp_hw_mgr *hw_mgr, uint32_t ctx_id)
+ struct cam_icp_hw_mgr *hw_mgr, void *ctx)
{
int num_cmd_buf = 0, i = 0, rc = 0;
size_t len;
@@ -5283,11 +5283,22 @@ static int cam_icp_util_dump_frame_data(struct cam_packet *packet,
uintptr_t cpu_addr = 0;
struct ipe_frame_process_data *ipe_frame_process_data = NULL;
struct bps_frame_process_data *bps_frame_process_data = NULL;
- struct cam_icp_hw_ctx_data *ctx_data;
+ struct cam_icp_hw_ctx_data *ctx_data = NULL;
cmd_desc = (struct cam_cmd_buf_desc *)
((uint32_t *) &packet->payload + packet->cmd_buf_offset/4);
- ctx_data = &hw_mgr->ctx_data[ctx_id];
+
+ for (i = 0; i < CAM_ICP_CTX_MAX; i++) {
+ if (hw_mgr->ctx_data[i].context_priv == ctx) {
+ ctx_data = &hw_mgr->ctx_data[i];
+ break;
+ }
+ }
+
+ if (!ctx_data) {
+ CAM_ERR(CAM_ICP, "ctx_data is NULL");
+ return -EINVAL;
+ }
for (i = 0; i < packet->num_cmd_buf; i++, num_cmd_buf++) {
if (cmd_desc[i].type == CAM_CMD_BUF_FW) {
@@ -5407,7 +5418,7 @@ static int cam_icp_mgr_cmd(void *hw_mgr_priv, void *cmd_args)
cam_icp_util_dump_frame_data(
hw_cmd_args->u.pf_args.pf_data.packet,
hw_mgr,
- hw_cmd_args->u.pf_args.pf_data.ctx_id);
+ hw_cmd_args->u.pf_args.pf_data.ctx);
break;
default: