video: rockchip: mpp: fix crash issue when no iommu

Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: Ic0a8523fecad460ec129836ab2693ceb0472f0f9
This commit is contained in:
Chandler Chen
2023-06-14 17:03:58 +08:00
committed by Tao Huang
parent 3473270fe2
commit 1dd504da41
3 changed files with 10 additions and 5 deletions

View File

@@ -1356,7 +1356,8 @@ int rkvdec2_attach_ccu(struct device *dev, struct rkvdec2_dev *dec)
/* set the ccu-domain for current device */
ccu_info = queue->cores[0]->iommu_info;
cur_info = dec->mpp.iommu_info;
cur_info->domain = ccu_info->domain;
if (cur_info)
cur_info->domain = ccu_info->domain;
mpp_iommu_attach(cur_info);
}

View File

@@ -2288,8 +2288,10 @@ static int rkvenc_attach_ccu(struct device *dev, struct rkvenc_dev *enc)
ccu_info = ccu->main_core->iommu_info;
cur_info = enc->mpp.iommu_info;
cur_info->domain = ccu_info->domain;
cur_info->rw_sem = ccu_info->rw_sem;
if (cur_info) {
cur_info->domain = ccu_info->domain;
cur_info->rw_sem = ccu_info->rw_sem;
}
mpp_iommu_attach(cur_info);
/* increase main core message capacity */
@@ -2467,7 +2469,8 @@ static int rkvenc_core_probe(struct platform_device *pdev)
}
mpp->session_max_buffers = RKVENC_SESSION_MAX_BUFFERS;
enc->hw_info = to_rkvenc_info(mpp->var->hw_info);
mpp->iommu_info->hdl = rkvenc2_iommu_fault_handle;
if (mpp->iommu_info)
mpp->iommu_info->hdl = rkvenc2_iommu_fault_handle;
rkvenc_procfs_init(mpp);
rkvenc_procfs_ccu_init(mpp);

View File

@@ -1050,7 +1050,8 @@ static int vepu_attach_ccu(struct device *dev, struct vepu_dev *enc)
ccu_info = ccu->main_core->iommu_info;
cur_info = enc->mpp.iommu_info;
cur_info->domain = ccu_info->domain;
if (cur_info)
cur_info->domain = ccu_info->domain;
mpp_iommu_attach(cur_info);
}
enc->ccu = ccu;