test/present: Include composite redirected windows in the test matrix
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
56801202de
commit
6de85a1e60
|
|
@ -210,7 +210,7 @@ if test "x$UDEV" != "xno"; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PKG_CHECK_MODULES(X11, [x11 x11-xcb xcb-dri2 xrender xrandr xext xfixes cairo cairo-xlib-xrender pixman-1 libpng], [x11="yes"], [x11="no"])
|
PKG_CHECK_MODULES(X11, [x11 x11-xcb xcb-dri2 xcomposite xdamage xrender xrandr xext xfixes cairo cairo-xlib-xrender pixman-1 libpng], [x11="yes"], [x11="no"])
|
||||||
AM_CONDITIONAL(HAVE_X11, test "x$x11" = "xyes")
|
AM_CONDITIONAL(HAVE_X11, test "x$x11" = "xyes")
|
||||||
|
|
||||||
cpuid="yes"
|
cpuid="yes"
|
||||||
|
|
@ -275,7 +275,7 @@ if test "x$shm" = "xyes"; then
|
||||||
AC_DEFINE([HAVE_MIT_SHM], 1, [Define to 1 if MIT-SHM is available])
|
AC_DEFINE([HAVE_MIT_SHM], 1, [Define to 1 if MIT-SHM is available])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PKG_CHECK_MODULES(X11_DRI3, [xcb-dri3 xcb-sync xcb-xfixes xcb-present x11-xcb xshmfence x11 xrender xrandr xxf86vm xext libdrm], [x11_dri3="yes"], [x11_dri3="no"])
|
PKG_CHECK_MODULES(X11_DRI3, [xcb-dri3 xcb-sync xcb-xfixes xcb-present x11-xcb xshmfence x11 xcomposite xdamage xrender xrandr xxf86vm xext libdrm], [x11_dri3="yes"], [x11_dri3="no"])
|
||||||
AM_CONDITIONAL(X11_DRI3, test "x$x11_dri3" = "xyes" -a "x$shm" = "xyes")
|
AM_CONDITIONAL(X11_DRI3, test "x$x11_dri3" = "xyes" -a "x$shm" = "xyes")
|
||||||
AM_CONDITIONAL(X11_SHM, test "x$shm" = "xyes")
|
AM_CONDITIONAL(X11_SHM, test "x$shm" = "xyes")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@
|
||||||
#include <X11/Xlibint.h>
|
#include <X11/Xlibint.h>
|
||||||
#include <X11/extensions/dpms.h>
|
#include <X11/extensions/dpms.h>
|
||||||
#include <X11/extensions/randr.h>
|
#include <X11/extensions/randr.h>
|
||||||
|
#include <X11/extensions/Xcomposite.h>
|
||||||
|
#include <X11/extensions/Xdamage.h>
|
||||||
#include <X11/extensions/Xrandr.h>
|
#include <X11/extensions/Xrandr.h>
|
||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <xcb/dri2.h>
|
#include <xcb/dri2.h>
|
||||||
|
|
@ -166,6 +168,22 @@ static void fullscreen(Display *dpy, Window win)
|
||||||
(unsigned char *)&atom, 1);
|
(unsigned char *)&atom, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int has_composite(Display *dpy)
|
||||||
|
{
|
||||||
|
int event, error;
|
||||||
|
int major, minor;
|
||||||
|
|
||||||
|
if (!XDamageQueryExtension (dpy, &event, &error))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!XCompositeQueryExtension(dpy, &event, &error))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
XCompositeQueryVersion(dpy, &major, &minor);
|
||||||
|
|
||||||
|
return major > 0 || minor >= 4;
|
||||||
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
|
|
@ -211,6 +229,7 @@ int main(void)
|
||||||
DRI2CreateDrawable(dpy, root);
|
DRI2CreateDrawable(dpy, root);
|
||||||
DRI2SwapInterval(dpy, root, 0);
|
DRI2SwapInterval(dpy, root, 0);
|
||||||
run(dpy, root, "off");
|
run(dpy, root, "off");
|
||||||
|
XSync(dpy, True);
|
||||||
|
|
||||||
for (i = 0; i < res->noutput; i++) {
|
for (i = 0; i < res->noutput; i++) {
|
||||||
XRROutputInfo *output;
|
XRROutputInfo *output;
|
||||||
|
|
@ -236,6 +255,7 @@ int main(void)
|
||||||
0, 0, output->modes[0], RR_Rotate_0, &res->outputs[i], 1);
|
0, 0, output->modes[0], RR_Rotate_0, &res->outputs[i], 1);
|
||||||
|
|
||||||
run(dpy, root, "root");
|
run(dpy, root, "root");
|
||||||
|
XSync(dpy, True);
|
||||||
|
|
||||||
win = XCreateWindow(dpy, root,
|
win = XCreateWindow(dpy, root,
|
||||||
0, 0, mode->width, mode->height, 0,
|
0, 0, mode->width, mode->height, 0,
|
||||||
|
|
@ -249,6 +269,7 @@ int main(void)
|
||||||
XMapWindow(dpy, win);
|
XMapWindow(dpy, win);
|
||||||
run(dpy, win, "fullscreen");
|
run(dpy, win, "fullscreen");
|
||||||
XDestroyWindow(dpy, win);
|
XDestroyWindow(dpy, win);
|
||||||
|
XSync(dpy, True);
|
||||||
|
|
||||||
win = XCreateWindow(dpy, root,
|
win = XCreateWindow(dpy, root,
|
||||||
0, 0, mode->width, mode->height, 0,
|
0, 0, mode->width, mode->height, 0,
|
||||||
|
|
@ -261,6 +282,30 @@ int main(void)
|
||||||
XMapWindow(dpy, win);
|
XMapWindow(dpy, win);
|
||||||
run(dpy, win, "windowed");
|
run(dpy, win, "windowed");
|
||||||
XDestroyWindow(dpy, win);
|
XDestroyWindow(dpy, win);
|
||||||
|
XSync(dpy, True);
|
||||||
|
|
||||||
|
if (has_composite(dpy)) {
|
||||||
|
Damage damage;
|
||||||
|
|
||||||
|
_x_error_occurred = 0;
|
||||||
|
win = XCreateWindow(dpy, root,
|
||||||
|
0, 0, mode->width, mode->height, 0,
|
||||||
|
DefaultDepth(dpy, DefaultScreen(dpy)),
|
||||||
|
InputOutput,
|
||||||
|
DefaultVisual(dpy, DefaultScreen(dpy)),
|
||||||
|
CWOverrideRedirect, &attr);
|
||||||
|
XCompositeRedirectWindow(dpy, win, CompositeRedirectManual);
|
||||||
|
damage = XDamageCreate(dpy, win, XDamageReportRawRectangles);
|
||||||
|
DRI2CreateDrawable(dpy, win);
|
||||||
|
DRI2SwapInterval(dpy, win, 0);
|
||||||
|
XMapWindow(dpy, win);
|
||||||
|
XSync(dpy, True);
|
||||||
|
if (!_x_error_occurred)
|
||||||
|
run(dpy, win, "composited");
|
||||||
|
XDamageDestroy(dpy, damage);
|
||||||
|
XDestroyWindow(dpy, win);
|
||||||
|
XSync(dpy, True);
|
||||||
|
}
|
||||||
|
|
||||||
win = XCreateWindow(dpy, root,
|
win = XCreateWindow(dpy, root,
|
||||||
0, 0, mode->width/2, mode->height/2, 0,
|
0, 0, mode->width/2, mode->height/2, 0,
|
||||||
|
|
@ -273,6 +318,7 @@ int main(void)
|
||||||
XMapWindow(dpy, win);
|
XMapWindow(dpy, win);
|
||||||
run(dpy, win, "half");
|
run(dpy, win, "half");
|
||||||
XDestroyWindow(dpy, win);
|
XDestroyWindow(dpy, win);
|
||||||
|
XSync(dpy, True);
|
||||||
|
|
||||||
XRRSetCrtcConfig(dpy, res, output->crtcs[c], CurrentTime,
|
XRRSetCrtcConfig(dpy, res, output->crtcs[c], CurrentTime,
|
||||||
0, 0, None, RR_Rotate_0, NULL, 0);
|
0, 0, None, RR_Rotate_0, NULL, 0);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@
|
||||||
#include <X11/xshmfence.h>
|
#include <X11/xshmfence.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/Xlibint.h>
|
#include <X11/Xlibint.h>
|
||||||
|
#include <X11/extensions/Xcomposite.h>
|
||||||
|
#include <X11/extensions/Xdamage.h>
|
||||||
#include <X11/extensions/dpms.h>
|
#include <X11/extensions/dpms.h>
|
||||||
#include <X11/extensions/randr.h>
|
#include <X11/extensions/randr.h>
|
||||||
#include <X11/extensions/Xrandr.h>
|
#include <X11/extensions/Xrandr.h>
|
||||||
|
|
@ -350,6 +352,22 @@ static int has_present(Display *dpy)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int has_composite(Display *dpy)
|
||||||
|
{
|
||||||
|
int event, error;
|
||||||
|
int major, minor;
|
||||||
|
|
||||||
|
if (!XDamageQueryExtension (dpy, &event, &error))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!XCompositeQueryExtension(dpy, &event, &error))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
XCompositeQueryVersion(dpy, &major, &minor);
|
||||||
|
|
||||||
|
return major > 0 || minor >= 4;
|
||||||
|
}
|
||||||
|
|
||||||
static int dri3_query_version(Display *dpy, int *major, int *minor)
|
static int dri3_query_version(Display *dpy, int *major, int *minor)
|
||||||
{
|
{
|
||||||
xcb_connection_t *c = XGetXCBConnection(dpy);
|
xcb_connection_t *c = XGetXCBConnection(dpy);
|
||||||
|
|
@ -451,6 +469,7 @@ static void loop(Display *dpy, XRRScreenResources *res, unsigned options)
|
||||||
attr.override_redirect = 1;
|
attr.override_redirect = 1;
|
||||||
|
|
||||||
run(dpy, root, "off", options);
|
run(dpy, root, "off", options);
|
||||||
|
XSync(dpy, True);
|
||||||
|
|
||||||
for (i = 0; i < res->noutput; i++) {
|
for (i = 0; i < res->noutput; i++) {
|
||||||
XRROutputInfo *output;
|
XRROutputInfo *output;
|
||||||
|
|
@ -476,6 +495,7 @@ static void loop(Display *dpy, XRRScreenResources *res, unsigned options)
|
||||||
0, 0, output->modes[0], RR_Rotate_0, &res->outputs[i], 1);
|
0, 0, output->modes[0], RR_Rotate_0, &res->outputs[i], 1);
|
||||||
|
|
||||||
run(dpy, root, "root", options);
|
run(dpy, root, "root", options);
|
||||||
|
XSync(dpy, True);
|
||||||
|
|
||||||
win = XCreateWindow(dpy, root,
|
win = XCreateWindow(dpy, root,
|
||||||
0, 0, mode->width, mode->height, 0,
|
0, 0, mode->width, mode->height, 0,
|
||||||
|
|
@ -487,6 +507,7 @@ static void loop(Display *dpy, XRRScreenResources *res, unsigned options)
|
||||||
XMapWindow(dpy, win);
|
XMapWindow(dpy, win);
|
||||||
run(dpy, win, "fullscreen", options);
|
run(dpy, win, "fullscreen", options);
|
||||||
XDestroyWindow(dpy, win);
|
XDestroyWindow(dpy, win);
|
||||||
|
XSync(dpy, True);
|
||||||
|
|
||||||
win = XCreateWindow(dpy, root,
|
win = XCreateWindow(dpy, root,
|
||||||
0, 0, mode->width, mode->height, 0,
|
0, 0, mode->width, mode->height, 0,
|
||||||
|
|
@ -497,6 +518,28 @@ static void loop(Display *dpy, XRRScreenResources *res, unsigned options)
|
||||||
XMapWindow(dpy, win);
|
XMapWindow(dpy, win);
|
||||||
run(dpy, win, "windowed", options);
|
run(dpy, win, "windowed", options);
|
||||||
XDestroyWindow(dpy, win);
|
XDestroyWindow(dpy, win);
|
||||||
|
XSync(dpy, True);
|
||||||
|
|
||||||
|
if (has_composite(dpy)) {
|
||||||
|
Damage damage;
|
||||||
|
|
||||||
|
_x_error_occurred = 0;
|
||||||
|
win = XCreateWindow(dpy, root,
|
||||||
|
0, 0, mode->width, mode->height, 0,
|
||||||
|
DefaultDepth(dpy, DefaultScreen(dpy)),
|
||||||
|
InputOutput,
|
||||||
|
DefaultVisual(dpy, DefaultScreen(dpy)),
|
||||||
|
CWOverrideRedirect, &attr);
|
||||||
|
XCompositeRedirectWindow(dpy, win, CompositeRedirectManual);
|
||||||
|
damage = XDamageCreate(dpy, win, XDamageReportRawRectangles);
|
||||||
|
XMapWindow(dpy, win);
|
||||||
|
XSync(dpy, True);
|
||||||
|
if (!_x_error_occurred)
|
||||||
|
run(dpy, win, "composited", options);
|
||||||
|
XDamageDestroy(dpy, damage);
|
||||||
|
XDestroyWindow(dpy, win);
|
||||||
|
XSync(dpy, True);
|
||||||
|
}
|
||||||
|
|
||||||
win = XCreateWindow(dpy, root,
|
win = XCreateWindow(dpy, root,
|
||||||
0, 0, mode->width/2, mode->height/2, 0,
|
0, 0, mode->width/2, mode->height/2, 0,
|
||||||
|
|
@ -507,6 +550,7 @@ static void loop(Display *dpy, XRRScreenResources *res, unsigned options)
|
||||||
XMapWindow(dpy, win);
|
XMapWindow(dpy, win);
|
||||||
run(dpy, win, "half", options);
|
run(dpy, win, "half", options);
|
||||||
XDestroyWindow(dpy, win);
|
XDestroyWindow(dpy, win);
|
||||||
|
XSync(dpy, True);
|
||||||
|
|
||||||
XRRSetCrtcConfig(dpy, res, output->crtcs[c], CurrentTime,
|
XRRSetCrtcConfig(dpy, res, output->crtcs[c], CurrentTime,
|
||||||
0, 0, None, RR_Rotate_0, NULL, 0);
|
0, 0, None, RR_Rotate_0, NULL, 0);
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
#include <X11/Xlibint.h>
|
#include <X11/Xlibint.h>
|
||||||
#include <X11/extensions/dpms.h>
|
#include <X11/extensions/dpms.h>
|
||||||
#include <X11/extensions/randr.h>
|
#include <X11/extensions/randr.h>
|
||||||
|
#include <X11/extensions/Xcomposite.h>
|
||||||
#include <X11/extensions/Xrandr.h>
|
#include <X11/extensions/Xrandr.h>
|
||||||
#include <X11/extensions/Xrender.h>
|
#include <X11/extensions/Xrender.h>
|
||||||
#include <X11/extensions/XShm.h>
|
#include <X11/extensions/XShm.h>
|
||||||
|
|
@ -1774,6 +1775,19 @@ static int has_present(Display *dpy)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int has_composite(Display *dpy)
|
||||||
|
{
|
||||||
|
int event, error;
|
||||||
|
int major, minor;
|
||||||
|
|
||||||
|
if (!XCompositeQueryExtension(dpy, &event, &error))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
XCompositeQueryVersion(dpy, &major, &minor);
|
||||||
|
|
||||||
|
return major > 0 || minor >= 4;
|
||||||
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
|
|
@ -1813,7 +1827,7 @@ int main(void)
|
||||||
error += test_exhaustion_msc(dpy, queue);
|
error += test_exhaustion_msc(dpy, queue);
|
||||||
last_msc = check_msc(dpy, root, queue, last_msc, NULL);
|
last_msc = check_msc(dpy, root, queue, last_msc, NULL);
|
||||||
|
|
||||||
for (dummy = 0; dummy < 3; dummy++) {
|
for (dummy = 0; dummy <= 3; dummy++) {
|
||||||
Window win;
|
Window win;
|
||||||
uint64_t msc = 0;
|
uint64_t msc = 0;
|
||||||
XSetWindowAttributes attr;
|
XSetWindowAttributes attr;
|
||||||
|
|
@ -1829,6 +1843,7 @@ int main(void)
|
||||||
XGetGeometry(dpy, root, &win, &x, &y,
|
XGetGeometry(dpy, root, &win, &x, &y,
|
||||||
&width, &height, &border, &depth);
|
&width, &height, &border, &depth);
|
||||||
|
|
||||||
|
_x_error_occurred = 0;
|
||||||
switch (dummy) {
|
switch (dummy) {
|
||||||
case 0:
|
case 0:
|
||||||
win = root;
|
win = root;
|
||||||
|
|
@ -1848,6 +1863,20 @@ int main(void)
|
||||||
CWOverrideRedirect, &attr);
|
CWOverrideRedirect, &attr);
|
||||||
phase = "window";
|
phase = "window";
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
if (!has_composite(dpy))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
win = XCreateWindow(dpy, root,
|
||||||
|
0, 0, width, height, 0,
|
||||||
|
DefaultDepth(dpy, DefaultScreen(dpy)),
|
||||||
|
InputOutput,
|
||||||
|
DefaultVisual(dpy, DefaultScreen(dpy)),
|
||||||
|
CWOverrideRedirect, &attr);
|
||||||
|
XCompositeRedirectWindow(dpy, win, CompositeRedirectManual);
|
||||||
|
phase = "composite";
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
phase = "broken";
|
phase = "broken";
|
||||||
win = root;
|
win = root;
|
||||||
|
|
@ -1856,6 +1885,9 @@ int main(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
XMapWindow(dpy, win);
|
XMapWindow(dpy, win);
|
||||||
|
XSync(dpy, True);
|
||||||
|
if (_x_error_occurred)
|
||||||
|
continue;
|
||||||
|
|
||||||
Q = setup_msc(dpy, win);
|
Q = setup_msc(dpy, win);
|
||||||
msc = check_msc(dpy, win, Q, msc, NULL);
|
msc = check_msc(dpy, win, Q, msc, NULL);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue