Loading drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.c +28 −16 Original line number Diff line number Diff line Loading @@ -1085,27 +1085,39 @@ int msm_isp_smmu_attach(struct msm_isp_buf_mgr *buf_mgr, * Call hypervisor thru scm call to notify secure or * non-secure mode */ rc = cam_smmu_ops(buf_mgr->img_iommu_hdl, CAM_SMMU_ATTACH); if (buf_mgr->attach_ref_cnt == 0) { rc = cam_smmu_ops(buf_mgr->img_iommu_hdl, CAM_SMMU_ATTACH); if (rc < 0) { pr_err("%s: img smmu attach error, rc :%d\n", __func__, rc); goto err1; } rc = cam_smmu_ops(buf_mgr->stats_iommu_hdl, CAM_SMMU_ATTACH); rc = cam_smmu_ops(buf_mgr->stats_iommu_hdl, CAM_SMMU_ATTACH); if (rc < 0) { pr_err("%s: stats smmu attach error, rc :%d\n", __func__, rc); goto err2; } } buf_mgr->attach_ref_cnt++; } else { rc = cam_smmu_ops(buf_mgr->img_iommu_hdl, CAM_SMMU_DETACH); rc |= cam_smmu_ops(buf_mgr->stats_iommu_hdl, CAM_SMMU_DETACH); if (buf_mgr->attach_ref_cnt == 1) { rc = cam_smmu_ops(buf_mgr->img_iommu_hdl, CAM_SMMU_DETACH); rc |= cam_smmu_ops(buf_mgr->stats_iommu_hdl, CAM_SMMU_DETACH); if (rc < 0) { pr_err("%s: img/stats smmu detach error, rc :%d\n", __func__, rc); } } if (buf_mgr->attach_ref_cnt > 0) buf_mgr->attach_ref_cnt--; else pr_err("%s: Error! Invalid ref_cnt\n", __func__); } mutex_unlock(&buf_mgr->lock); return rc; Loading drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.h +1 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ struct msm_isp_buf_mgr { int num_iommu_ctx; struct list_head buffer_q; int num_iommu_secure_ctx; int attach_ref_cnt[MAX_PROTECTION_MODE][MAX_IOMMU_CTX]; int attach_ref_cnt; enum msm_isp_buf_mgr_state attach_state; struct device *isp_dev; struct mutex lock; Loading Loading
drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.c +28 −16 Original line number Diff line number Diff line Loading @@ -1085,27 +1085,39 @@ int msm_isp_smmu_attach(struct msm_isp_buf_mgr *buf_mgr, * Call hypervisor thru scm call to notify secure or * non-secure mode */ rc = cam_smmu_ops(buf_mgr->img_iommu_hdl, CAM_SMMU_ATTACH); if (buf_mgr->attach_ref_cnt == 0) { rc = cam_smmu_ops(buf_mgr->img_iommu_hdl, CAM_SMMU_ATTACH); if (rc < 0) { pr_err("%s: img smmu attach error, rc :%d\n", __func__, rc); goto err1; } rc = cam_smmu_ops(buf_mgr->stats_iommu_hdl, CAM_SMMU_ATTACH); rc = cam_smmu_ops(buf_mgr->stats_iommu_hdl, CAM_SMMU_ATTACH); if (rc < 0) { pr_err("%s: stats smmu attach error, rc :%d\n", __func__, rc); goto err2; } } buf_mgr->attach_ref_cnt++; } else { rc = cam_smmu_ops(buf_mgr->img_iommu_hdl, CAM_SMMU_DETACH); rc |= cam_smmu_ops(buf_mgr->stats_iommu_hdl, CAM_SMMU_DETACH); if (buf_mgr->attach_ref_cnt == 1) { rc = cam_smmu_ops(buf_mgr->img_iommu_hdl, CAM_SMMU_DETACH); rc |= cam_smmu_ops(buf_mgr->stats_iommu_hdl, CAM_SMMU_DETACH); if (rc < 0) { pr_err("%s: img/stats smmu detach error, rc :%d\n", __func__, rc); } } if (buf_mgr->attach_ref_cnt > 0) buf_mgr->attach_ref_cnt--; else pr_err("%s: Error! Invalid ref_cnt\n", __func__); } mutex_unlock(&buf_mgr->lock); return rc; Loading
drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.h +1 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ struct msm_isp_buf_mgr { int num_iommu_ctx; struct list_head buffer_q; int num_iommu_secure_ctx; int attach_ref_cnt[MAX_PROTECTION_MODE][MAX_IOMMU_CTX]; int attach_ref_cnt; enum msm_isp_buf_mgr_state attach_state; struct device *isp_dev; struct mutex lock; Loading