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

Commit ec2cbfda authored by Vikram Sharma's avatar Vikram Sharma Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: cam_icp: Update frame dump logic handling PF



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: default avatarVikram Sharma <vikramsa@codeaurora.org>
parent 3cc6d12d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* 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;
+4 −4
Original line number Diff line number Diff line
/* 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 *ctx;
};

/**
+16 −5
Original line number Diff line number Diff line
/* 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 @@ static int cam_icp_mgr_create_wq(void)
}

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: