OSDN Git Service

drm/msm: Call msm_init_vram before binding the gpu
authorCraig Tatlor <ctatlor97@gmail.com>
Wed, 30 Dec 2020 15:29:42 +0000 (17:29 +0200)
committerRob Clark <robdclark@chromium.org>
Thu, 7 Jan 2021 17:12:53 +0000 (09:12 -0800)
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 <ctatlor97@gmail.com>
Reviewed-by: Brian Masney <masneyb@onstation.org>
Tested-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/msm_drv.c

index ce9bb6e..549ffb6 100644 (file)
@@ -457,14 +457,14 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
 
        drm_mode_config_init(ddev);
 
-       /* Bind all our sub-components: */
-       ret = component_bind_all(dev, ddev);
+       ret = msm_init_vram(ddev);
        if (ret)
                goto err_destroy_mdss;
 
-       ret = msm_init_vram(ddev);
+       /* Bind all our sub-components: */
+       ret = component_bind_all(dev, ddev);
        if (ret)
-               goto err_msm_uninit;
+               goto err_destroy_mdss;
 
        dma_set_max_seg_size(dev, UINT_MAX);