diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-05-21 12:52:18 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-02 08:32:11 +0100 |
commit | 9cf6cd9726ed5ba73bb8c38c06f7b5c78706309b (patch) | |
tree | e9479e8a91d2f0cf06e2b0dd14dd231e8aff5b97 /test/dri3.c | |
parent | 6ab6734369fbd902a23109f4c3626df9d529891c (diff) | |
download | xorg-driver-xf86-video-intel-9cf6cd9726ed5ba73bb8c38c06f7b5c78706309b.tar.gz |
Add rudimentary tests for Present
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'test/dri3.c')
-rw-r--r-- | test/dri3.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/dri3.c b/test/dri3.c index 99503310..b5eb4baf 100644 --- a/test/dri3.c +++ b/test/dri3.c @@ -38,9 +38,12 @@ Pixmap dri3_create_pixmap(Display *dpy, int fd, int bpp, int stride, int size) { xcb_connection_t *c = XGetXCBConnection(dpy); - xcb_pixmap_t pixmap = xcb_generate_id(c); - xcb_dri3_pixmap_from_buffer(c, pixmap, draw, size, width, height, stride, depth, bpp, fd); - return pixmap; + if (fd >= 0) { + xcb_pixmap_t pixmap = xcb_generate_id(c); + xcb_dri3_pixmap_from_buffer(c, pixmap, draw, size, width, height, stride, depth, bpp, fd); + return pixmap; + } + return NullPixmap; } int dri3_create_fd(Display *dpy, |