video: rockchip: mpp: deal with the case for iommu share

In platform arm32, iommu is shared in different device,
it must attach to ensure hardware working in current device.

Change-Id: I854a362adf6145dcfd796885922683f8a6b7e131
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
This commit is contained in:
Ding Wei
2019-11-26 15:34:52 +08:00
committed by Tao Huang
parent d55a25476c
commit a9175d765e
2 changed files with 12 additions and 0 deletions

View File

@@ -806,6 +806,15 @@ static int mpp_task_run(struct mpp_dev *mpp,
} else {
mpp_set_grf(mpp->grf_info);
}
/*
* for iommu share hardware, should attach to ensure
* working in current device
*/
ret = mpp_iommu_attach(mpp->iommu_info);
if (ret) {
dev_err(mpp->dev, "mpp_iommu_attach failed\n");
return -ENODATA;
}
mpp_power_on(mpp);
mpp_debug_func(DEBUG_TASK_INFO, "pid %d run %s\n",

View File

@@ -388,6 +388,9 @@ int mpp_iommu_attach(struct mpp_iommu_info *info)
if (!info)
return 0;
if (info->domain == iommu_get_domain_for_dev(info->dev))
return 0;
return iommu_attach_group(info->domain, info->group);
}