msm: camera: common: Enhance error injection framework

Update from error injection framework to event injection framework to
support PF event inducement and node event. Different set of user
input parameters are required dependent on which event to injection.

ICP and ISP support error event and page fault event injection. JPEG
supports node event and page fault event injection. However, buf done
error injection is only supported for JPEG and ICP.

Create a query API to check whether PF is fatal for a context bank.
Using the API, if PF is fatal, page fault event injection is not
supported for the device that owns the context bank.

Make change to JPEG context event callback handling to account for
various events including Event Injection event.

CRs-Fixed: 3210139
Change-Id: I582ee0bda8dbf631ece2522a5a8145f38ec71928
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
This commit is contained in:
Sokchetra Eung
2022-05-24 17:50:49 -07:00
committed by Camera Software Integration
parent 4e06429fc8
commit c87d8891b9
22 changed files with 1237 additions and 472 deletions

View File

@@ -25,18 +25,20 @@
static struct cam_isp_dev g_isp_dev;
static int cam_isp_dev_err_inject_cb(void *err_param)
static int cam_isp_dev_evt_inject_cb(void *inject_args)
{
int i = 0;
struct cam_common_inject_evt_param *inject_params = inject_args;
int i;
for (i = 0; i < g_isp_dev.max_context; i++) {
if ((g_isp_dev.ctx[i].dev_hdl) ==
((struct cam_err_inject_param *)err_param)->dev_hdl) {
cam_context_add_err_inject(&g_isp_dev.ctx[i], err_param);
if (g_isp_dev.ctx[i].dev_hdl == inject_params->dev_hdl) {
cam_context_add_evt_inject(&g_isp_dev.ctx[i],
&inject_params->evt_params);
return 0;
}
}
CAM_ERR(CAM_ISP, "no dev hdl found for IFE");
CAM_ERR(CAM_ISP, "No dev hdl found %d", inject_params->dev_hdl);
return -ENODEV;
}
@@ -217,8 +219,8 @@ static int cam_isp_dev_component_bind(struct device *dev,
}
}
cam_common_register_err_inject_cb(cam_isp_dev_err_inject_cb,
CAM_COMMON_ERR_INJECT_HW_ISP);
cam_common_register_evt_inject_cb(cam_isp_dev_evt_inject_cb,
CAM_COMMON_EVT_INJECT_HW_ISP);
rc = cam_node_init(node, &hw_mgr_intf, g_isp_dev.ctx,
g_isp_dev.max_context, CAM_ISP_DEV_NAME);