]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Handle legacy per-crtc locking with full acquire ctx
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 25 Jul 2014 16:07:40 +0000 (18:07 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 8 Aug 2014 15:46:45 +0000 (17:46 +0200)
commit3bdfca2897b095d862a3579b283952bcf0a63ca0
treee16e275dbe7435bfcb7519e603f7826abc26fc8c
parente22cda1b9d46d70bcc004c65a1fbf4e1af051621
drm: Handle legacy per-crtc locking with full acquire ctx

So drivers using the atomic interfaces expect that they can acquire
additional locks internal to the driver as-needed. Examples would be
locks to protect shared state like shared display PLLs.

Unfortunately the legacy ioctls assume that all locking is fully done
by the drm core. Now for those paths which grab all locks we already
have to keep around an acquire context in dev->mode_config. Helper
functions that implement legacy interfaces in terms of atomic support
can therefore grab this acquire contexts and reuse it.

The only interfaces left are the cursor and pageflip ioctls. So add
functions to grab the crtc lock these need using an acquire context
and preserve it for atomic drivers to reuse.

v2:
- Fixup comments&kerneldoc.
- Drop the WARNING from modeset_lock_all_crtcs since that can be used
  in legacy paths with crtc locking.

v3: Fix a type on the kerneldoc Dave spotted.

Cc: Dave Airlie <airlied@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_modeset_lock.c
include/drm/drm_crtc.h
include/drm/drm_modeset_lock.h