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

Commit e5d8b90e authored by Sridhar Gujje's avatar Sridhar Gujje
Browse files

Merge tag 'camera-kernel.lnx.1.0-191029' into camera-kernel.lnx.3.1



* tag 'camera-kernel.lnx.1.0-191029':
  msm: camera: isp: Limit sof_in_epoch log to first frame
  msm: camera: jpeg: Add plane stride & slice height debug info
  msm: camera: isp: Change state immediately in flush
  msm: camera: isp: Dump isp req for cdm timeout
  msm: camera: ife: Add packing format support
  msm: camera: icp: Fix AHB, AXI voting in icp
  msm: camera: ife: Remove duplicate add to port counters
  msm: camera: csiphy: Update CPHY 3-phase registers for CSIPHY v1.2

Change-Id: Iab92663a00bcfb9e6e55c6d124ca6bf6e68732be
Signed-off-by: default avatarSridhar Gujje <sgujje@codeaurora.org>
parents 80560aa9 c23b6688
Loading
Loading
Loading
Loading
+41 −7
Original line number Diff line number Diff line
@@ -431,6 +431,7 @@ static int32_t cam_icp_ctx_timer(void *priv, void *data)
	struct cam_icp_cpas_vote clk_update;
	int i = 0;
	int device_share_ratio = 1;
	uint64_t total_ab_bw = 0;

	if (!ctx_data) {
		CAM_ERR(CAM_ICP, "ctx_data is NULL, failed to update clk");
@@ -494,10 +495,6 @@ static int32_t cam_icp_ctx_timer(void *priv, void *data)
		CAM_ICP_RES_TYPE_BPS) && (ipe1_dev_intf))
		device_share_ratio = 2;

	clk_update.ahb_vote.type = CAM_VOTE_DYNAMIC;
	clk_update.ahb_vote.vote.freq = 0;
	clk_update.ahb_vote_valid = false;

	if (ctx_data->bw_config_version == CAM_ICP_BW_CONFIG_V1) {
		clk_update.axi_vote.num_paths = 1;
		if (ctx_data->icp_dev_acquire_info->dev_type ==
@@ -516,6 +513,8 @@ static int32_t cam_icp_ctx_timer(void *priv, void *data)
		clk_info->compressed_bw -= ctx_data->clk_info.compressed_bw;
		clk_info->uncompressed_bw -= ctx_data->clk_info.uncompressed_bw;

		total_ab_bw = clk_info->compressed_bw;

		ctx_data->clk_info.uncompressed_bw = 0;
		ctx_data->clk_info.compressed_bw = 0;
		ctx_data->clk_info.curr_fc = 0;
@@ -580,6 +579,9 @@ static int32_t cam_icp_ctx_timer(void *priv, void *data)
				ctx_data->clk_info.axi_path[i].ddr_ab_bw;
			clk_info->axi_path[path_index].ddr_ib_bw -=
				ctx_data->clk_info.axi_path[i].ddr_ib_bw;

			total_ab_bw +=
				clk_info->axi_path[path_index].mnoc_ab_bw;
		}

		memset(&ctx_data->clk_info.axi_path[0], 0,
@@ -616,6 +618,16 @@ static int32_t cam_icp_ctx_timer(void *priv, void *data)
	}

	clk_update.axi_vote_valid = true;

	if (total_ab_bw == 0) {
		/* If no more contexts are active, reduce AHB vote to minimum */
		clk_update.ahb_vote.type = CAM_VOTE_ABSOLUTE;
		clk_update.ahb_vote.vote.level = CAM_LOWSVS_VOTE;
		clk_update.ahb_vote_valid = true;
	} else {
		clk_update.ahb_vote_valid = false;
	}

	dev_intf->hw_ops.process_cmd(dev_intf->hw_priv, id,
		&clk_update, sizeof(clk_update));

@@ -1061,7 +1073,8 @@ static bool cam_icp_update_bw_v2(struct cam_icp_hw_mgr *hw_mgr,

	if (!update_required) {
		CAM_DBG(CAM_ICP,
			"Incoming BW hasn't changed, no update required");
			"Incoming BW hasn't changed, no update required, num_paths=%d",
			clk_info->num_paths);
		return false;
	}

@@ -1326,6 +1339,9 @@ static bool cam_icp_check_bw_update(struct cam_icp_hw_mgr *hw_mgr,
	} else if (ctx_data->bw_config_version == CAM_ICP_BW_CONFIG_V2) {
		clk_info_v2 = &ctx_data->hfi_frame_process.clk_info_v2[idx];

		CAM_DBG(CAM_ICP, "index=%d, num_paths=%d, ctx_data=%pK",
			idx, clk_info_v2->num_paths, ctx_data);

		bw_updated = cam_icp_update_bw_v2(hw_mgr, ctx_data,
			hw_mgr_clk_info, clk_info_v2, busy);

@@ -4138,6 +4154,7 @@ static int cam_icp_packet_generic_blob_handler(void *user_data,
	size_t io_buf_size, clk_update_size;
	int rc = 0;
	uintptr_t pResource;
	uint32_t i = 0;

	if (!blob_data || (blob_size == 0)) {
		CAM_ERR(CAM_ICP, "Invalid blob info %pK %d", blob_data,
@@ -4241,9 +4258,26 @@ static int cam_icp_packet_generic_blob_handler(void *user_data,
		clk_info->frame_cycles = clk_info_v2->frame_cycles;
		clk_info->rt_flag = clk_info_v2->rt_flag;

		CAM_DBG(CAM_ICP, "budget=%llu, frame_cycle=%llu, rt_flag=%d",
		CAM_DBG(CAM_ICP,
			"budget=%llu, frame_cycle=%llu, rt_flag=%d, num_paths=%d, clk_update_size=%d, index=%d, ctx_data=%pK",
			clk_info_v2->budget_ns, clk_info_v2->frame_cycles,
			clk_info_v2->rt_flag);
			clk_info_v2->rt_flag,
			clk_info_v2->num_paths,
			clk_update_size,
			index,
			ctx_data);

		for (i = 0; i < clk_info_v2->num_paths; i++) {
			CAM_DBG(CAM_ICP,
				"[%d] : path_type=%d, trans_type=%d, camnoc=%lld, mnoc_ab=%lld, mnoc_ib=%lld",
				i,
				clk_info_v2->axi_path[i].path_data_type,
				clk_info_v2->axi_path[i].transac_type,
				clk_info_v2->axi_path[i].camnoc_bw,
				clk_info_v2->axi_path[i].mnoc_ab_bw,
				clk_info_v2->axi_path[i].mnoc_ib_bw);
		}

		break;

	case CAM_ICP_CMD_GENERIC_BLOB_CFG_IO:
+2 −0
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ struct icp_frame_info {
 * @budget_ns: Time required to process frame
 * @frame_cycles: Frame cycles needed to process the frame
 * @rt_flag: Flag to indicate real time stream
 * @reserved: Reserved filed.
 * @num_paths: Number of paths for per path bw vote
 * @axi_path: Per path vote info for IPE/BPS
 */
@@ -152,6 +153,7 @@ struct cam_icp_clk_bw_req_internal_v2 {
	uint64_t budget_ns;
	uint32_t frame_cycles;
	uint32_t rt_flag;
	uint32_t reserved;
	uint32_t num_paths;
	struct cam_axi_per_path_bw_vote axi_path[CAM_ICP_MAX_PER_PATH_VOTES];
};
+43 −24
Original line number Diff line number Diff line
@@ -689,9 +689,10 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state(

	if (done_next_req.num_handles) {
		struct cam_isp_hw_done_event_data unhandled_res;
		struct cam_ctx_request  *next_req = list_next_entry(req, list);
		struct cam_ctx_request  *next_req = list_last_entry(
			&ctx->active_req_list, struct cam_ctx_request, list);

		if (next_req) {
		if (next_req->request_id != req->request_id) {
			/*
			 * Few resource handles are already signalled in the
			 * current request, lets check if there is another
@@ -719,6 +720,10 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state(
				CAM_ERR(CAM_ISP,
					"BUF Done not handled for next request %lld",
					next_req->request_id);
		} else {
			CAM_WARN(CAM_ISP,
				"Req %lld only active request, spurious buf_done rxd",
				req->request_id);
		}
	}

@@ -1125,8 +1130,13 @@ static int __cam_isp_ctx_sof_in_epoch(struct cam_isp_context *ctx_isp,
			CAM_ISP_STATE_CHANGE_TRIGGER_SOF,
			req->request_id);

	if (ctx_isp->frame_id == 1)
		CAM_INFO(CAM_ISP,
			"First SOF in EPCR ctx:%d frame_id:%lld next substate %d",
			ctx->ctx_id, ctx_isp->frame_id,
			ctx_isp->substate_activated);

	CAM_DBG(CAM_ISP, "SOF in epoch ctx:%d frame_id:%lld next substate:%d",
		ctx->ctx_id, ctx_isp->frame_id, ctx_isp->substate_activated);

	return rc;
@@ -2103,6 +2113,7 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx,
			}
		}
		req_isp->reapply = false;
		list_del_init(&req->list);
		list_add_tail(&req->list, &ctx->free_req_list);
	}

@@ -2127,17 +2138,27 @@ static int __cam_isp_ctx_flush_req_in_top_state(
	struct cam_hw_cmd_args            hw_cmd_args;

	ctx_isp = (struct cam_isp_context *) ctx->ctx_priv;
	if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) {
		CAM_INFO(CAM_ISP, "Last request id to flush is %lld",
			flush_req->req_id);
		ctx->last_flush_req = flush_req->req_id;
	}

	CAM_DBG(CAM_ISP, "Flush pending list");
	spin_lock_bh(&ctx->lock);
	rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req);
	spin_unlock_bh(&ctx->lock);

	if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) {
		if (ctx->state <= CAM_CTX_READY) {
			ctx->state = CAM_CTX_ACQUIRED;
			goto end;
		}

		spin_lock_bh(&ctx->lock);
		ctx->state = CAM_CTX_FLUSHED;
		ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_HALT;
		spin_unlock_bh(&ctx->lock);

		CAM_INFO(CAM_ISP, "Last request id to flush is %lld",
			flush_req->req_id);
		ctx->last_flush_req = flush_req->req_id;

		memset(&hw_cmd_args, 0, sizeof(hw_cmd_args));
		hw_cmd_args.ctxt_to_hw_map = ctx->ctxt_to_hw_map;
		hw_cmd_args.cmd_type = CAM_HW_MGR_CMD_REG_DUMP_ON_FLUSH;
@@ -2148,12 +2169,6 @@ static int __cam_isp_ctx_flush_req_in_top_state(
			rc = 0;
		}

	if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) {
		if (ctx->state <= CAM_CTX_READY) {
			ctx->state = CAM_CTX_ACQUIRED;
			goto end;
		}

		stop_args.ctxt_to_hw_map = ctx_isp->hw_ctx;
		stop_isp.hw_stop_cmd = CAM_ISP_HW_STOP_IMMEDIATELY;
		stop_isp.stop_only = true;
@@ -2184,8 +2199,6 @@ static int __cam_isp_ctx_flush_req_in_top_state(
		if (rc)
			CAM_ERR(CAM_ISP, "Failed to reset HW rc: %d", rc);

		ctx->state = CAM_CTX_FLUSHED;
		ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_HALT;
		ctx_isp->init_received = false;
	}

@@ -3025,10 +3038,12 @@ static int __cam_isp_ctx_config_dev_in_top_state(
			ctx_isp->init_received = true;
		} else {
			rc = -EINVAL;
			CAM_ERR(CAM_ISP, "Recevied INIT pkt in wrong state");
			CAM_ERR(CAM_ISP, "Recevied INIT pkt in wrong state:%d",
				ctx->state);
		}
	} else {
		if (ctx->state >= CAM_CTX_READY && ctx->ctx_crm_intf->add_req) {
		if (ctx->state != CAM_CTX_FLUSHED && ctx->state >= CAM_CTX_READY
			&& ctx->ctx_crm_intf->add_req) {
			add_req.link_hdl = ctx->link_hdl;
			add_req.dev_hdl  = ctx->dev_hdl;
			add_req.req_id   = req->request_id;
@@ -3043,7 +3058,9 @@ static int __cam_isp_ctx_config_dev_in_top_state(
			}
		} else {
			rc = -EINVAL;
			CAM_ERR(CAM_ISP, "Recevied Update in wrong state");
			CAM_ERR(CAM_ISP,
				"Recevied update req %lld in wrong state:%d",
				req->request_id, ctx->state);
		}
	}
	if (rc)
@@ -3734,6 +3751,8 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx,
		CAM_ERR(CAM_ISP, "Start HW failed");
		ctx->state = CAM_CTX_READY;
		trace_cam_context_state("ISP", ctx);
		if (rc == -ETIMEDOUT)
			cam_isp_ctx_dump_req(req_isp);
		list_del_init(&req->list);
		list_add(&req->list, &ctx->pending_req_list);
		goto end;
+2 −2
Original line number Diff line number Diff line
@@ -2409,8 +2409,8 @@ static int cam_ife_mgr_acquire_hw_for_ctx(
		goto err;
	}

	*num_pix_port += ipp_count + ppp_count + ife_rd_count + lcr_count;
	*num_rdi_port += rdi_count;
	*num_pix_port = ipp_count + ppp_count + ife_rd_count + lcr_count;
	*num_rdi_port = rdi_count;

	return 0;
err:
+2 −1
Original line number Diff line number Diff line
/* 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_IFE_CSID_LITE17X_H_
@@ -286,6 +286,7 @@ static const struct cam_ife_csid_common_reg_offset
	.path_rst_stb_all                             = 0x7f,
	.path_rst_done_shift_val                      = 1,
	.path_en_shift_val                            = 31,
	.packing_fmt_shift_val                        = 30,
	.dt_id_shift_val                              = 27,
	.vc_shift_val                                 = 22,
	.dt_shift_val                                 = 16,
Loading