diff options
author | Imre Deak <imre.deak@intel.com> | 2012-11-02 07:30:49 -0400 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2012-11-29 06:30:34 -0500 |
commit | 9fb7dff5ec238c8f71ef9b06256957a0db585c04 (patch) | |
tree | 20ea8f26cc5b8eafb90a70d4b47cd13d2d647e19 | |
parent | e1f48ee58a90ddf84f514334b5d395a358596492 (diff) |
drm/exynos: fix lockdep for event_lock wrt. vbl_time_lock
Currently the exynos driver calls drm_vblank_off() with the event_lock
held, while drm_vblank_off() will lock vbl_time and vblank_time_lock.
This lock dependency chain conflicts with the one in drm_handle_vblank()
where we first lock vblank_time_lock and then the event_lock.
Fix this by removing the above drm_vblank_off() calls which are in fact
never executed: drm_dev->vblank_disable_allowed is only ever non-zero
during driver init, until it's set in {fimd,vidi}_subdrv_probe. Both the
driver init and open code is protected by drm_global_mutex, so the
earliest page flip ioctl can happen only after vblank_disable_allowed is
set to 1. Thus {fimd,vidi}_finish_pageflip - with pending flip events -
will always get called with vblank_disable_allowed being 1.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimd.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_vidi.c | 12 |
2 files changed, 0 insertions, 24 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 23a57f4da478..dcf3504ebab7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
@@ -623,7 +623,6 @@ static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc) | |||
623 | struct drm_pending_vblank_event *e, *t; | 623 | struct drm_pending_vblank_event *e, *t; |
624 | struct timeval now; | 624 | struct timeval now; |
625 | unsigned long flags; | 625 | unsigned long flags; |
626 | bool is_checked = false; | ||
627 | 626 | ||
628 | spin_lock_irqsave(&drm_dev->event_lock, flags); | 627 | spin_lock_irqsave(&drm_dev->event_lock, flags); |
629 | 628 | ||
@@ -633,8 +632,6 @@ static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc) | |||
633 | if (crtc != e->pipe) | 632 | if (crtc != e->pipe) |
634 | continue; | 633 | continue; |
635 | 634 | ||
636 | is_checked = true; | ||
637 | |||
638 | do_gettimeofday(&now); | 635 | do_gettimeofday(&now); |
639 | e->event.sequence = 0; | 636 | e->event.sequence = 0; |
640 | e->event.tv_sec = now.tv_sec; | 637 | e->event.tv_sec = now.tv_sec; |
@@ -645,15 +642,6 @@ static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc) | |||
645 | drm_vblank_put(drm_dev, crtc); | 642 | drm_vblank_put(drm_dev, crtc); |
646 | } | 643 | } |
647 | 644 | ||
648 | if (is_checked) { | ||
649 | /* | ||
650 | * don't off vblank if vblank_disable_allowed is 1, | ||
651 | * because vblank would be off by timer handler. | ||
652 | */ | ||
653 | if (!drm_dev->vblank_disable_allowed) | ||
654 | drm_vblank_off(drm_dev, crtc); | ||
655 | } | ||
656 | |||
657 | spin_unlock_irqrestore(&drm_dev->event_lock, flags); | 645 | spin_unlock_irqrestore(&drm_dev->event_lock, flags); |
658 | } | 646 | } |
659 | 647 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index e26d45577551..4b0c16bfd1da 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c | |||
@@ -382,7 +382,6 @@ static void vidi_finish_pageflip(struct drm_device *drm_dev, int crtc) | |||
382 | struct drm_pending_vblank_event *e, *t; | 382 | struct drm_pending_vblank_event *e, *t; |
383 | struct timeval now; | 383 | struct timeval now; |
384 | unsigned long flags; | 384 | unsigned long flags; |
385 | bool is_checked = false; | ||
386 | 385 | ||
387 | spin_lock_irqsave(&drm_dev->event_lock, flags); | 386 | spin_lock_irqsave(&drm_dev->event_lock, flags); |
388 | 387 | ||
@@ -392,8 +391,6 @@ static void vidi_finish_pageflip(struct drm_device *drm_dev, int crtc) | |||
392 | if (crtc != e->pipe) | 391 | if (crtc != e->pipe) |
393 | continue; | 392 | continue; |
394 | 393 | ||
395 | is_checked = true; | ||
396 | |||
397 | do_gettimeofday(&now); | 394 | do_gettimeofday(&now); |
398 | e->event.sequence = 0; | 395 | e->event.sequence = 0; |
399 | e->event.tv_sec = now.tv_sec; | 396 | e->event.tv_sec = now.tv_sec; |
@@ -404,15 +401,6 @@ static void vidi_finish_pageflip(struct drm_device *drm_dev, int crtc) | |||
404 | drm_vblank_put(drm_dev, crtc); | 401 | drm_vblank_put(drm_dev, crtc); |
405 | } | 402 | } |
406 | 403 | ||
407 | if (is_checked) { | ||
408 | /* | ||
409 | * don't off vblank if vblank_disable_allowed is 1, | ||
410 | * because vblank would be off by timer handler. | ||
411 | */ | ||
412 | if (!drm_dev->vblank_disable_allowed) | ||
413 | drm_vblank_off(drm_dev, crtc); | ||
414 | } | ||
415 | |||
416 | spin_unlock_irqrestore(&drm_dev->event_lock, flags); | 404 | spin_unlock_irqrestore(&drm_dev->event_lock, flags); |
417 | } | 405 | } |
418 | 406 | ||