2018-02-03 18:41:51

by Craig Tatlor

[permalink] [raw]
Subject: [PATCH] drm/msm: Call msm_init_vram before binding the gpu

vram.size is needed when binding a gpu without an iommu and is defined
in msm_init_vram(), so run that before binding it.

Signed-off-by: Craig Tatlor <[email protected]>
---
drivers/gpu/drm/msm/msm_drv.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index bdf0fe754f7b..82d4126ca017 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -400,6 +400,14 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)

drm_mode_config_init(ddev);

+ ret = msm_init_vram(ddev);
+ if (ret) {
+ msm_mdss_destroy(ddev);
+ kfree(priv);
+ drm_dev_unref(ddev);
+ return ret;
+ }
+
/* Bind all our sub-components: */
ret = component_bind_all(dev, ddev);
if (ret) {
@@ -409,10 +417,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
return ret;
}

- ret = msm_init_vram(ddev);
- if (ret)
- goto fail;
-
msm_gem_shrinker_init(ddev);

switch (get_mdp_ver(pdev)) {
--
2.15.1