msm: camera: sync: Add SYNC_V4L_EVENT_V2 support in sync driver

Add SYNC_V4L_EVENT_V2 support in sync driver. As part of this
change, added the reason code field as part of sync event header.
This failure reason code is filled by camera kernel driver and
propagate to userspace.

CRs-Fixed: 2750553
Change-Id: I206d0d51c38cfe4214814b89d241f51c1f50605b
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
This commit is contained in:
Alok Chauhan
2020-07-28 21:42:02 +05:30
parent f64d8b76f2
commit 1d1edb7030
10 changed files with 251 additions and 53 deletions

View File

@@ -182,7 +182,8 @@ 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_STATE_SIGNALED_SUCCESS,
CAM_SYNC_EVENT_SUCCESS);
if (rc)
CAM_ERR(CAM_CUSTOM, "Sync failed with rc = %d", rc);
@@ -368,7 +369,8 @@ static int __cam_custom_ctx_flush_req(struct cam_context *ctx,
req_custom->fence_map_out[i].sync_id);
rc = cam_sync_signal(
req_custom->fence_map_out[i].sync_id,
CAM_SYNC_STATE_SIGNALED_CANCEL);
CAM_SYNC_STATE_SIGNALED_CANCEL,
CAM_SYNC_EVENT_FLUSH);
if (rc)
CAM_ERR_RATE_LIMIT(CAM_CUSTOM,
"signal fence failed\n");
@@ -543,7 +545,8 @@ static int __cam_custom_stop_dev_core(
if (req_custom->fence_map_out[i].sync_id != -1) {
cam_sync_signal(
req_custom->fence_map_out[i].sync_id,
CAM_SYNC_STATE_SIGNALED_CANCEL);
CAM_SYNC_STATE_SIGNALED_CANCEL,
CAM_SYNC_EVENT_STOP);
}
list_add_tail(&req->list, &ctx->free_req_list);
}
@@ -559,7 +562,8 @@ static int __cam_custom_stop_dev_core(
if (req_custom->fence_map_out[i].sync_id != -1) {
cam_sync_signal(
req_custom->fence_map_out[i].sync_id,
CAM_SYNC_STATE_SIGNALED_CANCEL);
CAM_SYNC_STATE_SIGNALED_CANCEL,
CAM_SYNC_EVENT_STOP);
}
list_add_tail(&req->list, &ctx->free_req_list);
}
@@ -575,7 +579,8 @@ static int __cam_custom_stop_dev_core(
if (req_custom->fence_map_out[i].sync_id != -1) {
cam_sync_signal(
req_custom->fence_map_out[i].sync_id,
CAM_SYNC_STATE_SIGNALED_CANCEL);
CAM_SYNC_STATE_SIGNALED_CANCEL,
CAM_SYNC_EVENT_STOP);
}
list_add_tail(&req->list, &ctx->free_req_list);
}