Browse Source

msm: camera: isp: Extend SOF timestamp recovery to first frame

Tweak SOF timestamp recovery logic to handle sending timestamp for
first frame. This is needed when due priority inversion, ISP context
notifies timestamp before SOF.

CRs-Fixed: 3085335
Change-Id: I9baea8d906bb8f820c7aeb2d7d4ae1c1c6f348b2
Signed-off-by: Anand Ravi <[email protected]>
Anand Ravi 3 năm trước cách đây
mục cha
commit
6f216cdb87
1 tập tin đã thay đổi với 1 bổ sung7 xóa
  1. 1 7
      drivers/cam_isp/cam_isp_context.c

+ 1 - 7
drivers/cam_isp/cam_isp_context.c

@@ -1176,12 +1176,6 @@ static int __cam_isp_ctx_recover_sof_timestamp(struct cam_context *ctx)
 	uint64_t a, b, c;
 	int rc;
 
-	if (ctx_isp->frame_id < 1) {
-		CAM_ERR(CAM_ISP, "ctx:%u Timestamp recovery is not possible for the first frame",
-			ctx->ctx_id);
-		return -EPERM;
-	}
-
 	rc = __cam_isp_ctx_get_hw_timestamp(ctx, &prev_ts, &curr_ts, &boot_ts);
 	if (rc) {
 		CAM_ERR(CAM_ISP, "ctx:%u Failed to get timestamp from HW", ctx->ctx_id);
@@ -1217,7 +1211,7 @@ static int __cam_isp_ctx_recover_sof_timestamp(struct cam_context *ctx)
 		return 0;
 	}
 
-	ctx_isp->boot_timestamp += (b - a);
+	ctx_isp->boot_timestamp = boot_ts + (b - curr_ts);
 	ctx_isp->sof_timestamp_val = b;
 	ctx_isp->frame_id++;
 	return 0;