diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-04-08 21:07:10 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-04-08 21:08:08 +0100 |
commit | de44aaa2dd02e68ec94bd011fdd4190393433ba0 (patch) | |
tree | f8cbfef1fdd614b98532e03e8a4efc01e9aac6eb /src/sna/sna_present.c | |
parent | edcfb3efb87c5d70f821a65e8e197b1a607706ae (diff) |
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 <tjaalton@ubuntu.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_present.c')
-rw-r--r-- | src/sna/sna_present.c | 7 |
1 files changed, 4 insertions, 3 deletions
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), |