msm: camera: isp: Add debug info in ISP state machine

Monitor frame events driving the state machine.
To better understand what led to the state machine stalling update
debug info that is logged on errors.

CRs-Fixed: 3309151
Change-Id: Iccf0efd82069b342e5d4b1731292604d37263b0b
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
This commit is contained in:
Karthik Anantha Ram
2021-10-21 21:08:33 -07:00
committed by Camera Software Integration
parent ba3f945f46
commit 81a980cf07
6 changed files with 300 additions and 97 deletions

View File

@@ -62,6 +62,15 @@
/* Debug Buffer length*/
#define CAM_ISP_CONTEXT_DBG_BUF_LEN 300
/* Maximum entries in frame record */
#define CAM_ISP_CTX_MAX_FRAME_RECORDS 5
/*
* Congestion count threshold
*/
#define CAM_ISP_CONTEXT_CONGESTION_CNT_MAX 3
/* forward declaration */
struct cam_isp_context;
@@ -243,6 +252,56 @@ struct cam_isp_context_event_record {
ktime_t timestamp;
};
/**
*
*
* struct cam_isp_context_frame_timing_record - Frame timing events
*
* @sof_ts: SOF timestamp
* @eof_ts: EOF ts
* @epoch_ts: EPOCH ts
* @secondary_sof_ts: Secondary SOF ts
*
*/
struct cam_isp_context_frame_timing_record {
struct timespec64 sof_ts;
struct timespec64 eof_ts;
struct timespec64 epoch_ts;
struct timespec64 secondary_sof_ts;
};
/**
*
*
* struct cam_isp_context_debug_monitors - ISP context debug monitors
*
* @state_monitor_head: State machine monitor head
* @state_monitor: State machine monitor info
* @event_record_head: Request Event monitor head
* @event_record: Request event monitor info
* @frame_monitor_head: Frame timing monitor head
* @frame_monitor: Frame timing event monitor
*
*/
struct cam_isp_context_debug_monitors {
/* State machine monitoring */
atomic64_t state_monitor_head;
struct cam_isp_context_state_monitor state_monitor[
CAM_ISP_CTX_STATE_MONITOR_MAX_ENTRIES];
/* Req event monitor */
atomic64_t event_record_head[
CAM_ISP_CTX_EVENT_MAX];
struct cam_isp_context_event_record event_record[
CAM_ISP_CTX_EVENT_MAX][CAM_ISP_CTX_EVENT_RECORD_MAX_ENTRIES];
/* Frame timing monitor */
atomic64_t frame_monitor_head;
struct cam_isp_context_frame_timing_record frame_monitor[
CAM_ISP_CTX_MAX_FRAME_RECORDS];
};
/**
* struct cam_isp_context - ISP context object
*
@@ -271,11 +330,11 @@ struct cam_isp_context_event_record {
* @aeb_error_cnt: Count number of times a specific AEB error scenario is
* enountered
* @out_of_sync_cnt: Out of sync error count for AEB
* @congestion_cnt: Count number of times congestion was encountered
* consecutively
* @state_monitor_head: Write index to the state monitoring array
* @req_info Request id information about last buf done
* @cam_isp_ctx_state_monitor: State monitoring array
* @event_record_head: Write index to the state monitoring array
* @event_record: Event record array
* @dbg_monitors: Debug monitors for ISP context
* @rdi_only_context: Get context type information.
* true, if context is rdi only context
* @offline_context: Indicate whether context is for offline IFE
@@ -341,14 +400,12 @@ struct cam_isp_context {
uint32_t bubble_frame_cnt;
uint32_t aeb_error_cnt;
uint32_t out_of_sync_cnt;
uint32_t congestion_cnt;
atomic64_t state_monitor_head;
struct cam_isp_context_state_monitor cam_isp_ctx_state_monitor[
CAM_ISP_CTX_STATE_MONITOR_MAX_ENTRIES];
struct cam_isp_context_req_id_info req_info;
atomic64_t event_record_head[
CAM_ISP_CTX_EVENT_MAX];
struct cam_isp_context_event_record event_record[
CAM_ISP_CTX_EVENT_MAX][CAM_ISP_CTX_EVENT_RECORD_MAX_ENTRIES];
struct cam_isp_context_debug_monitors dbg_monitors;
bool rdi_only_context;
bool offline_context;
bool vfps_aux_context;