xf86-video-intel: src/sna/sna_present.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Apr 8 20:08:53 UTC 2016


 src/sna/sna_present.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit de44aaa2dd02e68ec94bd011fdd4190393433ba0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Apr 8 21:07:10 2016 +0100

    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 at ubuntu.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_present.c b/src/sna/sna_present.c
index da64233..eca09e6 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),


More information about the xorg-commit mailing list