aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_atomic_helper.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2014-11-21 15:28:31 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-11-27 09:38:15 -0500
commit6ddd388ab222b66b596342becc76d5031c0e2fc8 (patch)
treea13411bc126896dc7a4a61a442657beb02ef59eb /drivers/gpu/drm/drm_atomic_helper.c
parent3009c0377f25c29852b218a6933a969d02cbdc5d (diff)
drm/atomic: track bitmask of planes attached to crtc
Chasing plane->state->crtc of planes that are *not* part of the same atomic update is racy, making it incredibly awkward (or impossible) to do something simple like iterate over all planes and figure out which ones are attached to a crtc. Solve this by adding a bitmask of currently attached planes in the crtc-state. Note that the transitional helpers do not maintain the plane_mask. But they only support the legacy ioctls, which have sufficient brute-force locking around plane updates that they can continue to loop over all planes to see what is attached to a crtc the old way. Signed-off-by: Rob Clark <robdclark@gmail.com> [danvet: - Drop comments about locking in set_crtc_for_plane since they're a bit misleading - we already should hold lock for the current crtc. - Also WARN_ON if get_state on the old crtc fails since that should have been done already. - Squash in fixup to check get_plane_state return value, reported by Dan Carpenter and acked by Rob Clark.] 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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 2fa0840694d0..2ee509c92034 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1222,7 +1222,7 @@ retry:
1222 goto fail; 1222 goto fail;
1223 } 1223 }
1224 1224
1225 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); 1225 ret = drm_atomic_set_crtc_for_plane(state, plane, crtc);
1226 if (ret != 0) 1226 if (ret != 0)
1227 goto fail; 1227 goto fail;
1228 drm_atomic_set_fb_for_plane(plane_state, fb); 1228 drm_atomic_set_fb_for_plane(plane_state, fb);
@@ -1301,7 +1301,7 @@ retry:
1301 goto fail; 1301 goto fail;
1302 } 1302 }
1303 1303
1304 ret = drm_atomic_set_crtc_for_plane(plane_state, NULL); 1304 ret = drm_atomic_set_crtc_for_plane(state, plane, NULL);
1305 if (ret != 0) 1305 if (ret != 0)
1306 goto fail; 1306 goto fail;
1307 drm_atomic_set_fb_for_plane(plane_state, NULL); 1307 drm_atomic_set_fb_for_plane(plane_state, NULL);
@@ -1472,7 +1472,7 @@ retry:
1472 goto fail; 1472 goto fail;
1473 } 1473 }
1474 1474
1475 ret = drm_atomic_set_crtc_for_plane(primary_state, crtc); 1475 ret = drm_atomic_set_crtc_for_plane(state, crtc->primary, crtc);
1476 if (ret != 0) 1476 if (ret != 0)
1477 goto fail; 1477 goto fail;
1478 drm_atomic_set_fb_for_plane(primary_state, set->fb); 1478 drm_atomic_set_fb_for_plane(primary_state, set->fb);
@@ -1744,7 +1744,7 @@ retry:
1744 goto fail; 1744 goto fail;
1745 } 1745 }
1746 1746
1747 ret = drm_atomic_set_crtc_for_plane(plane_state, crtc); 1747 ret = drm_atomic_set_crtc_for_plane(state, plane, crtc);
1748 if (ret != 0) 1748 if (ret != 0)
1749 goto fail; 1749 goto fail;
1750 drm_atomic_set_fb_for_plane(plane_state, fb); 1750 drm_atomic_set_fb_for_plane(plane_state, fb);