msm: camera: isp: Add support for handling FCG configurations

This change parses FCG configurations from UMD, handles it
in its corresponding blob handler, then writes exact FCG configs
to the hardware.

During the prepare stage, all FCG update values will be temporarily
stored in req_isp and then utilized by the config function later.
At the end of the blob handler with FCG prepared, a dummy hw update
entry is created for further usage and the size of such entry is based
on the number of reg val pairs and the size of cdm reg random header.

During applying the req in activated state, an algorithm is implemented
to pick exact FCG prediction to be used in SFE/IFE/TFE usecases.

During the config stage, based on the number of skipped frames before,
the exact FCG configurations are passed to SFE/VFE top and then
written into kmd_buf and picked by the CDM. If the number of skipped
frames reaches the maximum that FCG supports or no recorded skipped
frames before, current configuration will be used instead and FCG
entry will be skipped. If the hardware supports multi context like TFE,
wr_sel will be programmed right before the FCG config of each context.

In order to retrieve cpu address of FCG related hw update entry,
a slight change is made in packet parser to pass those addresses
when adding hw update entries.

CRs-Fixed: 3487116
Change-Id: I1db957885933edcbfabc6ce90d72902f4c518118
Signed-off-by: Haochen Yang <quic_haocyang@quicinc.com>
(cherry picked from commit 55213f81a4bd9a847692c00e657e722c1d4ed903)
This commit is contained in:
Haochen Yang
2023-04-28 10:42:27 -07:00
gecommit door Sridhar Gujje
bovenliggende 69f7756ed0
commit 4722b4c478
15 gewijzigde bestanden met toevoegingen van 1501 en 64 verwijderingen

Bestand weergeven

@@ -62,13 +62,13 @@
/* Debug Buffer length*/
#define CAM_ISP_CONTEXT_DBG_BUF_LEN 300
/* AFD pipeline delay for FCG configuration */
#define CAM_ISP_AFD_PIPELINE_DELAY 3
/* Maximum entries in frame record */
#define CAM_ISP_CTX_MAX_FRAME_RECORDS 5
/*
* Congestion count threshold
*/
/* Congestion count threshold */
#define CAM_ISP_CONTEXT_CONGESTION_CNT_MAX 3
/* forward declaration */
@@ -302,6 +302,34 @@ struct cam_isp_context_debug_monitors {
CAM_ISP_CTX_MAX_FRAME_RECORDS];
};
/**
* struct cam_isp_skip_frame_info - FIFO Queue for number of skipped frames for
* the decision of FCG prediction
* @num_frame_skipped: Keep track of the number of skipped frames in between
* of the normal frames
* @list: List member used to append this node to a linked list
*/
struct cam_isp_skip_frame_info {
uint32_t num_frame_skipped;
struct list_head list;
};
/**
* struct cam_isp_fcg_prediction_tracker - Track the number of skipped frames before and
* indicate which FCG prediction should be applied
*
* @num_skipped: Number of skipped frames from previous normally applied frame
* to this normally applied frame
* @sum_skipped: Sum of the number of frames from req generation to req apply
* @skipped_list: Keep track of the number of skipped frames in between from two
* normal frames
*/
struct cam_isp_fcg_prediction_tracker {
uint32_t num_skipped;
uint32_t sum_skipped;
struct list_head skipped_list;
};
/**
* struct cam_isp_context - ISP context object
*
@@ -373,6 +401,8 @@ struct cam_isp_context_debug_monitors {
* by other devices on the link as part of link setup
* @mode_switch_en: Indicates if mode switch is enabled
* @hw_idx: Hardware ID
* @fcg_tracker: FCG prediction tracker containing number of previously skipped
* frames and indicates which prediction should be used
*
*/
struct cam_isp_context {
@@ -436,6 +466,7 @@ struct cam_isp_context {
bool handle_mswitch;
bool mode_switch_en;
uint32_t hw_idx;
struct cam_isp_fcg_prediction_tracker fcg_tracker;
};
/**