]> git.baikalelectronics.ru Git - kernel.git/commit
drm/atomic: track bitmask of planes attached to crtc
authorRob Clark <robdclark@gmail.com>
Fri, 21 Nov 2014 20:28:31 +0000 (15:28 -0500)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 27 Nov 2014 14:38:15 +0000 (15:38 +0100)
commit289791e2fec5dedff5955bae9574fa2e9d1612fd
treea13411bc126896dc7a4a61a442657beb02ef59eb
parent8afc28f3fe3a88cb7fd293a0b1d8f9cc8769cd55
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>
drivers/gpu/drm/drm_atomic.c
drivers/gpu/drm/drm_atomic_helper.c
include/drm/drm_atomic.h
include/drm/drm_crtc.h