summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-13 18:37:15 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-13 18:37:47 +0100
commitc8074b6bcfa8c208433574721135faa4d919d32a (patch)
treef9c1d5d1aa23ef70fde3b922fd055446bbe17f6f
parent0a0b9dc3538ef731463fb321852b8802cd04e457 (diff)
intel-virtual-output: Check for an error creating the DRI3 fd
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79994 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tools/virtual.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/virtual.c b/tools/virtual.c
index a5dccb4f..4b1c9684 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -1047,6 +1047,8 @@ static void output_init_xfer(struct clone *clone, struct output *output)
if (output->gc == None) {
XGCValues gcv;
+ DBG(("%s-%s: creating gc\n", DisplayString(output->dpy), output->name));
+
gcv.graphics_exposures = False;
gcv.subwindow_mode = IncludeInferiors;
@@ -1121,7 +1123,17 @@ static int clone_init_xfer(struct clone *clone)
_x_error_occurred = 0;
+ DBG(("%s-%s create xfer, trying DRI3\n",
+ DisplayString(clone->dst.dpy), clone->dst.name));
+
fd = dri3_create_fd(clone->dst.dpy, clone->dst.window, &stride);
+ if (fd < 0)
+ goto disable_dri3;
+
+ DBG(("%s-%s create xfer, DRI3 fd=%d, stride=%d\n",
+ DisplayString(clone->dst.dpy), clone->dst.name,
+ fd, stride));
+
src = dri3_create_pixmap(clone->src.dpy, clone->src.window,
width, height, clone->depth,
fd, bpp_for_depth(clone->depth),
@@ -1135,8 +1147,12 @@ static int clone_init_xfer(struct clone *clone)
} else {
XFreePixmap(clone->src.dpy, src);
close(fd);
+disable_dri3:
dri3_fence_free(clone->src.dpy, &clone->dri3);
clone->dri3.xid = 0;
+
+ DBG(("%s-%s create xfer, DRI3 failed\n",
+ DisplayString(clone->dst.dpy), clone->dst.name));
}
}
@@ -1144,6 +1160,9 @@ static int clone_init_xfer(struct clone *clone)
height = mode_height(&clone->src.mode, clone->src.rotation);
if (!clone->dri3.xid) {
+ DBG(("%s-%s create xfer, trying SHM\n",
+ DisplayString(clone->dst.dpy), clone->dst.name));
+
clone->shm.shmid = shmget(IPC_PRIVATE,
height * stride_for_depth(width, clone->depth),
IPC_CREAT | 0666);