mirror of https://gitee.com/openkylin/linux.git
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
This commit is contained in:
parent
86899b39b5
commit
ba124a4105
|
@ -736,6 +736,9 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
|
||||||
fb->bits_per_pixel, fb->pitches[0], crtc->x, crtc->y,
|
fb->bits_per_pixel, fb->pitches[0], crtc->x, crtc->y,
|
||||||
new_bo->bo.offset };
|
new_bo->bo.offset };
|
||||||
|
|
||||||
|
/* Keep vblanks on during flip, for the target crtc of this flip */
|
||||||
|
drm_vblank_get(dev, nouveau_crtc(crtc)->index);
|
||||||
|
|
||||||
/* Emit a page flip */
|
/* Emit a page flip */
|
||||||
if (nv_device(drm->device)->card_type >= NV_50) {
|
if (nv_device(drm->device)->card_type >= NV_50) {
|
||||||
ret = nv50_display_flip_next(crtc, fb, chan, swap_interval);
|
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,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail_unreserve:
|
fail_unreserve:
|
||||||
|
drm_vblank_put(dev, nouveau_crtc(crtc)->index);
|
||||||
ttm_bo_unreserve(&old_bo->bo);
|
ttm_bo_unreserve(&old_bo->bo);
|
||||||
fail_unpin:
|
fail_unpin:
|
||||||
mutex_unlock(&chan->cli->mutex);
|
mutex_unlock(&chan->cli->mutex);
|
||||||
|
@ -817,6 +821,9 @@ nouveau_finish_page_flip(struct nouveau_channel *chan,
|
||||||
drm_send_vblank_event(dev, crtcid, s->event);
|
drm_send_vblank_event(dev, crtcid, s->event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Give up ownership of vblank for page-flipped crtc */
|
||||||
|
drm_vblank_put(dev, s->crtc);
|
||||||
|
|
||||||
list_del(&s->head);
|
list_del(&s->head);
|
||||||
if (ps)
|
if (ps)
|
||||||
*ps = *s;
|
*ps = *s;
|
||||||
|
|
Loading…
Reference in New Issue