msm: camera: sync: Rearrange sync reason events

Rearrange sync error reason code for better code
readability.

CRs-Fixed: 2750553
Change-Id: Ia64694155921c074946167763815a87beb856b35
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
This commit is contained in:
Alok Chauhan
2020-08-19 00:40:28 +05:30
bovenliggende 642825a2eb
commit baf2d520ed
7 gewijzigde bestanden met toevoegingen van 28 en 31 verwijderingen

Bestand weergeven

@@ -663,7 +663,7 @@ int32_t cam_context_flush_ctx_to_hw(struct cam_context *ctx)
rc = cam_sync_signal(
req->out_map_entries[i].sync_id,
CAM_SYNC_STATE_SIGNALED_CANCEL,
CAM_SYNC_EVENT_FLUSH);
CAM_SYNC_COMMON_EVENT_FLUSH);
if (rc == -EALREADY) {
CAM_ERR(CAM_CTXT,
"Req: %llu already signalled, sync_id:%d",
@@ -736,7 +736,7 @@ int32_t cam_context_flush_ctx_to_hw(struct cam_context *ctx)
rc = cam_sync_signal(
req->out_map_entries[i].sync_id,
CAM_SYNC_STATE_SIGNALED_CANCEL,
CAM_SYNC_EVENT_FLUSH);
CAM_SYNC_COMMON_EVENT_FLUSH);
if (rc == -EALREADY) {
CAM_ERR(CAM_CTXT,
"Req: %llu already signalled ctx: %pK dev_name: %s dev_handle: %d ctx_state: %d",
@@ -850,7 +850,7 @@ int32_t cam_context_flush_req_to_hw(struct cam_context *ctx,
if (sync_id != -1) {
rc = cam_sync_signal(sync_id,
CAM_SYNC_STATE_SIGNALED_CANCEL,
CAM_SYNC_EVENT_FLUSH);
CAM_SYNC_COMMON_EVENT_FLUSH);
if (rc == -EALREADY) {
CAM_ERR(CAM_CTXT,
"Req: %llu already signalled, sync_id:%d",

Bestand weergeven

@@ -183,7 +183,7 @@ static int __cam_custom_ctx_frame_done(
rc = cam_sync_signal(req_custom->fence_map_out[j].sync_id,
CAM_SYNC_STATE_SIGNALED_SUCCESS,
CAM_SYNC_EVENT_SUCCESS);
CAM_SYNC_COMMON_EVENT_SUCCESS);
if (rc)
CAM_ERR(CAM_CUSTOM, "Sync failed with rc = %d", rc);
@@ -370,7 +370,7 @@ static int __cam_custom_ctx_flush_req(struct cam_context *ctx,
rc = cam_sync_signal(
req_custom->fence_map_out[i].sync_id,
CAM_SYNC_STATE_SIGNALED_CANCEL,
CAM_SYNC_EVENT_FLUSH);
CAM_SYNC_COMMON_EVENT_FLUSH);
if (rc)
CAM_ERR_RATE_LIMIT(CAM_CUSTOM,
"signal fence failed\n");
@@ -546,7 +546,7 @@ static int __cam_custom_stop_dev_core(
cam_sync_signal(
req_custom->fence_map_out[i].sync_id,
CAM_SYNC_STATE_SIGNALED_CANCEL,
CAM_SYNC_EVENT_STOP);
CAM_SYNC_COMMON_EVENT_STOP);
}
list_add_tail(&req->list, &ctx->free_req_list);
}
@@ -563,7 +563,7 @@ static int __cam_custom_stop_dev_core(
cam_sync_signal(
req_custom->fence_map_out[i].sync_id,
CAM_SYNC_STATE_SIGNALED_CANCEL,
CAM_SYNC_EVENT_STOP);
CAM_SYNC_COMMON_EVENT_STOP);
}
list_add_tail(&req->list, &ctx->free_req_list);
}
@@ -580,7 +580,7 @@ static int __cam_custom_stop_dev_core(
cam_sync_signal(
req_custom->fence_map_out[i].sync_id,
CAM_SYNC_STATE_SIGNALED_CANCEL,
CAM_SYNC_EVENT_STOP);
CAM_SYNC_COMMON_EVENT_STOP);
}
list_add_tail(&req->list, &ctx->free_req_list);
}

Bestand weergeven

@@ -937,7 +937,7 @@ static int __cam_isp_ctx_handle_buf_done_for_request(
rc = cam_sync_signal(req_isp->fence_map_out[j].sync_id,
CAM_SYNC_STATE_SIGNALED_SUCCESS,
CAM_SYNC_EVENT_SUCCESS);
CAM_SYNC_COMMON_EVENT_SUCCESS);
if (rc)
CAM_DBG(CAM_ISP, "Sync failed with rc = %d",
rc);
@@ -1078,7 +1078,7 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr(
rc = cam_sync_signal(req_isp->fence_map_out[j].sync_id,
CAM_SYNC_STATE_SIGNALED_SUCCESS,
CAM_SYNC_EVENT_SUCCESS);
CAM_SYNC_COMMON_EVENT_SUCCESS);
if (rc)
CAM_DBG(CAM_ISP, "Sync failed with rc = %d",
rc);

Bestand weergeven

@@ -547,7 +547,7 @@ static int cam_lrme_mgr_cb(void *data,
buf_data.request_id = frame_req->req_id;
buf_data.evt_param = (cb_args->cb_type & CAM_LRME_CB_ERROR) ?
CAM_SYNC_LRME_EVENT_CB_ERROR :
CAM_SYNC_EVENT_SUCCESS;
CAM_SYNC_COMMON_EVENT_SUCCESS;
CAM_DBG(CAM_LRME, "frame req %llu, evt_id %d",
frame_req->req_id, evt_id);
rc = hw_mgr->event_cb(frame_req->ctxt_to_hw_map,

Bestand weergeven

@@ -1567,7 +1567,7 @@ static void cam_ope_ctx_cdm_callback(uint32_t handle, void *userdata,
ope_req->request_id, ctx->ctx_id);
cam_ope_req_timer_reset(ctx);
cam_ope_device_timer_reset(ope_hw_mgr);
buf_data.evt_param = CAM_SYNC_EVENT_SUCCESS;
buf_data.evt_param = CAM_SYNC_COMMON_EVENT_SUCCESS;
} else if (status == CAM_CDM_CB_STATUS_HW_RESUBMIT) {
CAM_INFO(CAM_OPE, "After reset of CDM and OPE, reapply req");
buf_data.evt_param = CAM_SYNC_OPE_EVENT_HW_RESUBMIT;

Bestand weergeven

@@ -516,7 +516,7 @@ static int cam_sync_handle_signal(struct cam_private_ioctl_arg *k_ioctl)
return cam_sync_signal(sync_signal.sync_obj,
sync_signal.sync_state,
CAM_SYNC_CAM_SYNC_SIGNAL_EVENT);
CAM_SYNC_COMMON_SYNC_SIGNAL_EVENT);
}
static int cam_sync_handle_merge(struct cam_private_ioctl_arg *k_ioctl)
@@ -667,7 +667,7 @@ static int cam_sync_handle_register_user_payload(
row->state,
user_payload_kernel->payload_data,
CAM_SYNC_USER_PAYLOAD_SIZE * sizeof(__u64),
CAM_SYNC_REGISTER_PAYLOAD_EVENT);
CAM_SYNC_COMMON_REG_PAYLOAD_EVENT);
spin_unlock_bh(&sync_dev->row_spinlocks[sync_obj]);
kfree(user_payload_kernel);
@@ -873,7 +873,7 @@ static int cam_sync_close(struct file *filep)
if (row->state == CAM_SYNC_STATE_ACTIVE) {
rc = cam_sync_signal(i,
CAM_SYNC_STATE_SIGNALED_ERROR,
CAM_SYNC_v4l2_RELEASE_EVENT);
CAM_SYNC_COMMON_RELEASE_EVENT);
if (rc < 0)
CAM_ERR(CAM_SYNC,
"Cleanup signal fail idx:%d\n",
@@ -1099,7 +1099,7 @@ int cam_synx_sync_signal(int32_t sync_obj, uint32_t synx_status)
break;
}
rc = cam_sync_signal(sync_obj, sync_status, CAM_SYNC_EVENT_SYNX);
rc = cam_sync_signal(sync_obj, sync_status, CAM_SYNC_COMMON_EVENT_SYNX);
if (rc) {
CAM_ERR(CAM_SYNC,
"synx signal failed with %d, sync_obj=%d, synx_status=%d, sync_status=%d",

Bestand weergeven

@@ -44,16 +44,20 @@
#define CAM_SYNC_STATE_SIGNALED_ERROR 3
#define CAM_SYNC_STATE_SIGNALED_CANCEL 4
/* Top level sync event reason types */
#define CAM_SYNC_EVENT_UNKNOWN 0
#define CAM_SYNC_EVENT_SUCCESS 1
#define CAM_SYNC_EVENT_FLUSH 2
#define CAM_SYNC_EVENT_STOP 3
#define CAM_SYNC_EVENT_SYNX 4
/* Top level common sync event reason types */
#define CAM_SYNC_COMMON_EVENT_START 0
#define CAM_SYNC_COMMON_EVENT_UNUSED (CAM_SYNC_COMMON_EVENT_START + 0)
#define CAM_SYNC_COMMON_EVENT_SUCCESS (CAM_SYNC_COMMON_EVENT_START + 1)
#define CAM_SYNC_COMMON_EVENT_FLUSH (CAM_SYNC_COMMON_EVENT_START + 2)
#define CAM_SYNC_COMMON_EVENT_STOP (CAM_SYNC_COMMON_EVENT_START + 3)
#define CAM_SYNC_COMMON_EVENT_SYNX (CAM_SYNC_COMMON_EVENT_START + 4)
#define CAM_SYNC_COMMON_REG_PAYLOAD_EVENT (CAM_SYNC_COMMON_EVENT_START + 5)
#define CAM_SYNC_COMMON_SYNC_SIGNAL_EVENT (CAM_SYNC_COMMON_EVENT_START + 6)
#define CAM_SYNC_COMMON_RELEASE_EVENT (CAM_SYNC_COMMON_EVENT_START + 7)
#define CAM_SYNC_COMMON_EVENT_END (CAM_SYNC_COMMON_EVENT_START + 50)
/* ISP Sync event reason types */
#define CAM_SYNC_ISP_EVENT_START 20
#define CAM_SYNC_ISP_EVENT_START (CAM_SYNC_COMMON_EVENT_END + 1)
#define CAM_SYNC_ISP_EVENT_UNKNOWN (CAM_SYNC_ISP_EVENT_START + 0)
#define CAM_SYNC_ISP_EVENT_BUBBLE (CAM_SYNC_ISP_EVENT_START + 1)
#define CAM_SYNC_ISP_EVENT_OVERFLOW (CAM_SYNC_ISP_EVENT_START + 2)
@@ -111,13 +115,6 @@
#define CAM_SYNC_OPE_EVENT_HW_RESET_FAILED (CAM_SYNC_OPE_EVENT_START + 10)
#define CAM_SYNC_OPE_EVENT_END (CAM_SYNC_OPE_EVENT_START + 50)
/* Others ioctl/v4l2 Sync event reason types */
#define CAM_SYNC_OTHER_EVENT_START (CAM_SYNC_OPE_EVENT_END + 1)
#define CAM_SYNC_REGISTER_PAYLOAD_EVENT (CAM_SYNC_OTHER_EVENT_START + 0)
#define CAM_SYNC_CAM_SYNC_SIGNAL_EVENT (CAM_SYNC_OTHER_EVENT_START + 1)
#define CAM_SYNC_v4l2_RELEASE_EVENT (CAM_SYNC_OTHER_EVENT_START + 2)
#define CAM_SYNC_OTHER_EVENT_END (CAM_SYNC_OTHER_EVENT_START + 50)
#define CAM_SYNC_EVENT_CNT 7
#define CAM_SYNC_EVENT_REASON_CODE_INDEX 0