From af4995d74bd3ee3ed8f17c7c04c8d3acaaecebc6 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 25 Nov 2013 09:57:19 +0000 Subject: [PATCH] sna: Handle failure to disable old plane when switching CRTCs If we fail to disable the old plane, abort the PutImage and report the error. Signed-off-by: Zdenek Kabelac --- src/sna/sna_video_sprite.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c index b6e7b94..b6a7950 100644 --- a/src/sna/sna_video_sprite.c +++ b/src/sna/sna_video_sprite.c @@ -315,7 +315,10 @@ sna_video_sprite_show(struct sna *sna, if (video->plane) { memset(&s, 0, sizeof(s)); s.plane_id = video->plane; - drmIoctl(video->sna->kgem.fd, DRM_IOCTL_MODE_SETPLANE, &s); + if (drmIoctl(video->sna->kgem.fd, DRM_IOCTL_MODE_SETPLANE, &s)) { + DBG(("SET_PLANE failed to turn off existing sprite: ret=%d\n", errno)); + return false; + } } video->plane = s.plane_id; } -- 2.7.4