Skip to content

Commit 16ef3df

Browse files
danvetrobclark
authored andcommitted
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>
1 parent 8bb0daf commit 16ef3df

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎drivers/gpu/drm/omapdrm/omap_crtc.c‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,16 @@ static void page_flip_worker(struct work_struct *work)
274274
struct omap_crtc *omap_crtc =
275275
container_of(work, struct omap_crtc, page_flip_work);
276276
struct drm_crtc *crtc = &omap_crtc->base;
277-
struct drm_device *dev = crtc->dev;
278277
struct drm_display_mode *mode = &crtc->mode;
279278
struct drm_gem_object *bo;
280279

281-
drm_modeset_lock_all(dev);
280+
mutex_lock(&crtc->mutex);
282281
omap_plane_mode_set(omap_crtc->plane, crtc, crtc->fb,
283282
0, 0, mode->hdisplay, mode->vdisplay,
284283
crtc->x << 16, crtc->y << 16,
285284
mode->hdisplay << 16, mode->vdisplay << 16,
286285
vblank_cb, crtc);
287-
drm_modeset_unlock_all(dev);
286+
mutex_unlock(&crtc->mutex);
288287

289288
bo = omap_framebuffer_bo(crtc->fb, 0);
290289
drm_gem_object_unreference_unlocked(bo);
@@ -417,7 +416,7 @@ static void apply_worker(struct work_struct *work)
417416
* the callbacks and list modification all serialized
418417
* with respect to modesetting ioctls from userspace.
419418
*/
420-
drm_modeset_lock_all(dev);
419+
mutex_lock(&crtc->mutex);
421420
dispc_runtime_get();
422421

423422
/*
@@ -462,16 +461,15 @@ static void apply_worker(struct work_struct *work)
462461

463462
out:
464463
dispc_runtime_put();
465-
drm_modeset_unlock_all(dev);
464+
mutex_unlock(&crtc->mutex);
466465
}
467466

468467
int omap_crtc_apply(struct drm_crtc *crtc,
469468
struct omap_drm_apply *apply)
470469
{
471470
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
472-
struct drm_device *dev = crtc->dev;
473471

474-
WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
472+
WARN_ON(!mutex_is_locked(&crtc->mutex));
475473

476474
/* no need to queue it again if it is already queued: */
477475
if (apply->queued)

0 commit comments

Comments
 (0)