sna: Handle failure to disable old plane when switching CRTCs
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 25 Nov 2013 09:57:19 +0000 (09:57 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 25 Nov 2013 10:04:49 +0000 (10:04 +0000)
If we fail to disable the old plane, abort the PutImage and report the
error.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
src/sna/sna_video_sprite.c

index b6e7b94..b6a7950 100644 (file)
@@ -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;
        }