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

Commit f302511f authored by Suresh Vankadara's avatar Suresh Vankadara Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: cam_icp: Update frame dump logic handling PF" into dev/msm-4.14-camx

parents f5f6d76f ec2cbfda
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line 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
 * 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
 * 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.ctxt_to_hw_map = ctx->ctxt_to_hw_map;
		cmd_args.cmd_type = CAM_HW_MGR_CMD_DUMP_PF_INFO;
		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.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.iova = iova;
		cmd_args.u.pf_args.buf_info = buf_info;
		cmd_args.u.pf_args.buf_info = buf_info;
		cmd_args.u.pf_args.mem_found = mem_found;
		cmd_args.u.pf_args.mem_found = mem_found;
+4 −4
Original line number Original line 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
 * 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
 * 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
 * struct cam_hw_mgr_dump_pf_data - page fault debug data
 *
 *
 * packet:     pointer to packet
 * packet:     pointer to packet
 * ctx_id:     context id
 * ctx:        pointer to cam context
 */
 */
struct cam_hw_mgr_dump_pf_data {
struct cam_hw_mgr_dump_pf_data {
	void *packet;
	void *packet;
	uint32_t ctx_id;
	void *ctx;
};
};


/**
/**
+16 −5
Original line number Original line 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
 * 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
 * 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,
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;
	int num_cmd_buf = 0, i = 0, rc = 0;
	size_t len;
	size_t len;
@@ -5283,11 +5283,22 @@ static int cam_icp_util_dump_frame_data(struct cam_packet *packet,
	uintptr_t cpu_addr = 0;
	uintptr_t cpu_addr = 0;
	struct ipe_frame_process_data *ipe_frame_process_data = NULL;
	struct ipe_frame_process_data *ipe_frame_process_data = NULL;
	struct bps_frame_process_data *bps_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 *)
	cmd_desc = (struct cam_cmd_buf_desc *)
		((uint32_t *) &packet->payload + packet->cmd_buf_offset/4);
		((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++) {
	for (i = 0; i < packet->num_cmd_buf; i++, num_cmd_buf++) {
		if (cmd_desc[i].type == CAM_CMD_BUF_FW) {
		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(
		cam_icp_util_dump_frame_data(
			hw_cmd_args->u.pf_args.pf_data.packet,
			hw_cmd_args->u.pf_args.pf_data.packet,
			hw_mgr,
			hw_mgr,
			hw_cmd_args->u.pf_args.pf_data.ctx_id);
			hw_cmd_args->u.pf_args.pf_data.ctx);


		break;
		break;
	default:
	default: