|
@@ -395,15 +395,12 @@ static struct cam_axi_vote *cam_sfe_top_delay_bw_reduction(
|
|
uint64_t max_bw = 0;
|
|
uint64_t max_bw = 0;
|
|
|
|
|
|
for (i = 0; i < CAM_DELAY_CLK_BW_REDUCTION_NUM_REQ; i++) {
|
|
for (i = 0; i < CAM_DELAY_CLK_BW_REDUCTION_NUM_REQ; i++) {
|
|
- if (top_priv->last_total_bw_vote[i] > max_bw) {
|
|
|
|
|
|
+ if (top_priv->last_total_bw_vote[i] >= max_bw) {
|
|
vote_idx = i;
|
|
vote_idx = i;
|
|
max_bw = top_priv->last_total_bw_vote[i];
|
|
max_bw = top_priv->last_total_bw_vote[i];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (vote_idx < 0)
|
|
|
|
- return NULL;
|
|
|
|
-
|
|
|
|
*to_be_applied_bw = max_bw;
|
|
*to_be_applied_bw = max_bw;
|
|
|
|
|
|
return &top_priv->last_bw_vote[vote_idx];
|
|
return &top_priv->last_bw_vote[vote_idx];
|
|
@@ -507,16 +504,12 @@ int cam_sfe_top_calc_axi_bw_vote(struct cam_sfe_top_priv *top_priv,
|
|
CAM_DELAY_CLK_BW_REDUCTION_NUM_REQ;
|
|
CAM_DELAY_CLK_BW_REDUCTION_NUM_REQ;
|
|
} else {
|
|
} else {
|
|
/*
|
|
/*
|
|
- * Find max bw request in last few frames. This will the bw
|
|
|
|
|
|
+ * Find max bw request in last few frames. This will be the bw
|
|
* that we want to vote to CPAS now.
|
|
* that we want to vote to CPAS now.
|
|
*/
|
|
*/
|
|
final_bw_vote = cam_sfe_top_delay_bw_reduction(top_priv, total_bw_new_vote);
|
|
final_bw_vote = cam_sfe_top_delay_bw_reduction(top_priv, total_bw_new_vote);
|
|
- if (!final_bw_vote) {
|
|
|
|
- CAM_ERR(CAM_PERF, "to_be_applied_axi_vote is NULL, req_id:%llu",
|
|
|
|
- request_id);
|
|
|
|
- top_priv->bw_state = CAM_CLK_BW_STATE_UNCHANGED;
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
|
|
+ if (*total_bw_new_vote == 0)
|
|
|
|
+ CAM_DBG(CAM_PERF, "to_be_applied_axi_vote is 0, req_id:%llu", request_id);
|
|
}
|
|
}
|
|
|
|
|
|
for (i = 0; i < final_bw_vote->num_paths; i++) {
|
|
for (i = 0; i < final_bw_vote->num_paths; i++) {
|
|
@@ -546,11 +539,10 @@ int cam_sfe_top_calc_axi_bw_vote(struct cam_sfe_top_priv *top_priv,
|
|
top_priv->bw_state = CAM_CLK_BW_STATE_DECREASE;
|
|
top_priv->bw_state = CAM_CLK_BW_STATE_DECREASE;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
CAM_DBG(CAM_PERF,
|
|
CAM_DBG(CAM_PERF,
|
|
"sfe[%d] : Delayed update: applied_total=%lld new_total=%lld, start_stop=%d bw_state=%s req_id=%ld",
|
|
"sfe[%d] : Delayed update: applied_total=%lld new_total=%lld, start_stop=%d bw_state=%s req_id=%ld",
|
|
top_priv->common_data.hw_intf->hw_idx, top_priv->total_bw_applied,
|
|
top_priv->common_data.hw_intf->hw_idx, top_priv->total_bw_applied,
|
|
- total_bw_new_vote, start_stop,
|
|
|
|
|
|
+ *total_bw_new_vote, start_stop,
|
|
cam_sfe_top_clk_bw_state_to_string(top_priv->bw_state),
|
|
cam_sfe_top_clk_bw_state_to_string(top_priv->bw_state),
|
|
(start_stop ? -1 : request_id));
|
|
(start_stop ? -1 : request_id));
|
|
|
|
|