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: Baolin Wang <[email protected]>
Cc: Chunyan Zhang <[email protected]>
Cc: Orson Zhai <[email protected]>
---
 drivers/gpu/drm/sprd/sprd_drm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/sprd/sprd_drm.c b/drivers/gpu/drm/sprd/sprd_drm.c
index c2fd5380a834..cef022f54912 100644
--- a/drivers/gpu/drm/sprd/sprd_drm.c
+++ b/drivers/gpu/drm/sprd/sprd_drm.c
@@ -96,6 +96,8 @@ static int sprd_drm_bind(struct device *dev)
        }
 
-       /* reset all the states of crtc/plane/encoder/connector */
-       drm_mode_config_reset(drm);
+       /* Create the states of crtc/plane/encoder/connector */
+       ret = drm_mode_config_create_initial_state(drm);
+       if (ret)
+               goto err_unbind_all;
 
        /* init kms poll for handling hpd */

-- 
2.55.0

Reply via email to