summaryrefslogtreecommitdiff
path: root/tests/glx
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-06-24 13:30:51 -0400
committerDave Airlie <airlied@redhat.com>2014-06-27 10:16:02 +1000
commitfe3ba4d6a1fda3b146a57129edd83eafd40e27ae (patch)
tree7f45be1855e0c3f08fd1db002d3a93e276e998b2 /tests/glx
parentcf8ebc82db98dc011020e5937360d6ce69d49493 (diff)
glx-swap-event: Make sure that swap events are on the correct drawable
DRI2 had a bug in its implementation which caused the GLX_BufferSwapComplete event to be emitted for the X11 Drawable, instead of the GLXDrawable instead, as the specification for INTEL_swap_event says should happen. This didn't happen for indirect GLX contexts or for DRI3, which properly sent out the GLXDrawable inside the code. Since userspace already relies on getting the X11 Drawable, we are fixing the spec and mesa to be based around the X11 Drawable instead. Make sure that the event has the X11 Drawable in its drawable field. Corresponds to mesa commit b4dcf87f34f68111acd9d364739938721fc692f4 Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'tests/glx')
-rw-r--r--tests/glx/glx-swap-event.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/glx/glx-swap-event.c b/tests/glx/glx-swap-event.c
index 310e634e2..baae6f32d 100644
--- a/tests/glx/glx-swap-event.c
+++ b/tests/glx/glx-swap-event.c
@@ -379,7 +379,6 @@ void
handle_event(Display *dpy, Window win, XEvent *event)
{
(void) dpy;
- (void) win;
if ( Glx_event == event->type) {
XEvent * event_p=event;
@@ -400,6 +399,11 @@ swap_start[count], swap_returned[count], (time_fin-swap_start[count]));
t_last=time_fin;
}
+ if (glx_event->drawable != win) {
+ printf("Error: swap event was not on X11 Drawable\n");
+ piglit_report_result(PIGLIT_FAIL);
+ }
+
if (glx_event->sbc == 0) {
printf("Error: swap event returned 0 swap count\n");
piglit_report_result(PIGLIT_FAIL);
@@ -442,7 +446,7 @@ swap_start[count], swap_returned[count], (time_fin-swap_start[count]));
static void
-event_loop(Display *dpy, GLXWindow win)
+event_loop(Display *dpy, GLXWindow glxWin, Window win)
{
while (1) {
while (XPending(dpy) > 0) {
@@ -452,7 +456,7 @@ event_loop(Display *dpy, GLXWindow win)
handle_event(dpy, win, &event);
}
- draw_frame(dpy, win);
+ draw_frame(dpy, glxWin);
}
}
@@ -534,7 +538,7 @@ main(int argc, char *argv[])
}
}
piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
- event_loop(dpy, glxWin);
+ event_loop(dpy, glxWin, win);
glXDestroyContext(dpy, ctx);
XDestroyWindow(dpy, win);