Commit graph

36 commits

Author SHA1 Message Date
Andrea Canciani
549b1f8d4b boilerplate: Remove unused thread id parameter
The thread id is not used anymore (it is always == 0), so it can be
removed.
2011-11-12 20:49:08 +01:00
Uli Schlachter
a1be14693b boilerplate-xcb: Print sequence numbers
The boilerplate code will now also print the low 16 bits of the sequence number
for errors and events. This should make it a lot easier to find errors in e.g.
a long xtrace output.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-16 17:45:27 +02:00
Uli Schlachter
7ba28ff563 cairo-xcb: Require libxcb 1.6
Since commit 968eb30bba, we use xcb_discard_reply(). This function was
added in libxcb 1.6.

"Fixes": https://bugs.freedesktop.org/show_bug.cgi?id=40925

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-16 17:45:27 +02:00
Chris Wilson
fcea0f8e08 test: Use the test-traps as the reference images for xlib/xcb
The test-traps provides a reference implementation of the
traps-compositor as used by xlib, so we can use it to generate the
reference images as well. (Of course checking that test-traps is itself
correct and only differs in the renderer! ;-)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-16 11:09:22 +01:00
Uli Schlachter
83df0ab2b6 XCB: Store the flags per-connection only
Every xcb surface had its own copy of the flags from the time that it was
created. This means that, if you want to make use of
cairo_xcb_device_debug_cap_xrender_version() and
cairo_xcb_device_debug_cap_xshm_version(), you first had to create a dummy xcb
surface, use that to get access to the cairo_device_t so that you can use these
functions and only then create your real surface, because the change only
affected new surfaces.

This commit changes everything to use the connection's flag and removes the
per-surface flags. This avoids the dummy surfaces completely.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-21 16:51:26 +02:00
Chris Wilson
d5d4a0f240 xcb: Take advantage of clip-boxes
A demonstration of step 2, improves performance for selected benchmarks
on selected GPUs by up to 30%.

firefox-fishbowl on snb {i5-2520m): 42s -> 29s.
firefox-talos-gfx on snb: 7.6 -> 5.2s.
firefox-fishbowl on pnv (n450): 380 -> 360s.

Whist this looks like it is getting close to as good as we can achieve,
we are constrained by both our API and Xrender and fishbowl is about 50%
slower than peak performance (on snb).

And it fixes the older performance regression in firefox-planet-gnome.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-20 13:19:38 +01:00
Uli Schlachter
77b6563c21 xcb: Use defines instead of magic numbers
render.h gives us nice descriptive names for the precise/imprecise poly modes.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-24 15:59:08 +02:00
Chris Wilson
bf1b08d066 perf 2011-06-02 08:57:13 +01:00
Chris Wilson
9bdfae6e21 boilerplate/xcb: Fix silly cut'n'paste errors in previous commit
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-01 16:57:30 +01:00
Chris Wilson
63bdae27a8 xlib,xcb: Force strict adherence to the Render specification when testing
Introduce cairo_xlib_device_debug_set_precision() to override the
automatic selection of rendering precision and force the Xorg/DDX to
strictly adhere to the precise rendering mode of the Render
specification. This allows us to test drivers without worrying, too
much, about minor discrepancies in antialiasing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-01 16:50:25 +01:00
Uli Schlachter
f934491125 xcb boilerplate: Handle device offsets correctly
When running cairo-test-suite with "-a", backends are also tested with a
non-zero device offset. However, for "xcb-window&" the boilerplate incorrectly
overwrote the device offset with a zero offset again.

This caused all test results to be offset by 25 pixels which obviously makes all
tests fail.

Just removing the call to cairo_surface_set_device_offset solves the problem.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-04 16:37:13 +01:00
Uli Schlachter
a87001c063 xcb: Fix premature pixmap free in boilerplate cleanup
A xcb surface has to be finished before the associated drawable can be freed or
there will be X11 errors when the surface is later finished or used again.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-05 22:04:45 +01:00
Uli Schlachter
673c44d3e8 xcb: Check the check for errors in boilerplate
We have to make sure we received all errors that the X server sent out before we
can be sure there are none. To do so, we just have to send some request and wait
for its reply, because that guarantees that the replies/errors to all previous
requests were received.

_cairo_boilerplate_xcb_synchronize doesn't need this, because the GetImage
request already makes sure we received everything.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-05 22:04:45 +01:00
Uli Schlachter
51626ed2ee xcb: Check harder for X11 errors in boilerplate
This commit makes the boilerplate code check for errors from the X server before
disconnecting and during synchronize. This should make sure no errors are ever
lost and silently ignored.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-05 22:04:45 +01:00
Uli Schlachter
f8277dfdaf xcb: Only print the first error and ignore subsequent ones
It is quite likely that following errors are caused by the previous ones. To
avoid flooding users we now silently discard all the errors and events after the
first one.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-05 22:04:45 +01:00
Uli Schlachter
8a65279ee1 xcb: Add a define for some magic number
In X11, errors look like events with response_type == 0. Using a define looks
better than just a "trust me!".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-05 22:04:45 +01:00
Uli Schlachter
8957e50632 xcb: Handle events in boilerplate
Cairo shouldn't cause any events during a test run. Verify this by explicitly
handling events, too.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-05 22:04:45 +01:00
Uli Schlachter
6383e1442c XCB: Check screen size in boilerplate
Trying to create a window for drawing that is larger than the available screen
space is a bad idea. When the test finishes and tries to grab the resulting
image from the X server, the window's area that is outside of the screen will
have undefined content.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-07 12:51:56 +00:00
Benjamin Otte
a1c4b001a5 boilerplate: Add a describe vfunc
This function is supposed to describe the backend in use. The describe
function is optional - and therefore initialized as NULL everywhere.
Note:
It is well known that the xlib backend uses X. What is not known is what
version the server supports or what graphics card it is running on. That
is the information the describe vfunc is supposed to provide.
2010-07-03 02:55:52 +02:00
M Joonas Pihlaja
b036a09972 whitespace: Fixup formal arguments and tabs in boilerplate/ and perf/.
Ran a script to align the formal parameters of functions and
collapse spaces to tabs in code.
2010-06-24 15:02:53 +03:00
Chris Wilson
d45c7dc62d xcb: discard glyph mask and use dst directly when possible. 2010-05-12 20:54:48 +01:00
Chris Wilson
e540d040bd xcb: trivial memfault fixes.
The first fixes required to kick-start memfault testing of the xcb
backend.
2010-05-10 13:36:53 +01:00
Chris Wilson
97f8c20727 boilerplate: Create an image16 target
In order to exercise the newly restored r5g6g5 support, we need to
create an appropriate surface and feed it through the test and
performance suites.
2010-03-27 21:53:55 +00:00
M Joonas Pihlaja
1a7ba1a806 xcb: Update minimum required versions of libxcb.
The new xcb surface uses xcb_writev() and xcb_take_socket()
which were introduced in libxcb 1.1.92.  The boilerplate
in turn uses the major_code and minor_code fields in
xcb_generic_error_t, which were introduced in 1.4.
2010-03-01 01:23:17 +02:00
Chris Wilson
1236c41072 xcb: Refresh.
Still an experimental backend, it's now a little too late to stabilise
for 1.10, but this should represent a major step forward in its feature
set and an attempt to catch up with all the bug fixes that have been
performed on xlib. Notably not tested yet (and expected to be broken)
are mixed-endian connections and low bitdepth servers (the dithering
support has not been copied over for instance). However, it seems robust
enough for daily use...

Of particular note in this update is that the xcb surface is now capable
of subverting the xlib surface through the ./configure --enable-xlib-xcb
option. This replaces the xlib surface with a proxy that forwards all
operations to an equivalent xcb surface whilst preserving the cairo-xlib
API that is required for compatibility with the existing applications,
for instance GTK+ and Mozilla. Also you can experiment with enabling a
DRM bypass, though you need to be extremely foolhardy to do so.
2010-01-22 23:01:52 +00:00
Chris Wilson
3928415923 [boilerplate/xcb] Fix pixmap depth
All the error checking, finally pointed out that I was creating a pixmap
with the wrong depth! Oops.
2009-09-30 20:11:12 +01:00
Chris Wilson
e9bc2180d7 [xcb] Deferred error checking.
XCB avoids the dreaded abort on XError mechanism by forcing the client
to perform deferred error checking. So do so. This allows us to combine
the fire-and-forget rendering model with accurate error checking,
without killing the client or mixing our errors with theirs.

XCB for the win!
2009-09-30 20:11:07 +01:00
Chris Wilson
8e4e0aa7ee [boilerplate/xcb] Check for connection errors during test 2009-09-30 17:50:35 +01:00
Chris Wilson
c4c7db9675 [boilerplate] Use xlib as fallback reference for xcb
And exercise RGB code-paths.
2009-09-01 14:59:36 +01:00
Chris Wilson
8078cd194e [boilerplate] Runtime library check
For the purposes of benchmarking it is useful to run cairo-perf against a
different library from the one it was compiled against. In order to do so,
we need to check that the runtime library contains the required entry
points for our targets - which we can check by using dlsym.
2009-08-29 17:07:38 +01:00
Chris Wilson
88cb69b10c [boilerpate] Move target definition to backends.
By moving the backend target definition out of the massive amlagamated
block in cairo-boilerplate.c and into each of the
cairo-boilerplate-backend.c, we make it much easier to add new targets as
the information need only be entered in a single file and not scattered
across three. However, updating the target interface means trawling across
all the files -- except given that I found it difficult maintaining the
single massive array I do not see this as an increase in the maintenance
burden.
2009-07-04 21:43:27 +01:00
Chris Wilson
86624627e4 [test] Add group-unaligned
Test case for:
   Bug 22441 -- Unexpected shift with push_group and pop_group
   https://bugs.freedesktop.org/show_bug.cgi?id=22441

This is a test that demonstrates the error in the pdf backend when using
groups on surfaces with non-integer sizes. In order to create such a
surface, we need to update the boilerplate to use doubles instead of
integers when specifying the surface size.
2009-06-27 17:53:18 +01:00
Chris Wilson
388ae177e4 [boilerplate] Remove CAIRO_BOILERPLATE_LOG()
The variadic macro is only used within boilerplate/ so replace it with a
simple, and portable, call to fprintf.
2009-01-03 22:56:17 +00:00
Chris Wilson
436c0c8be2 [test] Preparatory work for running under memfault.
In order to run under memfault, the framework is first extended to handle
running concurrent tests - i.e. multi-threading. (Not that this is a
requirement for memfault, instead it shares a common goal of storing
per-test data).  To that end all the global data is moved into a per-test
context and the targets are adjusted to avoid overlap on shared, global
resources (such as output files and frame buffers). In order to preserve
the simplicity of the standard draw routines, the context is not passed
explicitly as a parameter to the routines, but is instead attached to the
cairo_t via the user_data.

For the masochist, to enable the tests to be run across multiple threads
simply set the environment variable CAIRO_TEST_NUM_THREADS to the desired
number.

In the long run, we can hope the need for memfault (runtime testing of
error paths) will be mitigated by static analysis. A promising candidate
for this task would appear to be http://hal.cs.berkeley.edu/cil/.
2008-08-13 21:54:59 +01:00
Behdad Esfahbod
99737a60cb [boilerplate] Clean up includes and remove unnecessary ones 2007-04-20 00:52:03 -04:00
Behdad Esfahbod
06b657ccf1 [boilerplate] Strip xcb boilerplate into cairo-boilerplate-xcb* 2007-04-20 00:52:02 -04:00