diff options
author | Mario Kleiner <mario.kleiner.de@gmail.com> | 2014-05-13 00:42:08 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-06-11 16:02:07 +1000 |
commit | dbe2d9fe755ad3aec0c82a270bf54aa118a34a17 (patch) | |
tree | c4846cf0fcc4836e4f94db9df4a467b6544b6e50 | |
parent | 32905c61c5a6ebd82ea5811bfb1eb682b4d862ad (diff) |
kms/nv04-nv40: fix pageflip events via special case.
Cards with nv04 display engine can't reliably use vblank
counts and timestamps computed via drm_handle_vblank(), as
the function gets invoked after sending the pageflip events.
Fix this by defaulting to the old crtcid = -1 fallback path
on <= NV-50 cards, and only using the precise path on NV-50
and later.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: <stable@vger.kernel.org> # 3.13+
-rw-r--r-- | drm/nouveau_display.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drm/nouveau_display.c b/drm/nouveau_display.c index da764a4e..26fbc4f4 100644 --- a/drm/nouveau_display.c +++ b/drm/nouveau_display.c @@ -798,6 +798,7 @@ nouveau_finish_page_flip(struct nouveau_channel *chan, struct drm_device *dev = drm->dev; struct nouveau_page_flip_state *s; unsigned long flags; + int crtcid = -1; spin_lock_irqsave(&dev->event_lock, flags); @@ -808,8 +809,13 @@ nouveau_finish_page_flip(struct nouveau_channel *chan, } s = list_first_entry(&fctx->flip, struct nouveau_page_flip_state, head); - if (s->event) - drm_send_vblank_event(dev, s->crtc, s->event); + if (s->event) { + /* Vblank timestamps/counts are only correct on >= NV-50 */ + if (nv_device(drm->device)->card_type >= NV_50) + crtcid = s->crtc; + + drm_send_vblank_event(dev, crtcid, s->event); + } list_del(&s->head); if (ps) |