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

Commit 43583ea4 authored by Shravya Samala's avatar Shravya Samala Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: isp: Bubble processing in case of tasklet delay



In rdi only bubble state if we receive sof then,check
if we are processing any bubble. If yes then active
list should not be cleared else it should be cleared.

CRs-Fixed: 2654966
Change-Id: I552eac22ebccb495ec03311f9e55ac4ec79a9478
Signed-off-by: default avatarShravya Samala <shravyas@codeaurora.org>
parent fa2c72a8
Loading
Loading
Loading
Loading
+20 −3
Original line number Diff line number Diff line
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1419,6 +1419,7 @@ static int __cam_isp_ctx_flush_req_in_top_state(
	spin_unlock_bh(&ctx->lock);

	atomic_set(&ctx_isp->process_bubble, 0);
	atomic_set(&ctx_isp->bubble_sof_count, 0);
	if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_ALL) {
		/* if active and wait list are empty, return */
		spin_lock_bh(&ctx->lock);
@@ -1686,6 +1687,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_applied(
		notify.req_id = req->request_id;
		notify.error = CRM_KMD_ERR_BUBBLE;
		ctx->ctx_crm_intf->notify_err(&notify);
		atomic_set(&ctx_isp->process_bubble, 1);
		CAM_DBG(CAM_ISP, "Notify CRM about Bubble frame %lld",
			ctx_isp->frame_id);
	} else {
@@ -1741,8 +1743,20 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state(
	ctx_isp->frame_id++;
	ctx_isp->sof_timestamp_val = sof_event_data->timestamp;
	ctx_isp->boot_timestamp = sof_event_data->boot_time;
	atomic_inc(&ctx_isp->bubble_sof_count);
	CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx",
		ctx_isp->frame_id, ctx_isp->sof_timestamp_val);

	if (atomic_read(&ctx_isp->process_bubble) &&
		(!list_empty(&ctx->active_req_list)) &&
		(atomic_read(&ctx_isp->bubble_sof_count) <
		 CAM_ISP_CTX_BUBBLE_SOF_COUNT_MAX)) {
		CAM_INFO(CAM_ISP,
			"Processing bubble, bubble_sof_count :%u",
			atomic_read(&ctx_isp->bubble_sof_count));
		goto end;
	}

	/*
	 * Signal all active requests with error and move the  all the active
	 * requests to free list
@@ -1762,8 +1776,11 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state(
			}
		list_add_tail(&req->list, &ctx->free_req_list);
		ctx_isp->active_req_cnt--;
		atomic_set(&ctx_isp->bubble_sof_count, 0);
	}

	ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF;
end:
	/* notify reqmgr with sof signal */
	if (ctx->ctx_crm_intf && ctx->ctx_crm_intf->notify_trigger) {
		notify.link_hdl = ctx->link_hdl;
@@ -1786,8 +1803,6 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state(
	__cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id,
		CAM_REQ_MGR_SOF_EVENT_SUCCESS);

	ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF;

	CAM_DBG(CAM_ISP, "next substate %d",
		ctx_isp->substate_activated);

@@ -2462,6 +2477,7 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx,
	start_isp.start_only = false;

	atomic_set(&ctx_isp->process_bubble, 0);
	atomic_set(&ctx_isp->bubble_sof_count, 0);
	ctx_isp->frame_id = 0;
	ctx_isp->active_req_cnt = 0;
	ctx_isp->reported_req_id = 0;
@@ -2598,6 +2614,7 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock(
	ctx_isp->active_req_cnt = 0;
	ctx_isp->reported_req_id = 0;
	atomic_set(&ctx_isp->process_bubble, 0);
	atomic_set(&ctx_isp->bubble_sof_count, 0);

	CAM_DBG(CAM_ISP, "Stop device success next state %d on ctx %u",
		ctx->state, ctx->ctx_id);
+9 −1
Original line number Diff line number Diff line
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -33,6 +33,11 @@
 */
#define CAM_ISP_CTX_CFG_MAX                     22

/* Maximum allowed sof count in rdi only bubble state
 * till buf_done is received for bubble req_id.
 */
#define CAM_ISP_CTX_BUBBLE_SOF_COUNT_MAX        3

/*
 * Maximum entries in state monitoring array for error logging
 */
@@ -161,6 +166,8 @@ struct cam_isp_context_state_monitor {
 * @cam_isp_ctx_state_monitor: State monitoring array
 * @rdi_only_context:          Get context type information.
 *                             true, if context is rdi only context
 * @bubble_sof_count:          Atomic variable to check if ctx has any sof's
 *                             while processing bubble
 *
 */
struct cam_isp_context {
@@ -186,6 +193,7 @@ struct cam_isp_context {
	struct cam_isp_context_state_monitor cam_isp_ctx_state_monitor[
		CAM_ISP_CTX_STATE_MONITOR_MAX_ENTRIES];
	bool                             rdi_only_context;
	atomic_t                         bubble_sof_count;
};

/**