drm/msi/mdp4: populate priv->kms in mdp4_kms_init
authorDavid Heidelberg <david@ixit.cz>
Wed, 11 Aug 2021 17:06:31 +0000 (19:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:40:37 +0000 (13:40 +0200)
commit cb0927ab80d224c9074f53d1a55b087d12ec5a85 upstream.

Without this fix boot throws NULL ptr exception at msm_dsi_manager_setup_encoder
on devices like Nexus 7 2013 (MDP4 v4.4).

Fixes: 03436e3ec69c ("drm/msm/dsi: Move setup_encoder to modeset_init")
Cc: <stable@vger.kernel.org>
Signed-off-by: David Heidelberg <david@ixit.cz>
Link: https://lore.kernel.org/r/20210811170631.39296-1-david@ixit.cz
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c

index 39577bf9215a32a5165b8ecae0473da7e0b30cf2..913de5938782adb0744b08fd8d362e12b130ce15 100644 (file)
@@ -397,6 +397,7 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev->dev);
        struct mdp4_platform_config *config = mdp4_get_config(pdev);
+       struct msm_drm_private *priv = dev->dev_private;
        struct mdp4_kms *mdp4_kms;
        struct msm_kms *kms = NULL;
        struct msm_gem_address_space *aspace;
@@ -412,7 +413,8 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev)
 
        mdp_kms_init(&mdp4_kms->base, &kms_funcs);
 
-       kms = &mdp4_kms->base.base;
+       priv->kms = &mdp4_kms->base.base;
+       kms = priv->kms;
 
        mdp4_kms->dev = dev;