Skip to contentSkip to conversation

drm/msm: call drm_mode_config_reset before drm_dev_register

PATCH In review Abhinav Kumar 2 participants 3 messages Jun 10, 2020 – Jun 12, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/msm: call drm_mode_config_reset before drm_dev_register

As per the documentation of drm_dev_register, all drivers should call drm_dev_register after all the initialization is completed. This also means that drm_mode_config_reset should be done before drm_dev_register.

Change the sequence to align with this documentation.

---
 drivers/gpu/drm/msm/msm_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/msm_drv.c +2 -2
index 29295dee2a2e..9e77cc7f1fa4 100644
@@ -538,12 +538,12 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
 		}
 	}
 
+	drm_mode_config_reset(ddev);
+
 	ret = drm_dev_register(ddev, 0);
 	if (ret)
 		goto err_msm_uninit;
 
-	drm_mode_config_reset(ddev);
-
 #ifdef CONFIG_DRM_FBDEV_EMULATION
 	if (kms && fbdev)
 		priv->fbdev = msm_fbdev_init(ddev);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Abhinav Kumar

As per the documentation of drm_dev_register, all drivers should call drm_dev_register after all the initialization is completed. This also means that drm_mode_config_reset should be done before drm_dev_register.

Change the sequence to align with this documentation.

I assume this is just a cleanup you noticed, and not fixing a bug you are hitting (in which case I'll pick it up next merge window, rather than -fixes)

Quoted 24 lines
---
 drivers/gpu/drm/msm/msm_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/msm_drv.c +2 -3
index 29295dee2a2e..9e77cc7f1fa4 100644
@@ -538,12 +538,12 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
                }
        }
 
+       drm_mode_config_reset(ddev);
+
        ret = drm_dev_register(ddev, 0);
        if (ret)
                goto err_msm_uninit;
 
-       drm_mode_config_reset(ddev);
-
 #ifdef CONFIG_DRM_FBDEV_EMULATION
        if (kms && fbdev)
                priv->fbdev = msm_fbdev_init(ddev);
--
Quoted 3 lines

The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

Hi Rob

Thanks for the review.

Yes, this was a cleanup we noticed.

Abhinav

Quoted 49 lines · Rob Clark
Quoted 9 lines · Abhinav Kumar

As per the documentation of drm_dev_register, all drivers should call drm_dev_register after all the initialization is completed. This also means that drm_mode_config_reset should be done before drm_dev_register.

Change the sequence to align with this documentation.

I assume this is just a cleanup you noticed, and not fixing a bug you are hitting (in which case I'll pick it up next merge window, rather than -fixes)

Quoted 24 lines
---
 drivers/gpu/drm/msm/msm_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/msm_drv.c +2 -2
index 29295dee2a2e..9e77cc7f1fa4 100644
@@ -538,12 +538,12 @@ static int msm_drm_init(struct device *dev, 
 struct drm_driver *drv)
                }
        }
 
+       drm_mode_config_reset(ddev);
+
        ret = drm_dev_register(ddev, 0);
        if (ret)
                goto err_msm_uninit;
 
-       drm_mode_config_reset(ddev);
-
 #ifdef CONFIG_DRM_FBDEV_EMULATION
        if (kms && fbdev)
                priv->fbdev = msm_fbdev_init(ddev);
Quoted 4 lines

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel