aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_atomic_helper.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2014-11-26 18:58:04 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-11-27 09:39:11 -0500
commite5b5341c28c66a122982d3d8822a4f9a0938f923 (patch)
tree5bc62458e106e8e1acd5ce83864b13506267de8a /drivers/gpu/drm/drm_atomic_helper.c
parentabd69c55dd8f1f71b33b8c6165217f4329db8f25 (diff)
drm/atomic: clear plane's CRTC and FB when shutting down
Otherwise we'd still end up w/ the plane attached to the CRTC, and seemingly active, but without an FB. Which ends up going *boom* in the drivers. Slightly modified version of Daniel's irc suggestion. Note that the big problem isn't drivers going *boom* here (since we already have the situation of planes being left enabled when the crtc goes down). The real issue is that the core assumes the primary plane always goes down when calling ->set_config with a NULL mode. Ignoring that assumption leads to the legacy state pointers plane->fb/crtc getting out of sync with atomic, and that then leads to the subsequent *boom* all over the place. CC: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Rob Clark <robdclark@gmail.com> [danvet: Drop my opinion of what's going sidewides here into the commit message as a note.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_atomic_helper.c')
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 2ee509c92034..4a78a773151c 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1452,11 +1452,24 @@ retry:
1452 goto fail; 1452 goto fail;
1453 } 1453 }
1454 1454
1455 primary_state = drm_atomic_get_plane_state(state, crtc->primary);
1456 if (IS_ERR(primary_state)) {
1457 ret = PTR_ERR(primary_state);
1458 goto fail;
1459 }
1460
1455 if (!set->mode) { 1461 if (!set->mode) {
1456 WARN_ON(set->fb); 1462 WARN_ON(set->fb);
1457 WARN_ON(set->num_connectors); 1463 WARN_ON(set->num_connectors);
1458 1464
1459 crtc_state->enable = false; 1465 crtc_state->enable = false;
1466
1467 ret = drm_atomic_set_crtc_for_plane(state, crtc->primary, NULL);
1468 if (ret != 0)
1469 goto fail;
1470
1471 drm_atomic_set_fb_for_plane(primary_state, NULL);
1472
1460 goto commit; 1473 goto commit;
1461 } 1474 }
1462 1475
@@ -1466,12 +1479,6 @@ retry:
1466 crtc_state->enable = true; 1479 crtc_state->enable = true;
1467 drm_mode_copy(&crtc_state->mode, set->mode); 1480 drm_mode_copy(&crtc_state->mode, set->mode);
1468 1481
1469 primary_state = drm_atomic_get_plane_state(state, crtc->primary);
1470 if (IS_ERR(primary_state)) {
1471 ret = PTR_ERR(primary_state);
1472 goto fail;
1473 }
1474
1475 ret = drm_atomic_set_crtc_for_plane(state, crtc->primary, crtc); 1482 ret = drm_atomic_set_crtc_for_plane(state, crtc->primary, crtc);
1476 if (ret != 0) 1483 if (ret != 0)
1477 goto fail; 1484 goto fail;