Преглед изворни кода

msm: camera: isp: Update reapply field in config args

Currently reapply field in config args signifies applying
only IO buffers. Update that field as an enum providing
the provision to reapply IQ or IO accordingly.

CRs-Fixed: 3045706
Change-Id: Id10ee846a6de093e5a79858689802e421628ce56
Signed-off-by: Karthik Anantha Ram <[email protected]>
Karthik Anantha Ram пре 3 година
родитељ
комит
66b3f46f58

+ 12 - 2
drivers/cam_core/cam_hw_mgr_intf.h

@@ -272,6 +272,15 @@ struct cam_hw_stream_setttings {
 	void                           *priv;
 };
 
+/**
+ * enum cam_hw_config_reapply_type
+ */
+enum cam_hw_config_reapply_type {
+	CAM_CONFIG_REAPPLY_NONE,
+	CAM_CONFIG_REAPPLY_IQ,
+	CAM_CONFIG_REAPPLY_IO,
+};
+
 /**
  * struct cam_hw_config_args - Payload for config command
  *
@@ -282,7 +291,8 @@ 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
+ * @reapply_type:              On reapply determines what is to be applied
+ * @init_packet:               Set if INIT packet
  * @cdm_reset_before_apply:    True is need to reset CDM before re-apply bubble
  *                             request
  *
@@ -295,8 +305,8 @@ struct cam_hw_config_args {
 	uint32_t                        num_out_map_entries;
 	void                           *priv;
 	uint64_t                        request_id;
+	enum cam_hw_config_reapply_type reapply_type;
 	bool                            init_packet;
-	bool                            reapply;
 	bool                            cdm_reset_before_apply;
 };
 

+ 8 - 8
drivers/cam_isp/cam_isp_context.c

@@ -203,7 +203,7 @@ static void __cam_isp_ctx_req_mini_dump(struct cam_ctx_request *req,
 	req_md->num_deferred_acks = req_isp->num_deferred_acks;
 	req_md->bubble_report = req_isp->bubble_report;
 	req_md->bubble_detected = req_isp->bubble_detected;
-	req_md->reapply = req_isp->reapply;
+	req_md->reapply_type = req_isp->reapply_type;
 	req_md->request_id = req->request_id;
 	*bytes_updated += bytes_required;
 
@@ -1226,7 +1226,7 @@ static int __cam_isp_ctx_handle_buf_done_for_req_list(
 		}
 		list_del_init(&req->list);
 		list_add_tail(&req->list, &ctx->free_req_list);
-		req_isp->reapply = false;
+		req_isp->reapply_type = CAM_CONFIG_REAPPLY_NONE;
 		req_isp->cdm_reset_before_apply = false;
 		req_isp->num_acked = 0;
 		req_isp->num_deferred_acks = 0;
@@ -2388,7 +2388,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;
+	req_isp->reapply_type = CAM_CONFIG_REAPPLY_IO;
 	req_isp->cdm_reset_before_apply = false;
 
 	CAM_INFO_RATE_LIMIT(CAM_ISP, "ctx:%d Report Bubble flag %d req id:%lld",
@@ -2596,7 +2596,7 @@ static int __cam_isp_ctx_epoch_in_bubble_applied(
 	req_isp->bubble_detected = true;
 	CAM_INFO_RATE_LIMIT(CAM_ISP, "Ctx:%d Report Bubble flag %d req id:%lld",
 		ctx->ctx_id, req_isp->bubble_report, req->request_id);
-	req_isp->reapply = true;
+	req_isp->reapply_type = CAM_CONFIG_REAPPLY_IO;
 	req_isp->cdm_reset_before_apply = false;
 
 	if (req_isp->bubble_report) {
@@ -3422,7 +3422,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;
+	cfg.reapply_type = req_isp->reapply_type;
 	cfg.cdm_reset_before_apply = req_isp->cdm_reset_before_apply;
 
 	atomic_set(&ctx_isp->apply_in_progress, 1);
@@ -3835,7 +3835,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;
+		req_isp->reapply_type = CAM_CONFIG_REAPPLY_NONE;
 		req_isp->cdm_reset_before_apply = false;
 		list_del_init(&req->list);
 		list_add_tail(&req->list, &ctx->free_req_list);
@@ -4191,7 +4191,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_applied(
 	req_isp->bubble_detected = true;
 	CAM_INFO_RATE_LIMIT(CAM_ISP, "Ctx:%d Report Bubble flag %d req id:%lld",
 		ctx->ctx_id, req_isp->bubble_report, req->request_id);
-	req_isp->reapply = true;
+	req_isp->reapply_type = CAM_CONFIG_REAPPLY_IO;
 	req_isp->cdm_reset_before_apply = false;
 
 	if (req_isp->bubble_report) {
@@ -5757,7 +5757,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.hw_config.reapply_type = CAM_CONFIG_REAPPLY_NONE;
 	start_isp.hw_config.cdm_reset_before_apply = false;
 
 	ctx_isp->last_applied_req_id = req->request_id;

+ 4 - 4
drivers/cam_isp/cam_isp_context.h

@@ -153,8 +153,8 @@ struct cam_isp_ctx_irq_ops {
  * @bubble_report:             Flag to track if bubble report is active on
  *                             current request
  * @hw_update_data:            HW update data for this request
+ * @reapply_type:              Determines type of settings to be re-applied
  * @event_timestamp:           Timestamp for different stage of request
- * @reapply:                   True if reapplying after bubble
  * @cdm_reset_before_apply:    For bubble re-apply when buf done not coming set
  *                             to True
  *
@@ -172,10 +172,10 @@ struct cam_isp_ctx_req {
 	uint32_t                  deferred_fence_map_index[CAM_ISP_CTX_RES_MAX];
 	int32_t                               bubble_report;
 	struct cam_isp_prepare_hw_update_data hw_update_data;
+	enum cam_hw_config_reapply_type       reapply_type;
 	ktime_t                               event_timestamp
 		[CAM_ISP_CTX_EVENT_MAX];
 	bool                                  bubble_detected;
-	bool                                  reapply;
 	bool                                  cdm_reset_before_apply;
 };
 
@@ -345,6 +345,7 @@ struct cam_isp_context_dump_header {
  * @map_out:                   Output fence mapping
  * @map_in:                    Input fence mapping
  * @io_cfg:                    IO buffer configuration
+ * @reapply_type:              Determines type of settings to be re-applied
  * @request_id:                Request ID
  * @num_fence_map_out:         Number of the output fence map
  * @num_fence_map_in:          Number of input fence map
@@ -358,7 +359,6 @@ struct cam_isp_context_dump_header {
  * @bubble_report:             Flag to track if bubble report is active on
  *                             current request
  * @bubble_detected:           Flag to track if bubble is detected
- * @reapply:                   True if reapplying after bubble
  * @cdm_reset_before_apply:    For bubble re-apply when buf done not coming set
  *                             to True
  *
@@ -367,6 +367,7 @@ struct cam_isp_ctx_req_mini_dump {
 	struct cam_hw_fence_map_entry   *map_out;
 	struct cam_hw_fence_map_entry   *map_in;
 	struct cam_buf_io_cfg           *io_cfg;
+	enum cam_hw_config_reapply_type  reapply_type;
 	uint64_t                         request_id;
 	uint8_t                          num_fence_map_in;
 	uint8_t                          num_fence_map_out;
@@ -375,7 +376,6 @@ struct cam_isp_ctx_req_mini_dump {
 	uint8_t                          num_deferred_acks;
 	bool                             bubble_report;
 	bool                             bubble_detected;
-	bool                             reapply;
 	bool                             cdm_reset_before_apply;
 };
 

+ 9 - 3
drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c

@@ -5770,7 +5770,7 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv,
 	CAM_DBG(CAM_ISP, "Ctx[%pK][%d] : Applying Req %lld, init_packet=%d",
 		ctx, ctx->ctx_index, cfg->request_id, cfg->init_packet);
 
-	if (cfg->reapply && cfg->cdm_reset_before_apply) {
+	if (cfg->reapply_type && cfg->cdm_reset_before_apply) {
 		if (ctx->last_cdm_done_req < cfg->request_id) {
 			cdm_hang_detect =
 				cam_cdm_detect_hang_error(ctx->cdm_handle);
@@ -5869,8 +5869,14 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv,
 		for (i = 0 ; i < cfg->num_hw_update_entries; i++) {
 			cmd = (cfg->hw_update_entries + i);
 
-			if (cfg->reapply &&
-				cmd->flags == CAM_ISP_IQ_BL) {
+			if ((cfg->reapply_type == CAM_CONFIG_REAPPLY_IO) &&
+				(cmd->flags == CAM_ISP_IQ_BL)) {
+				skip++;
+				continue;
+			}
+
+			if ((cfg->reapply_type == CAM_CONFIG_REAPPLY_IQ) &&
+				(cmd->flags == CAM_ISP_IOCFG_BL)) {
 				skip++;
 				continue;
 			}

+ 3 - 2
drivers/cam_isp/isp_hw_mgr/cam_tfe_hw_mgr.c

@@ -2635,7 +2635,7 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv,
 	hw_update_data = (struct cam_isp_prepare_hw_update_data  *) cfg->priv;
 	hw_update_data->isp_mgr_ctx = ctx;
 
-	if (cfg->reapply && cfg->cdm_reset_before_apply) {
+	if (cfg->reapply_type && cfg->cdm_reset_before_apply) {
 		if (ctx->last_cdm_done_req < cfg->request_id) {
 			cdm_hang_detect =
 				cam_cdm_detect_hang_error(ctx->cdm_handle);
@@ -2699,7 +2699,8 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv,
 
 	for (i = 0; i < cfg->num_hw_update_entries; i++) {
 		cmd = (cfg->hw_update_entries + i);
-		if (cfg->reapply && cmd->flags == CAM_ISP_IQ_BL) {
+		if ((cfg->reapply_type == CAM_CONFIG_REAPPLY_IO) &&
+			(cmd->flags == CAM_ISP_IQ_BL)) {
 			skip++;
 			continue;
 		}