From de44aaa2dd02e68ec94bd011fdd4190393433ba0 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 8 Apr 2016 21:07:10 +0100 Subject: sna/present: Refuse to queue a vblank on a disabled CRTC Kick the error back to the upper layer for it to sort out. Reported-by: Timo Aaltonen Signed-off-by: Chris Wilson --- src/sna/sna_present.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/sna/sna_present.c b/src/sna/sna_present.c index da642330..eca09e60 100644 --- a/src/sna/sna_present.c +++ b/src/sna/sna_present.c @@ -150,9 +150,7 @@ static uint32_t msc_to_delay(xf86CrtcPtr crtc, uint64_t target) const struct ust_msc *swap = sna_crtc_last_swap(crtc); int64_t delay, subframe; - /* XXX How to handle CRTC being off? */ - if (mode->Clock == 0) - return 0; + assert(mode->Clock); delay = target - swap->msc; assert(delay >= 0); @@ -403,6 +401,9 @@ sna_present_queue_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) struct sna_present_event *info, *tmp; const struct ust_msc *swap; + if (!sna_crtc_is_on(crtc->devPrivate)) + return BadAlloc; + swap = sna_crtc_last_swap(crtc->devPrivate); DBG(("%s(pipe=%d, event=%lld, msc=%lld, last swap=%lld)\n", __FUNCTION__, sna_crtc_pipe(crtc->devPrivate), -- cgit v1.2.3