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

@@ -24,19 +24,20 @@
static struct cam_jpeg_dev g_jpeg_dev;
static int cam_jpeg_dev_err_inject_cb(void *err_param)
static int cam_jpeg_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 < CAM_JPEG_CTX_MAX; i++) {
if (g_jpeg_dev.ctx[i].dev_hdl ==
((struct cam_err_inject_param *)err_param)->dev_hdl) {
CAM_INFO(CAM_ISP, "dev_hdl found:%d", g_jpeg_dev.ctx[i].dev_hdl);
cam_context_add_err_inject(&g_jpeg_dev.ctx[i], err_param);
if (g_jpeg_dev.ctx[i].dev_hdl == inject_params->dev_hdl) {
cam_context_add_evt_inject(&g_jpeg_dev.ctx[i],
&inject_params->evt_params);
return 0;
}
}
CAM_ERR(CAM_ISP, "no dev hdl found jpeg");
CAM_ERR(CAM_JPEG, "No dev hdl found %d", inject_params->dev_hdl);
return -EINVAL;
}
@@ -191,8 +192,8 @@ static int cam_jpeg_dev_component_bind(struct device *dev,
}
}
cam_common_register_err_inject_cb(cam_jpeg_dev_err_inject_cb,
CAM_COMMON_ERR_INJECT_HW_JPEG);
cam_common_register_evt_inject_cb(cam_jpeg_dev_evt_inject_cb,
CAM_COMMON_EVT_INJECT_HW_JPEG);
rc = cam_node_init(node, &hw_mgr_intf, g_jpeg_dev.ctx, CAM_JPEG_CTX_MAX,
CAM_JPEG_DEV_NAME);