mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user