aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_crtc.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2013-11-19 12:10:12 -0500
committerDave Airlie <airlied@redhat.com>2014-06-04 19:54:33 -0400
commit51fd371bbaf94018a1223b4e2cf20b9880fd92d4 (patch)
treee86e8ec3ace2fd61111105d39f5eb2d37378e9a8 /drivers/gpu/drm/omapdrm/omap_crtc.c
parent4f71d0cb76339a10fd445b0b281acc45c71b6271 (diff)
drm: convert crtc and connection_mutex to ww_mutex (v5)
For atomic, it will be quite necessary to not need to care so much about locking order. And 'state' gives us a convenient place to stash a ww_ctx for any sort of update that needs to grab multiple crtc locks. Because we will want to eventually make locking even more fine grained (giving locks to planes, connectors, etc), split out drm_modeset_lock and drm_modeset_acquire_ctx to track acquired locks. Atomic will use this to keep track of which locks have been acquired in a transaction. v1: original v2: remove a few things not needed until atomic, for now v3: update for v3 of connection_mutex patch.. v4: squash in docbook v5: doc tweaks/fixes Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_crtc.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_crtc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index e3c47a8005ff..2d28dc337cfb 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -319,13 +319,13 @@ static void page_flip_worker(struct work_struct *work)
319 struct drm_display_mode *mode = &crtc->mode; 319 struct drm_display_mode *mode = &crtc->mode;
320 struct drm_gem_object *bo; 320 struct drm_gem_object *bo;
321 321
322 mutex_lock(&crtc->mutex); 322 drm_modeset_lock(&crtc->mutex, NULL);
323 omap_plane_mode_set(omap_crtc->plane, crtc, crtc->primary->fb, 323 omap_plane_mode_set(omap_crtc->plane, crtc, crtc->primary->fb,
324 0, 0, mode->hdisplay, mode->vdisplay, 324 0, 0, mode->hdisplay, mode->vdisplay,
325 crtc->x << 16, crtc->y << 16, 325 crtc->x << 16, crtc->y << 16,
326 mode->hdisplay << 16, mode->vdisplay << 16, 326 mode->hdisplay << 16, mode->vdisplay << 16,
327 vblank_cb, crtc); 327 vblank_cb, crtc);
328 mutex_unlock(&crtc->mutex); 328 drm_modeset_unlock(&crtc->mutex);
329 329
330 bo = omap_framebuffer_bo(crtc->primary->fb, 0); 330 bo = omap_framebuffer_bo(crtc->primary->fb, 0);
331 drm_gem_object_unreference_unlocked(bo); 331 drm_gem_object_unreference_unlocked(bo);
@@ -465,7 +465,7 @@ static void apply_worker(struct work_struct *work)
465 * the callbacks and list modification all serialized 465 * the callbacks and list modification all serialized
466 * with respect to modesetting ioctls from userspace. 466 * with respect to modesetting ioctls from userspace.
467 */ 467 */
468 mutex_lock(&crtc->mutex); 468 drm_modeset_lock(&crtc->mutex, NULL);
469 dispc_runtime_get(); 469 dispc_runtime_get();
470 470
471 /* 471 /*
@@ -510,7 +510,7 @@ static void apply_worker(struct work_struct *work)
510 510
511out: 511out:
512 dispc_runtime_put(); 512 dispc_runtime_put();
513 mutex_unlock(&crtc->mutex); 513 drm_modeset_unlock(&crtc->mutex);
514} 514}
515 515
516int omap_crtc_apply(struct drm_crtc *crtc, 516int omap_crtc_apply(struct drm_crtc *crtc,
@@ -518,7 +518,7 @@ int omap_crtc_apply(struct drm_crtc *crtc,
518{ 518{
519 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 519 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
520 520
521 WARN_ON(!mutex_is_locked(&crtc->mutex)); 521 WARN_ON(!drm_modeset_is_locked(&crtc->mutex));
522 522
523 /* no need to queue it again if it is already queued: */ 523 /* no need to queue it again if it is already queued: */
524 if (apply->queued) 524 if (apply->queued)