Merge "msm: camera: reqmgr: Reduce delay by one frame during bubble recovery" into camera-kernel.lnx.4.0

This commit is contained in:
Camera Software Integration 2020-02-03 14:10:09 -08:00 • committed by Gerrit - the friendly Code Review server
commit d9c3665f6b
3 changed files with 51 additions and 0 deletions

View file

@ -1105,6 +1105,11 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
notify.dev_hdl = ctx->dev_hdl;
notify.req_id = req->request_id;
notify.error = CRM_KMD_ERR_BUBBLE;
notify.trigger = 0;
if (ctx_isp->subscribe_event & CAM_TRIGGER_POINT_SOF)
notify.trigger = CAM_TRIGGER_POINT_SOF;
notify.frame_id = ctx_isp->frame_id;
notify.sof_timestamp_val = ctx_isp->sof_timestamp_val;
CAM_WARN(CAM_ISP,
"Notify CRM about Bubble req %lld frame %lld, ctx %u",
req->request_id, ctx_isp->frame_id, ctx->ctx_id);
@ -1269,6 +1274,11 @@ static int __cam_isp_ctx_epoch_in_bubble_applied(
notify.dev_hdl = ctx->dev_hdl;
notify.req_id = req->request_id;
notify.error = CRM_KMD_ERR_BUBBLE;
notify.trigger = 0;
if (ctx_isp->subscribe_event & CAM_TRIGGER_POINT_SOF)
notify.trigger = CAM_TRIGGER_POINT_SOF;
notify.frame_id = ctx_isp->frame_id;
notify.sof_timestamp_val = ctx_isp->sof_timestamp_val;
CAM_WARN(CAM_REQ,
"Notify CRM about Bubble req_id %llu frame %lld, ctx %u",
req->request_id, ctx_isp->frame_id, ctx->ctx_id);
@ -2573,6 +2583,11 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_applied(
notify.dev_hdl = ctx->dev_hdl;
notify.req_id = req->request_id;
notify.error = CRM_KMD_ERR_BUBBLE;
notify.trigger = 0;
if (ctx_isp->subscribe_event & CAM_TRIGGER_POINT_SOF)
notify.trigger = CAM_TRIGGER_POINT_SOF;
notify.frame_id = ctx_isp->frame_id;
notify.sof_timestamp_val = ctx_isp->sof_timestamp_val;
CAM_WARN(CAM_ISP,
"Notify CRM about Bubble req %lld frame %lld ctx %u",
req->request_id,

View file

@ -2329,6 +2329,35 @@ end:
return rc;
}
/**
* __cam_req_mgr_apply_on_bubble()
*
* @brief : This API tries to apply settings to the device
* with highest pd on the bubbled frame
* @link : link information.
* @err_info : contains information about frame_id, trigger etc.
*
*/
void __cam_req_mgr_apply_on_bubble(
struct cam_req_mgr_core_link *link,
struct cam_req_mgr_error_notify *err_info)
{
int rc = 0;
struct cam_req_mgr_trigger_notify trigger_data;
trigger_data.dev_hdl = err_info->dev_hdl;
trigger_data.frame_id = err_info->frame_id;
trigger_data.link_hdl = err_info->link_hdl;
trigger_data.sof_timestamp_val =
err_info->sof_timestamp_val;
trigger_data.trigger = err_info->trigger;
rc = __cam_req_mgr_process_req(link, &trigger_data);
if (rc)
CAM_ERR(CAM_CRM,
"Failed to apply request on bubbled frame");
}
/**
* cam_req_mgr_process_error()
*
@ -2419,6 +2448,7 @@ int cam_req_mgr_process_error(void *priv, void *data)
link->state = CAM_CRM_LINK_STATE_ERR;
spin_unlock_bh(&link->link_state_spin_lock);
link->open_req_cnt++;
__cam_req_mgr_apply_on_bubble(link, err_info);
}
}
mutex_unlock(&link->req.lock);

View file

@ -234,12 +234,18 @@ struct cam_req_mgr_timer_notify {
* @link_hdl : link identifier
* @dev_hdl : device handle which has sent this req id
* @req_id : req id which hit error
* @frame_id : frame id for internal tracking
* @trigger : trigger point of this notification, CRM will send apply
* @sof_timestamp_val : Captured time stamp value at sof hw event
* @error : what error device hit while processing this req
*/
struct cam_req_mgr_error_notify {
int32_t link_hdl;
int32_t dev_hdl;
uint64_t req_id;
int64_t frame_id;
uint32_t trigger;
uint64_t sof_timestamp_val;
enum cam_req_mgr_device_error error;
};