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

Commit 49708f86 authored by Shravya Samala's avatar Shravya Samala
Browse files

msm: camera: isp: Increment bubble frame count correctly



In certain scenarios due to tasklet congestion,
back to back sof were seen and this will lead to
wrong bubble frame count. As a result, after
moving request from active list, same request
will be re-applied. Hence increment bubble frame
count only if last sof timestamp is different
from current sof timestamp.

CRs-Fixed: 2831372
Change-Id: I8977233c001e2f31f4c7bf5e86d95b1849023d86
Signed-off-by: default avatarShravya Samala <shravyas@codeaurora.org>
parent 5cbba714
Loading
Loading
Loading
Loading
+19 −7
Original line number Diff line number Diff line
@@ -1254,13 +1254,25 @@ static int __cam_isp_ctx_notify_sof_in_activated_state(
				req->request_id,
				ctx_isp->active_req_cnt, ctx->ctx_id);
		} else if (req_isp->bubble_detected) {
			if (ctx_isp->last_sof_timestamp !=
				ctx_isp->sof_timestamp_val) {
				ctx_isp->bubble_frame_cnt++;
				CAM_DBG(CAM_ISP,
				"Waiting on bufdone for bubble req: %lld, since frame_cnt = %lld",
				req->request_id, ctx_isp->bubble_frame_cnt);
					"Waiting on bufdone bubble req %lld ctx %u frame_cnt %lld link 0x%x",
					req->request_id, ctx->ctx_id,
					ctx_isp->bubble_frame_cnt,
					ctx->link_hdl);
			} else {
				CAM_DBG(CAM_ISP,
					"Possible tasklet delay req %lld ctx %u link 0x%x ts %lld",
					req->request_id, ctx->ctx_id,
					ctx->link_hdl,
					ctx_isp->sof_timestamp_val);
			}
		} else
			CAM_DBG(CAM_ISP, "Delayed bufdone for req: %lld",
				req->request_id);
			CAM_DBG(CAM_ISP,
				"Delayed bufdone for req: %lld ctx %u link 0x%x",
				req->request_id, ctx->ctx_id, ctx->link_hdl);
	}

	if (ctx->ctx_crm_intf && ctx->ctx_crm_intf->notify_trigger &&
@@ -1306,7 +1318,7 @@ static int __cam_isp_ctx_notify_sof_in_activated_state(
			ctx->ctx_id);
		rc = -EFAULT;
	}

	ctx_isp->last_sof_timestamp = ctx_isp->sof_timestamp_val;
	return 0;
}

+2 −0
Original line number Diff line number Diff line
@@ -256,6 +256,7 @@ struct cam_isp_context_event_record {
 *                             decide whether to apply request in offline ctx
 * @workq:                     Worker thread for offline ife
 * @trigger_id:                ID provided by CRM for each ctx on the link
 * @last_sof_timestamp:        SOF timestamp of the last frame
 *
 */
struct cam_isp_context {
@@ -298,6 +299,7 @@ struct cam_isp_context {
	atomic_t                              rxd_epoch;
	struct cam_req_mgr_core_workq        *workq;
	int32_t                               trigger_id;
	uint64_t                              last_sof_timestamp;
};

/**