Commit a143890f authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

drm/msm/mdp4: move iommu_domain_alloc() call close to its usage

Move iommu_domain_alloc() in front of adress space/IOMMU initialization.
This allows us to drop it from struct mdp4_cfg_platform which
remained from the pre-DT days.
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/485049/
Link: https://lore.kernel.org/r/20220505135008.1351533-2-dmitry.baryshkov@linaro.orgSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent 1796c025
...@@ -390,6 +390,7 @@ static int mdp4_kms_init(struct drm_device *dev) ...@@ -390,6 +390,7 @@ static int mdp4_kms_init(struct drm_device *dev)
struct msm_drm_private *priv = dev->dev_private; struct msm_drm_private *priv = dev->dev_private;
struct mdp4_kms *mdp4_kms; struct mdp4_kms *mdp4_kms;
struct msm_kms *kms = NULL; struct msm_kms *kms = NULL;
struct iommu_domain *iommu;
struct msm_gem_address_space *aspace; struct msm_gem_address_space *aspace;
int irq, ret; int irq, ret;
u32 major, minor; u32 major, minor;
...@@ -497,9 +498,9 @@ static int mdp4_kms_init(struct drm_device *dev) ...@@ -497,9 +498,9 @@ static int mdp4_kms_init(struct drm_device *dev)
mdp4_disable(mdp4_kms); mdp4_disable(mdp4_kms);
mdelay(16); mdelay(16);
if (config->iommu) { iommu = iommu_domain_alloc(pdev->dev.bus);
struct msm_mmu *mmu = msm_iommu_new(&pdev->dev, if (iommu) {
config->iommu); struct msm_mmu *mmu = msm_iommu_new(&pdev->dev, iommu);
aspace = msm_gem_address_space_create(mmu, aspace = msm_gem_address_space_create(mmu,
"mdp4", 0x1000, 0x100000000 - 0x1000); "mdp4", 0x1000, 0x100000000 - 0x1000);
...@@ -559,7 +560,6 @@ static struct mdp4_platform_config *mdp4_get_config(struct platform_device *dev) ...@@ -559,7 +560,6 @@ static struct mdp4_platform_config *mdp4_get_config(struct platform_device *dev)
/* TODO: Chips that aren't apq8064 have a 200 Mhz max_clk */ /* TODO: Chips that aren't apq8064 have a 200 Mhz max_clk */
config.max_clk = 266667000; config.max_clk = 266667000;
config.iommu = iommu_domain_alloc(&platform_bus_type);
return &config; return &config;
} }
......
...@@ -44,7 +44,6 @@ struct mdp4_kms { ...@@ -44,7 +44,6 @@ struct mdp4_kms {
/* platform config data (ie. from DT, or pdata) */ /* platform config data (ie. from DT, or pdata) */
struct mdp4_platform_config { struct mdp4_platform_config {
struct iommu_domain *iommu;
uint32_t max_clk; uint32_t max_clk;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment