drm_mode_config_reset() has a dual role: it creates the initial KMS
state at probe time, and resets hardware and software state during
suspend/resume cycles.

Since the two roles need different behaviors (notably for objects like
drm_private_obj that must persist across suspend/resume),
drm_mode_config_create_initial_state() was introduced to handle only
the initial state creation at probe time.

Switch to drm_mode_config_create_initial_state().

Signed-off-by: Maxime Ripard <[email protected]>
---
Cc: Alain Volmat <[email protected]>
Cc: Raphael Gallais-Pou <[email protected]>
---
 drivers/gpu/drm/sti/sti_drv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index d02d71866f2a..0ca6c6b41f18 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -203,5 +203,7 @@ static int sti_bind(struct device *dev)
                goto err_cleanup;
 
-       drm_mode_config_reset(ddev);
+       ret = drm_mode_config_create_initial_state(ddev);
+       if (ret)
+               goto err_unregister;
 
        drm_client_setup(ddev, NULL);
@@ -209,4 +211,6 @@ static int sti_bind(struct device *dev)
        return 0;
 
+err_unregister:
+       drm_dev_unregister(ddev);
 err_cleanup:
        sti_cleanup(ddev);

-- 
2.55.0

Reply via email to