diff options
author | Mario Kleiner <mario.kleiner.de@gmail.com> | 2014-06-11 03:51:23 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-06-17 00:41:41 -0400 |
commit | ba124a41058b300a5464206d2d33803cc3dc82ec (patch) | |
tree | 63fd879b9a4254355fcbeb7c85c53acc7b9fa09b /drivers/gpu | |
parent | 86899b39b53bfcfb0c01151c52d4b1272306fc92 (diff) |
drm/nouveau/kms: reference vblank for crtc during pageflip.
Need to drm_vblank_get/put() the crtc involved in a
pending pageflip, or we might not get vblank irqs and
updates of vblank counts and timestamps for pageflip
events and flip completion.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 26b5647188ef..47ad74255bf1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c | |||
@@ -736,6 +736,9 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
736 | fb->bits_per_pixel, fb->pitches[0], crtc->x, crtc->y, | 736 | fb->bits_per_pixel, fb->pitches[0], crtc->x, crtc->y, |
737 | new_bo->bo.offset }; | 737 | new_bo->bo.offset }; |
738 | 738 | ||
739 | /* Keep vblanks on during flip, for the target crtc of this flip */ | ||
740 | drm_vblank_get(dev, nouveau_crtc(crtc)->index); | ||
741 | |||
739 | /* Emit a page flip */ | 742 | /* Emit a page flip */ |
740 | if (nv_device(drm->device)->card_type >= NV_50) { | 743 | if (nv_device(drm->device)->card_type >= NV_50) { |
741 | ret = nv50_display_flip_next(crtc, fb, chan, swap_interval); | 744 | ret = nv50_display_flip_next(crtc, fb, chan, swap_interval); |
@@ -779,6 +782,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
779 | return 0; | 782 | return 0; |
780 | 783 | ||
781 | fail_unreserve: | 784 | fail_unreserve: |
785 | drm_vblank_put(dev, nouveau_crtc(crtc)->index); | ||
782 | ttm_bo_unreserve(&old_bo->bo); | 786 | ttm_bo_unreserve(&old_bo->bo); |
783 | fail_unpin: | 787 | fail_unpin: |
784 | mutex_unlock(&chan->cli->mutex); | 788 | mutex_unlock(&chan->cli->mutex); |
@@ -817,6 +821,9 @@ nouveau_finish_page_flip(struct nouveau_channel *chan, | |||
817 | drm_send_vblank_event(dev, crtcid, s->event); | 821 | drm_send_vblank_event(dev, crtcid, s->event); |
818 | } | 822 | } |
819 | 823 | ||
824 | /* Give up ownership of vblank for page-flipped crtc */ | ||
825 | drm_vblank_put(dev, s->crtc); | ||
826 | |||
820 | list_del(&s->head); | 827 | list_del(&s->head); |
821 | if (ps) | 828 | if (ps) |
822 | *ps = *s; | 829 | *ps = *s; |