Skip to content

Commit 68745d1

Browse files
danvetRoland Scheidegger
authored andcommitted
drm/vmwgfx/stdu: Use drm_mode_config_reset
When converting to atomic the state reset was done by directly calling the functions, and before the modeset object was fully initialized. This means the various ->dev pointers weren't set up. After commit 51f644b Author: Daniel Vetter <[email protected]> Date: Fri Jun 12 18:00:49 2020 +0200 drm/atomic-helper: reset vblank on crtc reset this started to oops because now we're trying to derefence drm_crtc->dev. Fix this up by entirely switching over to drm_mode_config_reset, called once everything is set up. Fixes: 51f644b ("drm/atomic-helper: reset vblank on crtc reset") Reported-by: Tetsuo Handa <[email protected]> Cc: Tetsuo Handa <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Tested-by: Roland Scheidegger <[email protected]> Signed-off-by: Roland Scheidegger <[email protected]>
1 parent 4437c11 commit 68745d1

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,8 +1738,6 @@ static int vmw_stdu_init(struct vmw_private *dev_priv, unsigned unit)
17381738
stdu->base.is_implicit = false;
17391739

17401740
/* Initialize primary plane */
1741-
vmw_du_plane_reset(primary);
1742-
17431741
ret = drm_universal_plane_init(dev, primary,
17441742
0, &vmw_stdu_plane_funcs,
17451743
vmw_primary_plane_formats,
@@ -1754,8 +1752,6 @@ static int vmw_stdu_init(struct vmw_private *dev_priv, unsigned unit)
17541752
drm_plane_enable_fb_damage_clips(primary);
17551753

17561754
/* Initialize cursor plane */
1757-
vmw_du_plane_reset(cursor);
1758-
17591755
ret = drm_universal_plane_init(dev, cursor,
17601756
0, &vmw_stdu_cursor_funcs,
17611757
vmw_cursor_plane_formats,
@@ -1769,8 +1765,6 @@ static int vmw_stdu_init(struct vmw_private *dev_priv, unsigned unit)
17691765

17701766
drm_plane_helper_add(cursor, &vmw_stdu_cursor_plane_helper_funcs);
17711767

1772-
vmw_du_connector_reset(connector);
1773-
17741768
ret = drm_connector_init(dev, connector, &vmw_stdu_connector_funcs,
17751769
DRM_MODE_CONNECTOR_VIRTUAL);
17761770
if (ret) {
@@ -1798,7 +1792,6 @@ static int vmw_stdu_init(struct vmw_private *dev_priv, unsigned unit)
17981792
goto err_free_encoder;
17991793
}
18001794

1801-
vmw_du_crtc_reset(crtc);
18021795
ret = drm_crtc_init_with_planes(dev, crtc, &stdu->base.primary,
18031796
&stdu->base.cursor,
18041797
&vmw_stdu_crtc_funcs, NULL);
@@ -1894,6 +1887,8 @@ int vmw_kms_stdu_init_display(struct vmw_private *dev_priv)
18941887
}
18951888
}
18961889

1890+
drm_mode_config_reset(dev);
1891+
18971892
DRM_INFO("Screen Target Display device initialized\n");
18981893

18991894
return 0;

0 commit comments

Comments
 (0)