Commit graph

420 commits

Author SHA1 Message Date
Chris Wilson
c3f2db4f73 [drm] Add an accelerated image surface.
Use the DRM interface to h/w accelerate composition on image surfaces.
The purpose of the backend is simply to explore what such a hardware
interface might look like and what benefits we might expect.  The
use case that might justify writing such custom backends are embedded
devices running a drm compositor like wayland - which would, for example,
allow one to write applications that seamlessly integrated accelerated,
dynamic, high quality 2D graphics using Cairo with advanced interaction
(e.g. smooth animations in the UI) driven by a clutter framework...

In this first step we introduce the fundamental wrapping of GEM for intel
and radeon chipsets, and, for comparison, gallium. No acceleration, all
we do is use buffer objects (that is use the kernel memory manager) to
allocate images and simply use the fallback mechanism. This provides a
suitable base to start writing chip specific drivers.
2009-07-23 16:18:42 +01:00
Chris Wilson
bed2701e1c Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)

In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.

Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:

ppc:
Speedups
========
image-rgba         evolution-20090607-0    1026085.22 0.18% -> 672972.07 0.77%:  1.52x speedup
▌
image-rgba         evolution-20090618-0    680579.98 0.12% -> 573237.66  0.16%:  1.19x speedup
▎
image-rgba      swfdec-fill-rate-4xaa-0    460296.92 0.36% -> 407464.63  0.42%:  1.13x speedup
▏
image-rgba      swfdec-fill-rate-2xaa-0    128431.95 0.47% -> 115051.86  0.42%:  1.12x speedup
▏
Slowdowns
=========
image-rgba     firefox-periodic-table-0    56837.61 0.78% -> 66055.17    3.20%:  1.09x slowdown
▏
2009-07-23 15:32:14 +01:00
Chris Wilson
6c28c7a1e2 [perf] Add a simple report printer.
After a run, it can be useful to reprint the results, so add
cairo-perf-print to perform that task.

For the future, I'd like to move the performance suite over to the
git/perf style of single, multi-function binary.

The sequence of operations that I typically do are:

./cairo-perf-trace -r -v -i 6 > `git describe`.`hostname`.perf
./cairo-perf-diff-files REVA REVB
./cairo-perf-print REVA
./cairo-perf-compare-backends REVA

which misses the caching available with cairo-perf-diff. 'make html' is
almost what I want, but still too prescriptive. However, that does need to
be addressed for continuous performance monitoring.

Along the perf lines, those sequence of operations become:
  ./cairo-perf record -i 6
  ./cairo-perf report
  ./cairo-perf report REVA REVB
  ./cairo-perf report --backends="image,xlib,gl" REVA REVB
  ./cairo-perf report --html REVA REVB

Also we want to think about installing the cairo-perf binary. So we want
to differentiate when run inside a git checkout.
2009-07-23 15:32:12 +01:00
Chris Wilson
bfbe875ded [gl] Enable GL backend for cairo-perf-trace 2009-07-22 07:52:30 +01:00
Chris Wilson
1ae5942a3a Merge commit 'anholt/gl'
Conflicts:
	boilerplate/Makefile.sources
	boilerplate/cairo-boilerplate.c
	build/configure.ac.features
	src/cairo.h
	util/cairo-script/Makefile.am
2009-07-21 22:28:44 +01:00
Chris Wilson
fd9df4978d [perf] Don't override CAIRO_TRACE_DIR in cairo-perf-diff 2009-07-21 20:53:14 +01:00
Chris Wilson
2dd97ae59c [perf] Include trace comparison in html output 2009-07-20 22:20:01 +01:00
Chris Wilson
f30cee70f5 [perf] Search multiple directories for traces
In view of sharing traces between multiple builder, add some system wide
directories to the search path. This should be refined to a single
canonical location before release.
2009-07-20 22:20:01 +01:00
Chris Wilson
9a65b4a116 [perf] Add cairo-traces to .gitignore 2009-07-14 19:11:56 +01:00
Chris Wilson
6003ab77e1 Export meta-surface
The meta-surface is a vital tool to record a trace of drawing commands
in-memory. As such it is used throughout cairo.

The value of such a surface is immediately obvious and should be
applicable for many applications. The first such case is by
cairo-test-trace which wants to record the entire graph of drawing commands
that affect a surface in the event of a failure.
2009-07-03 18:26:50 +01:00
Chris Wilson
8f4611a94b [perf] Fix use-after-free when retrieving error line number
We find out the status on destroying the script and then attempt to query
the defunct script for more info about the error. Wrong.
2009-07-01 19:45:06 +01:00
Chris Wilson
7c160dea54 [perf] Unbreak cairo-perf-diff builder 2009-07-01 10:12:50 +01:00
Chris Wilson
3d88f99668 [perf] Enable cairo-perf-trace in cairo-perf-diff
Only as a --trace option for now.
2009-07-01 09:57:56 +01:00
Chris Wilson
1564d67d63 [perf] Exclude the xlib-reference target from cairo-perf 2009-06-30 22:23:21 +01:00
Chris Wilson
b7f68d3518 [perf] Enable trace directory recursion.
I have an idea to categorise traces within their own subdirectories and so
for convenience added path walking to cairo-perf-trace. Principally this
should allow for forests of symlinks of all types.
2009-06-30 20:46:12 +01:00
Chris Wilson
3759c7b34b [perf] Enable the null-backend for trace replays. 2009-06-27 19:38:30 +01:00
Chris Wilson
d2244053dc [perf] Force rebuild if make fails
The build system has a singular failure whereby if a backend disappears
between on compile and the next, automake will fail to reconstruct the
Makefiles - resulting in a broken build. Attempt to fix this by removing
the build dir and recloning, which should work for any corrupt caches but
obviously will fail again at a true build failure.
2009-06-21 10:13:31 +01:00
Chris Wilson
ef0d307d54 [perf] Need to version surface types
As cairo-perf-diff will execute the current cairo-perf against historical
revisions, any introduced api must be protect in order to compile on old
versions.
2009-06-21 10:13:31 +01:00
Chris Wilson
44b72ba6d7 [perf] Add a non-build mode to graph
Add --show to cairo-perf-graph just to graph perf files that currently
exist and not build the missing cases.
2009-06-21 10:13:31 +01:00
Chris Wilson
d4dd6fcf3a [perf] Show speedup/slowdownn labels on graph
Add labels show that it is clear which direction is faster on the graph.
2009-06-21 10:13:30 +01:00
Chris Wilson
18edea36ba [perf] Report line of error during trace
Query the number of new lines processed so far and report that on hitting
an error.
2009-06-19 14:14:32 +01:00
Vladimir Vukicevic
22587f57bd Import Qt backend by Mozilla
Written by Vladimir Vukicevic to enable integration with Qt embedded
devices, this backend allows cairo code to target QPainter, and use
it as a source for other cairo backends.

This imports the sources from mozilla-central:
http://mxr.mozilla.org/mozilla-central/find?text=&kind=text&string=cairo-qpainter
renames them from cairo-qpainter to cairo-qt, and integrates the patch
by Oleg Romashin:
https://bugs.freedesktop.org/attachment.cgi?id=18953

And then attempts to restore 'make check' to full functionality.

However:
 - C++ does not play well with the PLT symbol hiding, and leaks into the
   global namespace. 'make check' fails at check-plt.sh

 - Qt embeds a GUI into QApplication which it requires to construct any
   QPainter drawable, i.e. used by the boilerplate to create a cairo-qt
   surface, and this leaks fonts (cairo-ft-fonts no less) causing assertion
   failures that all cairo objects are accounted for upon destruction.

[Updated by Chris Wilson]
Acked-by: Jeff Muizelaar <jeff@infidigm.net>
Acked-by: Carl Worth <cworth@cworth.org>
2009-06-16 11:03:46 +01:00
Chris Wilson
7d3881114a [perf] Report errors during replays 2009-06-16 11:03:45 +01:00
Chris Wilson
061e0477e9 [perf] Report iteration count
Show number of discard results by showing the number of statistically
valid samples out of total population count.
2009-06-16 11:03:41 +01:00
Chris Wilson
e5727e20f5 Expose _cairo_null_surface_create() via a test surface
Using a null surface is a convenient method to measure the overhead of the
performance testing framework, so export it although as a test-surface so
that it will only be available in development builds and not pollute
distributed libraries.
2009-06-15 12:03:37 +01:00
Chris Wilson
1f542965f0 [perf] Mention cairo-perf-compare-backends in the README 2009-06-13 08:24:22 +01:00
Chris Wilson
a41e1275d2 [boilerplate] Make array of targets const.
Protect the boilerplate targets from unexpected modifications.
2009-06-12 22:28:38 +01:00
Chris Wilson
9e3019ef98 [perf] Add libcairoperf.la to DEPENDENCIES
It seems adding the explicit dependencies to encourage it to rebuild
components from other parts of the source tree removed the automagic
dependency of libcairoperf.la. So add it to the list. Maybe this is not
the correct solution, but it works again for now.
2009-06-11 22:27:18 +01:00
Chris Wilson
55cbf52547 [perf] Fix -i getopt parsing.
Gah, I presumed that the ':' separated options that required arguments
from stand-alone options. I was wrong. The ':' indicates that the
preceding option takes an argument. So add it back to -i.
2009-06-11 15:40:27 +01:00
Chris Wilson
ecee5663bf [perf] Fixup compare-backends to work with just a single test. 2009-06-11 15:19:50 +01:00
Chris Wilson
42c0aee1d9 [perf] Add a -x to exclude traces from a benchmark.
Read names of traces to exclude from a file specified using -x on the
commandline, i.e.
$ ./cairo-perf-trace -x cairo-traces/tiny.exclude

This is a convenient method for me to exclude certain traces for
particular machines. For example tiny cannot run
firefox-36-20090609.trace as that has a greater working set than the
available RAM on tiny.
2009-06-11 13:00:31 +01:00
Chris Wilson
81b5dc42b0 [perf] Expand the section on cairo-perf-trace in the README
Promote the information on how to use cairo-perf-trace and include it
immediately after the details on cairo-perf. This should make it much
clearer on how to replay the traces, and the difference between the two
benchmarks.
2009-06-10 08:52:50 +01:00
Chris Wilson
ec92e633ed [perf] Couple cairo-perf-traces into make perf
Rather than complicating cairo-perf to extend it to perform both micro-
and macro-benchmarks, simply run the two binaries in succession during
make perf.

For bonus points, consider whether we should hook cairo-perf-trace into
cairo-perf-diff.
2009-06-10 08:52:43 +01:00
Chris Wilson
0db946cdd9 [perf] Add explicit dependences for the local libraries
Update the build rules and add the dependences for the libraries built in
other parts of cairo.
2009-06-10 08:52:35 +01:00
Chris Wilson
39bac6eddd [perf] Mention cairo-perf-trace early on in the README 2009-06-08 11:52:56 +01:00
Chris Wilson
34ccaeae2d [perf] Continuously update the summary for traces 2009-06-08 00:12:28 +01:00
Chris Wilson
4ccfd474a3 [perf] Switch to using clock_gettime()
Try using clock_gettime() for a high resolution stable time source in
preference to the potentially unstable TSC.
2009-06-06 13:37:00 +01:00
Chris Wilson
867c88ae90 [script] Add a finish method to the interpreter
When using fonts circular references are established between the holdover
font caches and the interpreter which need manual intervention via
cairo_script_interpreter_finish() to break.
2009-06-06 12:59:39 +01:00
Chris Wilson
4e11d56f8e [perf] Update trace summary after each iteration
Running the macro-benchmarks takes so long, feedback is important.
2009-06-04 11:16:48 +01:00
Chris Wilson
5c2e73e74c [perf] Enable traces to be interrupted
Waiting for a long running benchmark can be very annoying, especially if
you just want a rough-and-ready result. So hook into SIGINT and stop the
current benchmark (after the end of the iteration) on the first ^C. A
second ^C within the same iteration will kill the program as before.
2009-06-04 10:03:45 +01:00
Chris Wilson
2eaced2447 [perf] Reconstruct interpreter for each run
Destroy the interpreter after each run of a trace so that we collect any
left-over garbage.
2009-06-03 21:49:17 +01:00
Chris Wilson
fa5d6c7afd [trace] Add a --profile mode
To save typing when creating macro-benchmarks --profile disables
mark-dirty and caller-info and compresses the trace using LZMA. Not for
computers short on memory!
2009-06-03 19:29:19 +01:00
Chris Wilson
9451f0b983 [perf] Drop ticks from trace benchmarks
Don't report the tick values for the macro-benchmarks as these are so
large as to be meaningless.
2009-06-03 13:26:52 +01:00
Chris Wilson
eec5476484 [perf] s/git/anongit/
Third time lucky?
2009-06-03 08:57:15 +01:00
Chris Wilson
ce7e633942 [perf] Warn if no traces were found 2009-06-02 21:59:07 +01:00
Chris Wilson
f0366f0f32 [perf] Update to point to new toplevel cairo-traces repo 2009-06-02 21:48:26 +01:00
Chris Wilson
d331dda480 [perf] Missing ')' in output 2009-06-02 15:41:19 +01:00
Chris Wilson
7ed050fd43 [perf] Benchmark traces
Add a variant of cairo-perf that measures the time to replay traces.
2009-06-02 15:13:47 +01:00
Chris Wilson
403f780b29 [perf] Add a verbose flag for summary output with raw
Use 'cairo-perf -v -r' to have both the summary output along with the raw
values. This gives a progress report whilst benchmarking, very reassuring
with long running tests.
2009-06-02 15:13:47 +01:00
Chris Wilson
70fd2bbce3 [perf] Exclude similar testing by default
There are synchronisation issues with similar surfaces (as only the
original target surface is synced) which interferes with making
performance comparisons. (There still maybe some value should you be aware
of the limitations...)
2009-06-02 15:13:47 +01:00