aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-01-24 11:20:33 -0500
committerRob Clark <robdclark@gmail.com>2013-02-16 17:38:06 -0500
commit16ef3dfe460616f14120973f78fe640e79862654 (patch)
tree4d541e301f0ef9c3c1ea15cc40bd66b59996646f
parent8bb0daffb0b8e45188066255b4203446eae181f1 (diff)
omapdrm: only take crtc->mutex in crtc callbacks
Omapdrm doesn't do anything nefarious with crtc load detection or has any shared resources, so this is enough. We also need to adjust the WARN_ON. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Rob Clark <robdclark@gmail.com>
-rw-r--r--drivers/gpu/drm/omapdrm/omap_crtc.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 2b97cf90071b..ac2258f59805 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -274,17 +274,16 @@ static void page_flip_worker(struct work_struct *work)
274 struct omap_crtc *omap_crtc = 274 struct omap_crtc *omap_crtc =
275 container_of(work, struct omap_crtc, page_flip_work); 275 container_of(work, struct omap_crtc, page_flip_work);
276 struct drm_crtc *crtc = &omap_crtc->base; 276 struct drm_crtc *crtc = &omap_crtc->base;
277 struct drm_device *dev = crtc->dev;
278 struct drm_display_mode *mode = &crtc->mode; 277 struct drm_display_mode *mode = &crtc->mode;
279 struct drm_gem_object *bo; 278 struct drm_gem_object *bo;
280 279
281 drm_modeset_lock_all(dev); 280 mutex_lock(&crtc->mutex);
282 omap_plane_mode_set(omap_crtc->plane, crtc, crtc->fb, 281 omap_plane_mode_set(omap_crtc->plane, crtc, crtc->fb,
283 0, 0, mode->hdisplay, mode->vdisplay, 282 0, 0, mode->hdisplay, mode->vdisplay,
284 crtc->x << 16, crtc->y << 16, 283 crtc->x << 16, crtc->y << 16,
285 mode->hdisplay << 16, mode->vdisplay << 16, 284 mode->hdisplay << 16, mode->vdisplay << 16,
286 vblank_cb, crtc); 285 vblank_cb, crtc);
287 drm_modeset_unlock_all(dev); 286 mutex_unlock(&crtc->mutex);
288 287
289 bo = omap_framebuffer_bo(crtc->fb, 0); 288 bo = omap_framebuffer_bo(crtc->fb, 0);
290 drm_gem_object_unreference_unlocked(bo); 289 drm_gem_object_unreference_unlocked(bo);
@@ -417,7 +416,7 @@ static void apply_worker(struct work_struct *work)
417 * the callbacks and list modification all serialized 416 * the callbacks and list modification all serialized
418 * with respect to modesetting ioctls from userspace. 417 * with respect to modesetting ioctls from userspace.
419 */ 418 */
420 drm_modeset_lock_all(dev); 419 mutex_lock(&crtc->mutex);
421 dispc_runtime_get(); 420 dispc_runtime_get();
422 421
423 /* 422 /*
@@ -462,16 +461,15 @@ static void apply_worker(struct work_struct *work)
462 461
463out: 462out:
464 dispc_runtime_put(); 463 dispc_runtime_put();
465 drm_modeset_unlock_all(dev); 464 mutex_unlock(&crtc->mutex);
466} 465}
467 466
468int omap_crtc_apply(struct drm_crtc *crtc, 467int omap_crtc_apply(struct drm_crtc *crtc,
469 struct omap_drm_apply *apply) 468 struct omap_drm_apply *apply)
470{ 469{
471 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 470 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
472 struct drm_device *dev = crtc->dev;
473 471
474 WARN_ON(!mutex_is_locked(&dev->mode_config.mutex)); 472 WARN_ON(!mutex_is_locked(&crtc->mutex));
475 473
476 /* no need to queue it again if it is already queued: */ 474 /* no need to queue it again if it is already queued: */
477 if (apply->queued) 475 if (apply->queued)