msm: camera: common: Merge camera-kernel.3.1 changes in camera-kernel.4.0
msm: camera: cdm: Fix dangling pointer issue msm: camera: cdm: change work record to atomic variable msm: camera: utils: Adding device type to track device handles msm: camera: tfe: Reduce stack footprint during bw vote msm: camera: req_mgr: Thread switch delay detection mechanisms msm: camera: cdm: Avoid submitting BL if FIFO is full msm: camera: tfe: check cdm hang in the tfe config timeout msm: camera: req_mgr: Delay detection mechanism msm: camera: cdm: Debug info in case of cdm page fault msm: camera: isp: Max context reduction for TFE in isp driver msm: camera: ope: Maintain current clock value during acquire msm: camera: req_mgr: Limit CAM_ERR log in case of no empty task msm: camera: cdm: Decrement write-count only after Bl commit msm: camera: isp: Added CSID recovery mechanism. CRs-Fixed: 2792394 Change-Id: I1c7a903ae15b572acf3f6318cda7394cb6549c8d Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
This commit is contained in:
@@ -96,7 +96,6 @@ static int cam_isp_dev_component_bind(struct device *dev,
|
||||
struct cam_hw_mgr_intf hw_mgr_intf;
|
||||
struct cam_node *node;
|
||||
const char *compat_str = NULL;
|
||||
uint32_t isp_device_type;
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
|
||||
int iommu_hdl = -1;
|
||||
@@ -109,11 +108,13 @@ static int cam_isp_dev_component_bind(struct device *dev,
|
||||
if (strnstr(compat_str, "ife", strlen(compat_str))) {
|
||||
rc = cam_subdev_probe(&g_isp_dev.sd, pdev, CAM_ISP_DEV_NAME,
|
||||
CAM_IFE_DEVICE_TYPE);
|
||||
isp_device_type = CAM_IFE_DEVICE_TYPE;
|
||||
g_isp_dev.isp_device_type = CAM_IFE_DEVICE_TYPE;
|
||||
g_isp_dev.max_context = CAM_IFE_CTX_MAX;
|
||||
} else if (strnstr(compat_str, "tfe", strlen(compat_str))) {
|
||||
rc = cam_subdev_probe(&g_isp_dev.sd, pdev, CAM_ISP_DEV_NAME,
|
||||
CAM_TFE_DEVICE_TYPE);
|
||||
isp_device_type = CAM_TFE_DEVICE_TYPE;
|
||||
g_isp_dev.isp_device_type = CAM_TFE_DEVICE_TYPE;
|
||||
g_isp_dev.max_context = CAM_TFE_CTX_MAX;
|
||||
} else {
|
||||
CAM_ERR(CAM_ISP, "Invalid ISP hw type %s", compat_str);
|
||||
rc = -EINVAL;
|
||||
@@ -127,30 +128,51 @@ static int cam_isp_dev_component_bind(struct device *dev,
|
||||
node = (struct cam_node *) g_isp_dev.sd.token;
|
||||
|
||||
memset(&hw_mgr_intf, 0, sizeof(hw_mgr_intf));
|
||||
rc = cam_isp_hw_mgr_init(compat_str, &hw_mgr_intf, &iommu_hdl);
|
||||
if (rc != 0) {
|
||||
CAM_ERR(CAM_ISP, "Can not initialized ISP HW manager!");
|
||||
g_isp_dev.ctx = kcalloc(g_isp_dev.max_context,
|
||||
sizeof(struct cam_context),
|
||||
GFP_KERNEL);
|
||||
if (!g_isp_dev.ctx) {
|
||||
CAM_ERR(CAM_ISP,
|
||||
"Mem Allocation failed for ISP base context");
|
||||
goto unregister;
|
||||
}
|
||||
|
||||
for (i = 0; i < CAM_CTX_MAX; i++) {
|
||||
g_isp_dev.ctx_isp = kcalloc(g_isp_dev.max_context,
|
||||
sizeof(struct cam_isp_context),
|
||||
GFP_KERNEL);
|
||||
if (!g_isp_dev.ctx_isp) {
|
||||
CAM_ERR(CAM_ISP,
|
||||
"Mem Allocation failed for Isp private context");
|
||||
kfree(g_isp_dev.ctx);
|
||||
g_isp_dev.ctx = NULL;
|
||||
goto unregister;
|
||||
}
|
||||
|
||||
rc = cam_isp_hw_mgr_init(compat_str, &hw_mgr_intf, &iommu_hdl);
|
||||
if (rc != 0) {
|
||||
CAM_ERR(CAM_ISP, "Can not initialized ISP HW manager!");
|
||||
goto kfree;
|
||||
}
|
||||
|
||||
for (i = 0; i < g_isp_dev.max_context; i++) {
|
||||
rc = cam_isp_context_init(&g_isp_dev.ctx_isp[i],
|
||||
&g_isp_dev.ctx[i],
|
||||
&node->crm_node_intf,
|
||||
&node->hw_mgr_intf,
|
||||
i,
|
||||
isp_device_type);
|
||||
g_isp_dev.isp_device_type);
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_ISP, "ISP context init failed!");
|
||||
goto unregister;
|
||||
goto kfree;
|
||||
}
|
||||
}
|
||||
|
||||
rc = cam_node_init(node, &hw_mgr_intf, g_isp_dev.ctx, CAM_CTX_MAX,
|
||||
CAM_ISP_DEV_NAME);
|
||||
rc = cam_node_init(node, &hw_mgr_intf, g_isp_dev.ctx,
|
||||
g_isp_dev.max_context, CAM_ISP_DEV_NAME);
|
||||
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_ISP, "ISP node init failed!");
|
||||
goto unregister;
|
||||
goto kfree;
|
||||
}
|
||||
|
||||
cam_smmu_set_client_page_fault_handler(iommu_hdl,
|
||||
@@ -161,6 +183,13 @@ static int cam_isp_dev_component_bind(struct device *dev,
|
||||
CAM_DBG(CAM_ISP, "Component bound successfully");
|
||||
|
||||
return 0;
|
||||
|
||||
kfree:
|
||||
kfree(g_isp_dev.ctx);
|
||||
g_isp_dev.ctx = NULL;
|
||||
kfree(g_isp_dev.ctx_isp);
|
||||
g_isp_dev.ctx_isp = NULL;
|
||||
|
||||
unregister:
|
||||
rc = cam_subdev_remove(&g_isp_dev.sd);
|
||||
err:
|
||||
@@ -180,13 +209,18 @@ static void cam_isp_dev_component_unbind(struct device *dev,
|
||||
|
||||
cam_isp_hw_mgr_deinit(compat_str);
|
||||
/* clean up resources */
|
||||
for (i = 0; i < CAM_CTX_MAX; i++) {
|
||||
for (i = 0; i < g_isp_dev.max_context; i++) {
|
||||
rc = cam_isp_context_deinit(&g_isp_dev.ctx_isp[i]);
|
||||
if (rc)
|
||||
CAM_ERR(CAM_ISP, "ISP context %d deinit failed",
|
||||
i);
|
||||
}
|
||||
|
||||
kfree(g_isp_dev.ctx);
|
||||
g_isp_dev.ctx = NULL;
|
||||
kfree(g_isp_dev.ctx_isp);
|
||||
g_isp_dev.ctx_isp = NULL;
|
||||
|
||||
rc = cam_subdev_remove(&g_isp_dev.sd);
|
||||
if (rc)
|
||||
CAM_ERR(CAM_ISP, "Unregister failed rc: %d", rc);
|
||||
|
Reference in New Issue
Block a user