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

Commit a4a349c8 authored by Alok Pandey's avatar Alok Pandey Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: req_mgr: Sending event_cause for frame error for shima



When camnoc fill level for RDI port goes beyond 25%, notify UMD
with BAD frames to take corrective actions.

CRs-Fixed: 2913934
Change-Id: I5427ce94cdd2a48d8647ff4593cb1605a2f90a37
Signed-off-by: default avatarAlok Pandey <akumarpa@codeaurora.org>
parent eefcfe50
Loading
Loading
Loading
Loading
+47 −18
Original line number Diff line number Diff line
@@ -899,8 +899,9 @@ static int __cam_isp_ctx_handle_buf_done_for_request(

	req_isp = (struct cam_isp_ctx_req *) req->req_priv;

	CAM_DBG(CAM_ISP, "Enter with bubble_state %d, req_bubble_detected %d",
		bubble_state, req_isp->bubble_detected);
	CAM_DBG(CAM_ISP,
		"Enter with bubble_state %d, req_bubble_detected %d evt_param = %d",
		bubble_state, req_isp->bubble_detected, done->evt_param);

	done_next_req->num_handles = 0;
	done_next_req->timestamp = done->timestamp;
@@ -956,15 +957,28 @@ static int __cam_isp_ctx_handle_buf_done_for_request(

		if (!req_isp->bubble_detected) {
			CAM_DBG(CAM_ISP,
				"Sync with success: req %lld res 0x%x fd 0x%x, ctx %u",
				"Sync with success: req %lld res 0x%x fd 0x%x, ctx %u, Bad_frame %u",
				req->request_id,
				req_isp->fence_map_out[j].resource_handle,
				req_isp->fence_map_out[j].sync_id,
				ctx->ctx_id);
				ctx->ctx_id, done->evt_param);

			if (done->evt_param == 1) {

				CAM_WARN(CAM_ISP,
					"Bad frame Sync with success: req %lld res 0x%x fd 0x%x, ctx %u",
					req->request_id,
					req_isp->fence_map_out[j].resource_handle,
					req_isp->fence_map_out[j].sync_id,
					ctx->ctx_id);
				rc = cam_sync_signal(req_isp->fence_map_out[j].sync_id,
					CAM_SYNC_STATE_SIGNALED_SUCCESS,
					CAM_SYNC_ISP_EVENT_BAD_FRAME);
			} else {
				rc = cam_sync_signal(req_isp->fence_map_out[j].sync_id,
					CAM_SYNC_STATE_SIGNALED_SUCCESS,
					CAM_SYNC_COMMON_EVENT_SUCCESS);
			}
			if (rc)
				CAM_DBG(CAM_ISP, "Sync failed with rc = %d",
					rc);
@@ -1104,13 +1118,15 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr(
	struct cam_isp_ctx_req *req_isp;
	struct cam_context *ctx = ctx_isp->base;
	const char *handle_type;
	uint32_t event_cause = CAM_SYNC_COMMON_EVENT_SUCCESS;

	trace_cam_buf_done("ISP", ctx, req);

	req_isp = (struct cam_isp_ctx_req *) req->req_priv;

	CAM_DBG(CAM_ISP, "Enter with bubble_state %d, req_bubble_detected %d",
		bubble_state, req_isp->bubble_detected);
	CAM_DBG(CAM_ISP,
		"Enter with bubble_state %d, req_bubble_detected %d evt_param %d",
		bubble_state, req_isp->bubble_detected, done->evt_param);

	for (i = 0; i < done->num_handles; i++) {
		for (j = 0; j < req_isp->num_fence_map_out; j++) {
@@ -1185,15 +1201,28 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr(
			continue;
		} else if (!req_isp->bubble_detected) {
			CAM_DBG(CAM_ISP,
				"Sync with success: req %lld res 0x%x fd 0x%x, ctx %u",
				"Sync with success: req %lld res 0x%x fd 0x%x, ctx %u isBadFrame %u",
				req->request_id,
				req_isp->fence_map_out[j].resource_handle,
				req_isp->fence_map_out[j].sync_id,
				ctx->ctx_id, done->evt_param);
			if (done->evt_param == 1) {
				CAM_WARN(CAM_ISP,
					"Bad Frame Sync with success: req %lld res 0x%x fd 0x%x, ctx %u",
					req->request_id,
					req_isp->fence_map_out[j].resource_handle,
					req_isp->fence_map_out[j].sync_id,
					ctx->ctx_id);

				rc = cam_sync_signal(req_isp->fence_map_out[j].sync_id,
					CAM_SYNC_STATE_SIGNALED_SUCCESS,
					CAM_SYNC_ISP_EVENT_BAD_FRAME);
				event_cause = CAM_SYNC_ISP_EVENT_BAD_FRAME;
			} else {
				rc = cam_sync_signal(req_isp->fence_map_out[j].sync_id,
					CAM_SYNC_STATE_SIGNALED_SUCCESS,
					CAM_SYNC_COMMON_EVENT_SUCCESS);
				event_cause = CAM_SYNC_COMMON_EVENT_SUCCESS;
			}
			if (rc) {
				CAM_DBG(CAM_ISP, "Sync failed with rc = %d",
				 rc);
@@ -1202,7 +1231,7 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr(
				__cam_isp_handle_deferred_buf_done(ctx_isp,
					req, false,
					CAM_SYNC_STATE_SIGNALED_SUCCESS,
					CAM_SYNC_COMMON_EVENT_SUCCESS);
					event_cause);
			}
		} else if (!req_isp->bubble_report) {
			CAM_DBG(CAM_ISP,
+1 −0
Original line number Diff line number Diff line
@@ -8022,6 +8022,7 @@ static int cam_ife_hw_mgr_handle_hw_buf_done(
	buf_done_event_data.resource_handle[0] = event_info->res_id;
	buf_done_event_data.last_consumed_addr[0] =
		event_info->reg_val;
	buf_done_event_data.evt_param = event_info->evt_param;

	if (atomic_read(&ife_hw_mgr_ctx->overflow_pending))
		return 0;
+3 −2
Original line number Diff line number Diff line
@@ -194,7 +194,7 @@ struct cam_isp_hw_epoch_event_data {
 * @resource_handle:       Resource handle array
 * @last_consumed_addr:    Last consumed addr
 * @timestamp:             Timestamp for the buf done event
 *
 * @evt_param:             Specific info about the frame
 */
struct cam_isp_hw_done_event_data {
	uint32_t             num_handles;
@@ -203,6 +203,7 @@ struct cam_isp_hw_done_event_data {
	uint32_t             last_consumed_addr[
				CAM_NUM_OUT_PER_COMP_IRQ_MAX];
	uint64_t             timestamp;
	uint32_t             evt_param;
};

/**
+2 −1
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ struct cam_isp_blanking_config {
 * @hw_idx:         IFE hw index
 * @err_type:       Error type if any
 * @reg_val:        Any critical register value captured during irq handling
 *
 * @evt_param       Specific info about frame
 */
struct cam_isp_hw_event_info {
	enum cam_isp_resource_type     res_type;
@@ -224,6 +224,7 @@ struct cam_isp_hw_event_info {
	uint32_t                       hw_idx;
	uint32_t                       err_type;
	uint32_t                       reg_val;
	uint32_t                       evt_param;
};

/*
+4 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
 */

#ifndef _CAM_VFE_HW_INTF_H_
@@ -14,6 +14,7 @@
#define CAM_VFE_HW_NUM_MAX            7

#define VFE_CORE_BASE_IDX             0
#define CAMNOC_CORE_BASE_IDX          1
#define RT_BASE_IDX                   2
/*
 * VBIF and BUS do not exist on same HW.
@@ -320,6 +321,7 @@ struct cam_vfe_top_irq_evt_payload {
 *                           handled
 * @error_type:              Identify different errors
 * @ts:                      Timestamp
 * @evt_param                Specific info about frame
 */
struct cam_vfe_bus_irq_evt_payload {
	struct list_head            list;
@@ -331,6 +333,7 @@ struct cam_vfe_bus_irq_evt_payload {
	uint32_t                    evt_id;
	uint32_t                    irq_reg_val[CAM_IFE_BUS_IRQ_REGISTERS_MAX];
	struct cam_isp_timestamp    ts;
	uint32_t                    evt_param;
};

/**
Loading