xf86-video-intel: 2 commits - tools/virtual.c

Chris Wilson ickle at kemper.freedesktop.org
Sun Sep 1 09:13:34 PDT 2013


 tools/virtual.c |   33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

New commits:
commit f5fdbf6f23c2e90235f511714481bc9250f60020
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Sep 1 17:08:54 2013 +0100

    intel-virtual-output: Add missing whitespace, s/while(1)/while (1)/
    
    No functional changes.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/tools/virtual.c b/tools/virtual.c
index 8a88686..d03f108 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -1146,9 +1146,9 @@ static int record_mouse(struct context *ctx)
 	XRecordClientSpec rcs;
 	XRecordContext rc;
 
-	DBG(("%s(%s)\n", __func__, DisplayString(ctx->display[0].dpy)));
+	DBG(("%s(%s)\n", __func__, DisplayString(ctx->display->dpy)));
 
-	dpy = XOpenDisplay(DisplayString(ctx->display[0].dpy));
+	dpy = XOpenDisplay(DisplayString(ctx->display->dpy));
 	if (dpy == NULL)
 		return -ECONNREFUSED;
 
@@ -1764,7 +1764,7 @@ static int first_display_wait_for_ack(struct context *ctx, int timeout, int id)
 
 			return -atoi(cme->data.b + 5);
 		}
-	} while(1);
+	} while (1);
 }
 
 #if defined(__GNUC__) && (__GNUC__ > 3)
@@ -1900,7 +1900,7 @@ static int first_display_register_as_singleton(struct context *ctx)
 			    pe.atom == ctx->singleton)
 				return 0;
 		}
-	} while(1);
+	} while (1);
 }
 
 static void display_flush(struct display *display)
@@ -2014,7 +2014,7 @@ int main(int argc, char **argv)
 
 	ret = add_fd(&ctx, record_mouse(&ctx));
 	if (ret) {
-		fprintf(stderr, "XTEST extension not supported by display \"%s\"\n", DisplayString(ctx.display[0].dpy));
+		fprintf(stderr, "XTEST extension not supported by display \"%s\"\n", DisplayString(ctx.display->dpy));
 		return -ret;
 	}
 
commit 8654bd7f6670a55b53ad6a7d0f14fe446124d41a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Sep 1 17:07:49 2013 +0100

    intel-virtual-output: Restore the lost POLLIN on the timerfd
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/tools/virtual.c b/tools/virtual.c
index a37f4ca..8a88686 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -1529,6 +1529,8 @@ static int timerfd(int hz)
 
 static int context_init(struct context *ctx)
 {
+	struct pollfd *pfd;
+
 	memset(ctx, 0, sizeof(*ctx));
 
 	ctx->pfd = malloc(2*sizeof(struct pollfd));
@@ -1543,19 +1545,19 @@ static int context_init(struct context *ctx)
 	if (ctx->display == NULL)
 		return -ENOMEM;
 
-	ctx->pfd[0].fd = timerfd(60);
-	if (ctx->pfd[0].fd < 0)
-		return ctx->pfd[0].fd;
-
-	ctx->pfd[0].events = 0;
-	ctx->pfd[0].revents = 0;
-	ctx->nfd++;
+	pfd = memset(&ctx->pfd[ctx->nfd++], 0, sizeof(struct pollfd));
+	pfd->fd = timerfd(60);
+	if (pfd->fd < 0)
+		return pfd->fd;
+	pfd->events = POLLIN;
 
 	return 0;
 }
 
 static int add_fd(struct context *ctx, int fd)
 {
+	struct pollfd *pfd;
+
 	if (fd < 0)
 		return fd;
 
@@ -1565,10 +1567,9 @@ static int add_fd(struct context *ctx, int fd)
 			return -ENOMEM;
 	}
 
-	ctx->pfd[ctx->nfd].fd = fd;
-	ctx->pfd[ctx->nfd].events = POLLIN;
-	ctx->pfd[ctx->nfd].revents = 0;
-	ctx->nfd++;
+	pfd = memset(&ctx->pfd[ctx->nfd++], 0, sizeof(struct pollfd));
+	pfd->fd = fd;
+	pfd->events = POLLIN;
 	return 0;
 }
 


More information about the xorg-commit mailing list