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

Commit 9f5b927b authored by Trishansh Bhardwaj's avatar Trishansh Bhardwaj Committed by Ravikishore Pampana
Browse files

msm: camera: isp: Skip reapply of DMI config on bubble recovery



Updating same DMI bank, which is consumed by HW, can result in
violations so during bubble recvery skip  updating DMI config.

Change-Id: I1af2dbf2f1b49afcd4276d3f5759e5ba6d8da637
Signed-off-by: default avatarTrishansh Bhardwaj <tbhardwa@codeaurora.org>
parent d181d1a2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -211,6 +211,7 @@ struct cam_hw_stream_setttings {
 * @num_out_map_entries:   Number of out map entries
 * @priv:                  Private pointer
 * @request_id:            Request ID
 * @reapply                True if reapplying after bubble
 *
 */
struct cam_hw_config_args {
@@ -222,6 +223,7 @@ struct cam_hw_config_args {
	void                           *priv;
	uint64_t                        request_id;
	bool                            init_packet;
	bool                            reapply;
};

/**
+7 −0
Original line number Diff line number Diff line
@@ -698,6 +698,7 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state(
	} else {
		list_del_init(&req->list);
		list_add_tail(&req->list, &ctx->free_req_list);
		req_isp->reapply = false;

		CAM_DBG(CAM_REQ,
			"Move active request %lld to free list(cnt = %d) [all fences done], ctx %u",
@@ -1125,6 +1126,7 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
		list);
	req_isp = (struct cam_isp_ctx_req *)req->req_priv;
	req_isp->bubble_detected = true;
	req_isp->reapply = true;

	CAM_INFO(CAM_ISP, "ctx:%d Report Bubble flag %d req id:%lld",
		ctx->ctx_id, req_isp->bubble_report, req->request_id);
@@ -1288,6 +1290,7 @@ static int __cam_isp_ctx_epoch_in_bubble_applied(
	CAM_INFO(CAM_ISP, "Ctx:%d Report Bubble flag %d req id:%lld",
		ctx->ctx_id, req_isp->bubble_report, req->request_id);
	__cam_isp_ctx_dump_state_monitor_array(ctx_isp, true);
	req_isp->reapply = true;

	if (req_isp->bubble_report && ctx->ctx_crm_intf &&
		ctx->ctx_crm_intf->notify_err) {
@@ -2055,6 +2058,7 @@ static int __cam_isp_ctx_apply_req_in_activated_state(
	cfg.num_hw_update_entries = req_isp->num_cfg;
	cfg.priv  = &req_isp->hw_update_data;
	cfg.init_packet = 0;
	cfg.reapply = req_isp->reapply;

	rc = ctx->hw_mgr_intf->hw_config(ctx->hw_mgr_intf->hw_mgr_priv, &cfg);
	if (rc) {
@@ -2335,6 +2339,7 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx,
				req_isp->fence_map_out[i].sync_id = -1;
			}
		}
		req_isp->reapply = false;
		list_add_tail(&req->list, &ctx->free_req_list);
	}

@@ -2697,6 +2702,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_applied(
	CAM_INFO(CAM_ISP, "Ctx:%d Report Bubble flag %d req id:%lld",
		ctx->ctx_id, req_isp->bubble_report, req->request_id);
	__cam_isp_ctx_dump_state_monitor_array(ctx_isp, true);
	req_isp->reapply = true;

	if (req_isp->bubble_report && ctx->ctx_crm_intf &&
		ctx->ctx_crm_intf->notify_err) {
@@ -3753,6 +3759,7 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx,
	start_isp.hw_config.num_hw_update_entries = req_isp->num_cfg;
	start_isp.hw_config.priv  = &req_isp->hw_update_data;
	start_isp.hw_config.init_packet = 1;
	start_isp.hw_config.reapply = 0;
	start_isp.start_only = false;

	atomic_set(&ctx_isp->process_bubble, 0);
+2 −0
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ struct cam_isp_ctx_irq_ops {
 * @hw_update_data:        HW update data for this request
 * @event_timestamp:       Timestamp for different stage of request
 * @bubble_detected:       Flag to indicate if bubble detected
 * @reapply:               True if reapplying after bubble
 *
 */
struct cam_isp_ctx_req {
@@ -140,6 +141,7 @@ struct cam_isp_ctx_req {
	struct timeval                        event_timestamp
	    [CAM_ISP_CTX_EVENT_MAX];
	bool                                  bubble_detected;
	bool                                  reapply;
};

/**
+22 −6
Original line number Diff line number Diff line
@@ -2473,7 +2473,7 @@ static int cam_isp_blob_bw_update(
static int cam_ife_mgr_config_hw(void *hw_mgr_priv,
					void *config_hw_args)
{
	int rc = -1, i;
	int rc = -1, i, skip = 0;
	struct cam_hw_config_args *cfg;
	struct cam_hw_update_entry *cmd;
	struct cam_cdm_bl_request *cdm_cmd;
@@ -2523,18 +2523,34 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv,

	if (cfg->num_hw_update_entries > 0) {
		cdm_cmd = ctx->cdm_cmd;
		cdm_cmd->cmd_arrary_count = cfg->num_hw_update_entries;
		cdm_cmd->type = CAM_CDM_BL_CMD_TYPE_MEM_HANDLE;
		cdm_cmd->flag = true;
		cdm_cmd->userdata = ctx;
		cdm_cmd->cookie = cfg->request_id;

		for (i = 0 ; i <= cfg->num_hw_update_entries; i++) {
		for (i = 0 ; i < cfg->num_hw_update_entries; i++) {
			cmd = (cfg->hw_update_entries + i);
			cdm_cmd->cmd[i].bl_addr.mem_handle = cmd->handle;
			cdm_cmd->cmd[i].offset = cmd->offset;
			cdm_cmd->cmd[i].len = cmd->len;
			CAM_DBG(CAM_ISP, "reapply:%d cmd flags:%d",
				cfg->reapply, cmd->flags);

			if (cfg->reapply &&
				(cmd->flags == CAM_ISP_IQ_BL)) {
				skip++;
				continue;
			}

			if (cmd->flags == CAM_ISP_UNUSED_BL ||
				cmd->flags >= CAM_ISP_BL_MAX)
				CAM_ERR(CAM_ISP, "Unexpected BL type %d",
					cmd->flags);

			cdm_cmd->cmd[i - skip].bl_addr.mem_handle = cmd->handle;
			cdm_cmd->cmd[i - skip].offset = cmd->offset;
			cdm_cmd->cmd[i - skip].len = cmd->len;
		}
		cdm_cmd->cmd_arrary_count = cfg->num_hw_update_entries - skip;
		CAM_DBG(CAM_ISP, "updated cmd array count:%d skip value:%d",
			cdm_cmd->cmd_arrary_count, skip);

		if (cfg->init_packet)
			init_completion(&ctx->config_done_complete);
+13 −9
Original line number Diff line number Diff line
@@ -70,6 +70,8 @@ int cam_isp_add_change_base(
			hw_entry[num_ent].handle = kmd_buf_info->handle;
			hw_entry[num_ent].len    = get_base.cmd.used_bytes;
			hw_entry[num_ent].offset = kmd_buf_info->offset;
			/* Marking change base as IOCFG to reapply on bubble */
			hw_entry[num_ent].flags  = CAM_ISP_IOCFG_BL;
			CAM_DBG(CAM_ISP,
				"num_ent=%d handle=0x%x, len=%u, offset=%u",
				num_ent,
@@ -314,10 +316,7 @@ int cam_isp_add_command_buffers(
					hw_entry[num_ent].handle,
					hw_entry[num_ent].len,
					hw_entry[num_ent].offset);

				if (cmd_meta_data ==
					CAM_ISP_PACKET_META_DMI_LEFT)
					hw_entry[num_ent].flags = 0x1;
				hw_entry[num_ent].flags = CAM_ISP_IQ_BL;

				num_ent++;
			}
@@ -336,9 +335,7 @@ int cam_isp_add_command_buffers(
					hw_entry[num_ent].len,
					hw_entry[num_ent].offset);

				if (cmd_meta_data ==
					CAM_ISP_PACKET_META_DMI_RIGHT)
					hw_entry[num_ent].flags = 0x1;
				hw_entry[num_ent].flags = CAM_ISP_IQ_BL;
				num_ent++;
			}
			break;
@@ -354,8 +351,7 @@ int cam_isp_add_command_buffers(
				hw_entry[num_ent].handle,
				hw_entry[num_ent].len,
				hw_entry[num_ent].offset);
			if (cmd_meta_data == CAM_ISP_PACKET_META_DMI_COMMON)
				hw_entry[num_ent].flags = 0x1;
			hw_entry[num_ent].flags = CAM_ISP_IQ_BL;

			num_ent++;
			break;
@@ -386,6 +382,7 @@ int cam_isp_add_command_buffers(
						rc);
					return rc;
				}
				hw_entry[num_ent].flags = CAM_ISP_IQ_BL;
				num_ent = prepare->num_hw_update_entries;
			}
			break;
@@ -408,6 +405,7 @@ int cam_isp_add_command_buffers(
						rc);
					return rc;
				}
				hw_entry[num_ent].flags = CAM_ISP_IQ_BL;
				num_ent = prepare->num_hw_update_entries;
			}
			break;
@@ -428,6 +426,7 @@ int cam_isp_add_command_buffers(
					"Failed in processing blobs %d", rc);
				return rc;
			}
			hw_entry[num_ent].flags = CAM_ISP_IQ_BL;
			num_ent = prepare->num_hw_update_entries;
		}
			break;
@@ -839,6 +838,8 @@ int cam_isp_add_io_buffers(
		prepare->hw_update_entries[num_ent].len = io_cfg_used_bytes;
		prepare->hw_update_entries[num_ent].offset =
			kmd_buf_info->offset;
		prepare->hw_update_entries[num_ent].flags = CAM_ISP_IOCFG_BL;

		CAM_DBG(CAM_ISP,
			"num_ent=%d handle=0x%x, len=%u, offset=%u",
			num_ent,
@@ -945,6 +946,9 @@ int cam_isp_add_reg_update(
		prepare->hw_update_entries[num_ent].len = reg_update_size;
		prepare->hw_update_entries[num_ent].offset =
			kmd_buf_info->offset;
		/* Marking reg update as IOCFG to reapply on bubble */
		prepare->hw_update_entries[num_ent].flags = CAM_ISP_IOCFG_BL;

		CAM_DBG(CAM_ISP,
			"num_ent=%d handle=0x%x, len=%u, offset=%u",
			num_ent,
Loading