Commit Graph

337 Commits

Author SHA1 Message Date
Olivier Fourdan f788289bdc xfree86: Use libxcvt
Replace the local implementation of the VESA CVT standard timing
modelines generator with the one from libxct to avoid code duplication.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1142
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2021-08-06 11:29:29 +00:00
Povilas Kanapickas f3462178ca test/xi2: Verify that XI_GestureSwipeEnd is ignored when outside mask 2021-05-30 13:26:36 +03:00
Povilas Kanapickas 407a2234b3 test/xi2: Update tests for gesture event types 2021-05-30 13:26:35 +03:00
Povilas Kanapickas d231ce2d9c meson: Disable LTO for tests
`-flto=auto` together with `-Wl,-wrap` causes link errors at least in
certain compilers (e.g. GCC 10.2.0). Since this is reoccurring issue
(internet search shows similar problems with GCC 4.6 a decade ago) let's
disable LTO for tests even if it's disabled elsewhere.

Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1116
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2021-04-09 11:18:54 +00:00
Olivier Fourdan 3cdac5ba07 mi: List extensions in usage message
Not all extensions can be enabled or disabled at runtime, list the
extensions which can from the help message rather than on error only.

v2:
 * Print the header message in the ListStaticExtensions() (Peter
   Hutterer)
 * Do not export ListStaticExtensions() as Xserver API

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2021-01-29 12:52:09 +00:00
Povilas Kanapickas 07e6935030 test/xi2: Fix mask size in XISelectEvents test
XI2LASTEVENT identifies the bit number, not the mask size in bits. The
mask size in bits is XI2LASTEVENT + 1 and the mask size in bytes is
(XI2LASTEVENT + 8) / 8 or XI2MASKSIZE.
2020-11-25 04:20:22 +00:00
Michel Dänzer 250db8708a xwayland: Add and hook up test script
It runs XTS via piglit on (non-rootless) Xwayland on weston using the
headless backend.

Xwayland might use glamor if enabled in the build, but we're making sure
it uses software rendering.

v2:
* Use weston-info to wait for weston to be ready, instead of just a
  fixed sleep. (Martin Peres)
v3:
* Build wayland 1.18 & weston 9.0 locally, since the packages in Debian
  buster are too old for current Xwayland.

Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2020-11-17 18:21:37 +01:00
Martin Weber 9bf33bab32 test: Fix struct initialization warning 2020-05-08 16:45:50 +02:00
Michel Dänzer 794fd7e563 tests/misc: Drop redundant screenInfo declaration
GCC warned about it:

../test/misc.c:36:19: warning: redundant redeclaration of ‘screenInfo’ [-Wredundant-decls]
   36 | extern ScreenInfo screenInfo;
      |                   ^~~~~~~~~~
In file included from ../test/misc.c:30:
../include/scrnintstr.h:688:29: note: previous declaration of ‘screenInfo’ was here
  688 | extern _X_EXPORT ScreenInfo screenInfo;
      |                             ^~~~~~~~~~
2020-01-28 20:35:06 +00:00
David Seifert 435d41d5ff Fix building with `-fno-common`
* GCC 10 will switch the default to `-fno-common`.
  https://gcc.gnu.org/PR85678

Bug: https://bugs.gentoo.org/705880
Signed-off-by: Matt Turner <mattst88@gmail.com>
2020-01-27 21:46:31 +00:00
Adam Jackson c1703cdf3b xfree86: Link fb statically
There's no real benefit to leaving this loadable, virtually every driver
is going to load it.

Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2019-07-23 14:24:00 -04:00
Adam Richter 9d25408a59 assert(a && b) --> assert(a); assert(b)
Separate each statement of the form "assert(a && b);" into "assert(a);"
and "assert(b);" for more precise diagnostics, except for this clever
use in drmmode_display.c where it was used to pass a hint to developers:

	assert(num_infos <= 32 && "update return type");
2019-05-02 15:02:36 -07:00
Jon Turney dd1aebccf2 travis: Suppress uninteresting warnings on OSX
Suppress uninteresting warnings on OSX that we are drowning in, turned
on by default in meson.
2019-05-02 15:42:58 +00:00
Jon Turney f0e22a76c9 travis: Add OSX meson build to matrix
Unfortunately, a 'brew update' is currently needed to get the meson >=
0.46.0 required by xserver.
2019-05-02 15:42:58 +00:00
Jon Turney 0bdfa5bc0a travis: Don't produce fat binaries on OSX
Trying to build fat binaries for multiple arches tickles a bug [1] in
the framework detector in meson 0.50.  Workaround this by not bothering
building for x86, which is probably no great loss :S

https://github.com/mesonbuild/meson/issues/5290
2019-05-02 15:42:58 +00:00
Jon Turney 1f5742d271 meson: Fix building unit tests when protocol headers aren't in default include path 2019-04-29 11:49:46 +00:00
Eric Anholt 0a005c4fe4 test: Fix meson build with xvfb disabled.
Fixes #678

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-04-04 16:26:40 -07:00
Jon Turney f1790339d0 tests: Always separate rendercheck -f and -o options with a space 2019-04-02 13:12:42 +01:00
Eric Anholt 3f3c489e51 test: Trim the Render ops that we test the composite paths on.
We cover all Render ops under the "blend" group, so when we're doing
the cross products of some formats for the masking operation, skip
most of the ops (covering just zero, one, and src/dst alpha blend
factors along with a definitely non-glamor-accelerated one) .

All the tests now complete in <20s of runtime on my skylake.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-28 13:55:22 -07:00
Eric Anholt 58c168ad93 test: Execute rendercheck tests without using piglit.
This gets us parallelism between rendercheck tests at the cost of
spinning up more Xvfbs, and nicer logging of the tests that are run.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-28 13:55:19 -07:00
Eric Anholt 05ded049ac test: Skip a few tests on glamor that are known to fail on llvmpipe.
Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-27 09:57:53 -07:00
Eric Anholt 164a37eac2 simple-xinit: Introduce an escaped "--" argument.
For testing xephyr-glamor on top of Xvfb in CI better, I want to be
able to make one command line describing the nested server invocation,
but that means I need to get two simple-xinits to split client/server
on different "--" arguments.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-27 09:50:19 -07:00
Eric Anholt 29aed56ec7 simple-xinit: Avoid hanging if the server fails to set up the display fd.
Early fatal errors may leave us with nothing in the displayfd pipe,
and we'd block forever.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-27 09:50:19 -07:00
Jon Turney 9114c4341c meson: Drop a meson version check
Drop some code conditional on meson version, which is not needed
since 7e046b94 bumped the minimum meson version
2019-03-14 21:23:23 +00:00
Michel Dänzer d12881ea1d Revert "ci: Work around broken python UTF8 handling in the CI docker image"
This reverts commit 899d260701.

No longer necessary with the previous changes.

Reviewed-by: Eric Anholt <eric@anholt.net>
2018-12-17 17:52:39 +01:00
Michel Dänzer 4aaaf69229 test: Use .../piglit instead of .../piglit-*.py
The latter use Python 2 and break with any non-ASCII characters in the
environment, the former uses Python 3 and works fine in that case.

Reviewed-by: Eric Anholt <eric@anholt.net>
2018-12-17 17:52:39 +01:00
Michel Dänzer f56d8e2282 gitlab-ci: Docker image can be generated as part of pipeline
This removes the dependency on an externally generated docker image, and
should make it easier to update the docker image or make other changes
related to it.

This is based on Debian testing, because I'm most familiar with Debian.
But it should be easy to base it on another distro.

v2:
* Use kaniko instead of docker-in-docker for image generation, so it can
  also work in unprivileged runners.
* Drop piglit.conf & tetexec.cfg overrides, just make sure the files in
  the image work.
2018-12-17 17:40:08 +01:00
Michel Dänzer ed44f9cd6a Drop Travis Linux build in favour of GitLab CI
Fold build-travis-deps.sh into .gitlab-ci.yml.

Preparation for the next change, which would break the Travis Linux
build.

Reviewed-by: Eric Anholt <eric@anholt.net>
2018-12-17 15:40:52 +01:00
Jon Turney 0e541b1093 meson: Add misc unit tests
v2:
has_link_argument requires meson 0.46.0
2018-12-14 11:32:31 +00:00
Peter Hutterer fde27b9b48 test: fix failing tests
Broken since 69d8ea4a49 because our fake screen
didn't have a root window and writing the XKB rules prop would happily
segfault. Fix this by setting up the required bits.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Michel Dänzer michel.daenzer@amd.com
2018-12-14 10:49:23 +10:00
Michel Daenzer c1bb392b1d travis: Use a single meson invocation
The prefix setting didn't take for some reason.
2018-12-12 12:55:57 +01:00
Adam Jackson 899d260701 ci: Work around broken python UTF8 handling in the CI docker image
Gitlab very kindly exposes the details of the git commit message (among
much else) in the environment. Unfortunately, piglit tries to handle the
environment in non-UTF8-safe ways, which means if the top-of-tree commit
mentions non-ASCII characters (say, in the author's name) then all the
tests fail and so does the pipeline.

Fortunately none of those variables are things our piglit invocation
needs. Since I've failed to rebuild the docker image as yet, just clear
the likely variables from the environment before running piglit.

This-makes-me: ☹
2018-12-11 12:41:26 -05:00
Jon Turney feca61cdb5 test: Initialize the pixmap in damage test 2018-09-28 20:02:54 +00:00
Eric Anholt 89901e14d2 test: Add the start of a testsuite for damage.
Inspired by the previous bug, build something we can use to write
damage testcases, including testing for the bug.

Signed-off-by: Eric Anholt <eric@anholt.net>
2018-09-25 21:27:08 -07:00
Adam Jackson 243a34e170 travis: Bump rawhide image
The image now has enough mojo to run xts, hooray!

Note there's a couple of ugly bits in here. The piglit config fragment
and stock tetexec.cfg reflect missing features from the test suites
(using an installed copy of xts, figuring out the xserver test matrix at
runtime, etc.), I'll be happy to remove them once the tests are fixed.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-21 12:11:23 -04:00
Adam Jackson 8718d46157 ci: Ignore builds for branches aimed at other CI services
Make appveyor ignore builds for /travis.*/ and vice versa. If you're
only testing a Windows change, building for OSX and Linux too is a bit
rude.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-21 09:35:38 -04:00
Adam Jackson 8f628033be travis: Update OSX build
Install and use xorgproto, and build with optimization as clang has
warnings that only work above -O0. Also expand the build matrix for both
Xcode 8.3 and 9.2. Both images are OSX 10.12 at the moment so this is
really just a way to test with clang 8 vs 9.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-14 15:12:49 -04:00
Adam Jackson 1ca092f990 travis: Switch linux build from stretch to rawhide
Stretch's Mesa is too far behind, and building Mesa to build xserver is
not the sort of problem we're trying to solve here. But our Travis
scripts run inside a docker image, and that image can be whatever, so
since I have to keep rawhide building anyway let's switch to that for
now. The dockerfile can be found at:

https://github.com/nwnk/xserver-travis

The $DISTRO part of the change is foreshadowing for the day we readd a
(probably sid-based) debian image; patches for other environments are
welcome.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-14 15:08:34 -04:00
Adam Jackson 67c303fff3 miinitext: Load GLX on the mi path
Add a stub for Xnest so it continues to link, but otherwise we support
GLX on every server so there's no need to make every DDX add it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:04:48 -05:00
Adam Jackson 3db7707df3 test: Fix build dependency for bigreq test
libxcb-xinput isn't a thing in whichever Ubuntu it is that Travis is
using. The test is already optional, make it more so.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-12-08 11:36:24 -05:00
Eric Anholt 14af8bee24 test: Add a test for the overflow bug in bigreqs.
The failing struct comes from the python test written by Michal Srb
<msrb@suse.com>.

v2: Use a drawable (root window) and gc, so that PolyLines hopefully
    actually tries processing things.  However, the request seems to
    process successfully so the poll() just stalls out.  However, this
    does let us distinguish between detecting the bigrequests error
    and not, at least.
v3: Clean up the description of what we expect the poll() call to do.
v4: Use XI2 instead of PolyLine to trigger a predictable error. We know the
    server replies with BadValue for a zero num_masks argument. So if we send
    a bigreq with a num_masks 0 and a length 0, we can just check whether we
    get killed (good) or a BadValue (bad). It doesn't test for specific memory
    overflows or crashes, but based on the assumption that we shouldn't look
    at *any* BigReq of size 0, this seems to be sufficient.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-01 10:29:00 +10:00
Daniel Martin d5379b350f Use ARRAY_SIZE all over the tree
Roundhouse kick replacing the various (sizeof(foo)/sizeof(foo[0])) with
the ARRAY_SIZE macro from dix.h when possible. A semantic patch for
coccinelle has been used first. Additionally, a few macros have been
inlined as they had only one or two users.

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-10-30 13:45:20 -04:00
Daniel Martin 15a32ee5d1 test: signal-logging: Fix looping signed number tests
unsigned_tests[] was used to compute the amount of signed numbers to
test.

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-30 13:44:53 -04:00
Daniel Martin 0bcc65f2bf test: input: Fix used uninitialized warning in dix_event_to_core
input.c: In function ‘dix_event_to_core’:
../include/inputstr.h:61:55: warning: ‘*((void *)&ev+80)’ is used uninitialized in this function [-Wuninitialized]
 #define SetBit(ptr, bit)  (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
                                                       ^~

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-30 13:44:45 -04:00
Adam Jackson 041f25afa8 test: const correctness fix
../test/sync/sync.c: In function ‘main’:
../test/sync/sync.c:288:40: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
     xcb_query_extension_reply_t *ext = xcb_get_extension_data(c, &xcb_sync_id);
                                        ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-04 11:19:09 -04:00
Adam Jackson 0888b22fea test: Fix a thinko in simple-xinit
Spotted by clang courtesy of the shiny new OSX Travis target:

simple-xinit.c:90:65: warning: sizeof on pointer operation will return size of 'char *' instead of 'char [10]' [-Wsizeof-array-decay]
    ret = read(displayfd, display_string, sizeof(display_string - 1));

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-09-25 15:37:59 -04:00
Jon Turney 0b00440678 travis: Also build on OSX
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-09-23 22:47:36 -07:00
Eric Anholt 5cbfa27654 test: Add basic SYNC tests.
I couldn't find any, and I was modifying the implementation, so I had
to write some.  I would like the test to end with a "make sure there
weren't any stray unchecked errors", but I didn't figure out how to do
that.

v2: Extend sync tests to cover alarm delta and waitvalue changes.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-09-20 13:19:27 -04:00
Eric Anholt 3336291fc6 test: Return error from simple-xinit if the client crashes.
I want to be able to call client tests with simple-xinit, so assertion
failures should be an error.

v2: Clean up identical returns.

Signed-off-by: Eric Anholt <eric@anholt.net>
2017-09-20 13:19:27 -04:00
Eric Anholt a8eeb332cc meson: Add Xvfb and Xephyr-glamor testing.
The Xvfb tests are passing and Xephyr-glamor is failing for me, but it
fails identically on autotools.  It's disabled on Travis for now
because the >10 minutes of silence during testing times out the entire
build.

v2: Fix the disable on travis.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-09-20 13:19:25 -04:00