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

Commit 53ba6ff9 authored by Vishalsingh Hajeri's avatar Vishalsingh Hajeri
Browse files

msm: camera: Fix the activated state to be flush state



If request is found in pending queue, move the activated
substate to flush state.

Change-Id: Icf96bc8cd7d821c03e7ea83ebac02cc4c8c0c665
Signed-off-by: default avatarVishalsingh Hajeri <vhajeri@codeaurora.org>
parent 0b048bf5
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -1365,10 +1365,12 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx,
	}

	if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ &&
		!cancel_req_id_found)
		CAM_DBG(CAM_ISP,
		!cancel_req_id_found) {
		CAM_INFO(CAM_ISP,
			"Flush request id:%lld is not found in the list",
			flush_req->req_id);
		return -EINVAL;
	}

	return 0;
}
@@ -1396,13 +1398,17 @@ static int __cam_isp_ctx_flush_req_in_activated(
	struct cam_isp_context *ctx_isp;

	ctx_isp = (struct cam_isp_context *) ctx->ctx_priv;
	spin_lock_bh(&ctx->lock);
	ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_FLUSH;
	ctx_isp->frame_skip_count = 2;

	CAM_DBG(CAM_ISP, "Flush request in state %d", ctx->state);
	rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req);

	/* only if request is found in pending queue, move to flush state*/
	if (!rc) {
		spin_lock_bh(&ctx->lock);
		ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_FLUSH;
		ctx_isp->frame_skip_count = 2;
		spin_unlock_bh(&ctx->lock);
	}
	return rc;
}

+2 −0
Original line number Diff line number Diff line
@@ -1447,6 +1447,8 @@ int cam_req_mgr_process_flush_req(void *priv, void *data)
		if (idx < 0) {
			CAM_ERR(CAM_CRM, "req_id %lld not found in input queue",
			flush_info->req_id);
			mutex_unlock(&link->req.lock);
			return -EINVAL;
		} else {
			CAM_DBG(CAM_CRM, "req_id %lld found at idx %d",
				flush_info->req_id, idx);