]> git.baikalelectronics.ru Git - kernel.git/commit
drm/atomic: Ensure that drm_connector_index is stable
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 19 Nov 2014 17:38:06 +0000 (18:38 +0100)
committerDave Airlie <airlied@redhat.com>
Thu, 20 Nov 2014 01:35:18 +0000 (11:35 +1000)
commit37dd970513b3380a464f4ec3b35207e8e6af9661
treec9a21a82b2ca4ea1c97d6870e7bace2a3616d446
parentbb94d67a85c03d7cab7e7f3d05d34267e3e2494a
drm/atomic: Ensure that drm_connector_index is stable

I've totally forgotten that with DP MST connectors can now be
hotplugged. And failed to adapt Rob's drm_atomic_state code (which
predates connector hotplugging) to the new realities.

The first step is to make sure that the connector indices used to
access the arrays of pointers are stable. The connection mutex gives
us enough guarantees for that, which means we won't unecessarily block
on concurrent modesets or background probing.

So add a locking WARN_ON and shuffle the code slightly to make sure we
always hold the right lock.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_atomic.c
drivers/gpu/drm/drm_crtc.c