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: AngeloGioacchino Del Regno <[email protected]> Cc: Chun-Kuang Hu <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Philipp Zabel <[email protected]> --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index a8bf0690756a..33246645e5f4 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -577,14 +577,20 @@ static int mtk_drm_kms_init(struct drm_device *drm) ret = drm_vblank_init(drm, MAX_CRTC); if (ret < 0) goto err_component_unbind; drm_kms_helper_poll_init(drm); - drm_mode_config_reset(drm); + + ret = drm_mode_config_create_initial_state(drm); + if (ret) + goto err_fini_poll; return 0; +err_fini_poll: + drm_kms_helper_poll_fini(drm); + err_component_unbind: for (i = 0; i < private->data->mmsys_dev_num; i++) component_unbind_all(private->all_drm_private[i]->dev, drm); return ret; -- 2.56.1
