Age | Commit message (Collapse) | Author | Files | Lines |
|
This commit removes the hand-written code in cairo-xcb-surface.c and instead
makes use of cairo_compositor_t. Surprisingly, this doesn't break a single test
case. :-)
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
The xcb private header uses the ASSERT_NOT_REACHED macro.
This macro is defined in cairoint.h, which needs to be included.
Fixes:
CHECK cairo-xcb-private.h
In file included from headers-standalone-tmp.c:1:
./cairo-xcb-private.h: In function ‘_cairo_xcb_connection_shm_put_image’:
./cairo-xcb-private.h:636: error: ‘ASSERT_NOT_REACHED’ undeclared (first use in this function)
./cairo-xcb-private.h:636: error: (Each undeclared identifier is reported only once
./cairo-xcb-private.h:636: error: for each function it appears in.)
|
|
cairo_xcb_device_debug_cap_xrender_version is called by xlib-xcb's
cairo_xlib_device_debug_cap_xrender_version and thus must be marked slim_hidden.
Checking .libs/libcairo.so for local PLT entries
0000000000306ff8 0000024200000007 R_X86_64_JUMP_SLOT
000000000009e720 cairo_xcb_device_debug_cap_xrender_version + 0
FAIL: check-plt.sh
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Fixes negative-stride-image
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Mirrors cairo_xlib_surface_set_drawable, allowing the drawable
targeted by a surface to be changed on the fly.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
And only upload the parts of the image that are modified during the
fallback. I have to keep reminding myself that the goal is always to
reduce the amount of fallbacks required...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
surface->use_pixmap always had the value 0. This code is taken from cairo-xlib.
However, in cairo-xlib use_pixmap is set to 20 if XGetImage() fails.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Having spent the last dev cycle looking at how we could specialize the
compositors for various backends, we once again look for the
commonalities in order to reduce the duplication. In part this is
motivated by the idea that spans is a good interface for both the
existent GL backend and pixman, and so they deserve a dedicated
compositor. xcb/xlib target an identical rendering system and so they
should be using the same compositor, and it should be possible to run
that same compositor locally against pixman to generate reference tests.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
P.S. This brings massive upheaval (read breakage) I've tried delaying in
order to fix as many things as possible but now this one patch does far,
far, far too much. Apologies in advance for breaking your favourite
backend, but trust me in that the end result will be much better. :)
|
|
Before using some piece of SHM again, we must be sure that the X11 server is no
longer working with it. For this, we send a GetInputFocus when we are done with
the SHM locally and will only use the memory again when the reply comes in.
However, if we are allocating the memory for SHM GetImage, then we can re-use
memory earlier, because the server processes requests in order. So it will only
start writing to the memory after it is done with earlier requests for this
memory. So instead of using GetInputFocus for synchronisation, the SHM GetImage
request will automatically do this for us.
Thanks to Chris Wilson for this idea.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
This function shouldn't ever be called is xcb-shm is disabled. However, it is
still defined to avoid lots of #ifdefs.
Additionally, this removes the only use of uint64_t from cairo-xcb.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
This merges most of _cairo_xcb_surface_create_similar_image() into
_cairo_xcb_shm_image_create().
These two functions where already doing almost the same thing with only some
differences in error handling.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This function never fails. However, since it's used to implement a operation for
cairo_surface_backend_t, the return value can't be void. This commit instead
uses cairo_private_no_warn to get rid of the warnings.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
For an unbounded surface we cannot assume (0, 0, surface_width,
surface_height) as that is wrong and causes the operation to appear
clipped.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
A common requirement is the fast upload of pixel data. In order to
allocate the most appropriate image buffer, we need knowledge of the
destination. The most obvious example is that we could use a
shared-memory region for the image to avoid the transfer cost of
uploading the pixels to the X server. Similarly, gl, win32, quartz...
The other side of the equation is that for manual modification of a
remote surface, it would be more efficient if we can create a similar
image to reduce the transfer costs. This strategy is already followed
for the destination fallbacks and this merely exposes the same
capability for the application fallbacks.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Device mutexes guarantee the consistency between multiple threads,
hence GC cache does not rely anymore on atomic operations.
This makes it possible to avoid bit twiddling and to use a simple
array.
|
|
We now remember the original flags before any call to
cairo_xcb_device_debug_cap_xshm_version() or
cairo_xcb_device_debug_cap_xrender_version() was done and re-set these flags on
any new call to these functions. This makes it possible to raise e.g. the used
RENDER version again.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
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>
|
|
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>
|
|
Step 1, fix the failings sighted recently by tracking clip-boxes as an
explicit property of the clipping and of composition.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
In order for custom context to automatically track when a pattern is
modify after being set on the context (and before it is used in an
operator), we need for there to be a callback when the pattern is
modified.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The experiment was at best a pyrrhic victory. Whilst it did show that
you could successfully subvert cairo_xcb_surface_t and provide the
rendering locally faster (than the xlib driver at that time), any
performance benefits were lost in the synchronisation overheads and
server-side buffer allocation.
Once cairo-gl is mature, we need to look at how we can overcome these to
improve client-side rendering
In the meantime, cairo-xcb is no longer my playground for
experimentation and is shaping up to become a stable backend...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When e.g. using an image surface as the source for a xcb surface, a
cairo_xcb_picture_t is created and attached to that image surface as a snapshot.
This contains the Picture that was created on the X11 server.
However, as soon as the cairo_xcb_picture_t's cairo_xcb_screen_t is finished and
destroyed, this picture can't be used anymore. This commit now makes sure all
these Pictures are freed when the screen is finished.
This was found because my X server's memory usage grew quite large. Every time
the app was done drawing, it destroyed its last surface which also destroyed the
last reference to the cairo_xcb_screen_t. This meant that the existing Picture
snapshots couldn't be used anymore, but they were still kept around and used up
memory until there wasn't any free memory left.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
The next commit will make cairo-xcb-screen.c use this struct and add new
members. Splitting off the move into its own commits makes that easier to
understand.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
There are debug functions for setting the precision on a xlib device, so
xlib-xcb must redirect that to the xcb backend, too. However this means that
these public functions now are also called internally, thus we have to make them
go through the slim_hidden_* macros.
This commit fixes the following error from "make check":
Checking .libs/libcairo.so for local PLT entries
00000000002bb6d8 000001e300000007 R_X86_64_JUMP_SLOT 000000000006d8a0 cairo_xcb_device_debug_set_precision + 0
00000000002bb750 0000025e00000007 R_X86_64_JUMP_SLOT 000000000006d8b0 cairo_xcb_device_debug_get_precision + 0
FAIL: check-plt.sh
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
The PDF blend operators, as offered by cairo, where added in RENDER 0.11. This
commit makes the XCB backend use them, if they are available.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
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>
|
|
This flag was only ever tested, but never set. Also, there is no X11 server out
there which actually supports this.
AFAIK it was just an experiment which turned into dead code.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
All of these defines where not used anymore and this '#if 0'd code was so for
ages and most likely would stay commented out for more ages, too.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Whenever a surface is used as a source, cairo-xcb creates a Picture for it and
adds it as a snapshot to the source. Additionally, there is a per-screen cache
that makes sure old Pictures are destroyed when more than 16 MiB of image data
is used.
There are two problems here:
- Normally, the Picture would be destroyed once it is no longer a snapshot for
the original source surface. However, the cache kept it alive for longer which
means it was using memory but couldn't actually be used any more. (The
Pictures are found via _cairo_surface_has_snapshot)
- When a xcb surface is used as a source, we create a new Picture for it, but
when that surface is cairo_surface_finish'd, we don't FreePicture this
Picture. When the drawable was a window, this may later on cause a BadPicture
error when cairo tries to explicitly free a picture that was already
implicitly freed when its window was destroyed.
The second point caused lots of tests in the test suite to fail on an assert due
to the above-mentioned BadPicture error, but just removing the cache makes both
these problems go away.
The only downside is that the cache enforced a limit of 16 MiB of pixel data
that was used for source surfaces on the server. After this commit the Picture
will be kept alive until the snapshot is detached. If this becomes a problem
memory-wise, a new solution will have to be invented...
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
The function _cairo_xcb_shm_image_create is defined and needed even when XCB-SHM
is disabled. In this case it just falls back to an image surface.
Thanks to Benjamin Otte for noticing this.
cairo-xcb-surface-render.c: In function ‘_render_to_picture’:
cairo-xcb-surface-render.c:749: error: implicit declaration of function ‘_cairo_xcb_shm_image_create’
cairo-xcb-surface-render.c:749: warning: nested extern declaration of ‘_cairo_xcb_shm_image_create’
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Both cairo-xcb-surface-core.c and cairo-xcb-surface-render.c contained an
identical definition of _cairo_xcb_shm_image_create. This commits removes the
one from cairo-xcb-surface-render.c and adds the other one to
cairo-xcb-private.h.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
This commit delays the return of a SHM area to the free pool. When
_cairo_xcb_shm_info_destroy is called, it now adds the cairo_xcb_shm_info_t to a
list of pending memory areas and sends a GetInputFocus request to the server.
This cairo_xcb_shm_info_t is only really freed when the GetInputFocus request
completes. To avoid unnecessarily waiting for the X server, we check via
xcb_poll_for_reply for the reply which returns immediately if the reply isn't
received yet.
This commits fixes a race where the shared memory area is reused before the X
server finished reading data from it. This does NOT fix races where cairo draws
something new to the same cairo_xcb_shm_info_t while the X server still reads
from it. However, there doesn't seem to exist any code currently where the shm
info isn't immediately destroyed after it was used.
This commit fixes the following tests for xcb-render-0.0 if SHM is enabled:
joins mask mask-transformed-image push-group push-group-color radial-gradient
radil-gradient-mask radial-gradient-mask-source radial-gradient-one-stop
radial-gradient-source smask smask-mask smask-paint
This also fixes mesh-pattern-transformed for all the xcb boilerplate "backends".
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
This makes the xcb backend use the auto-generated xcb API instead of
hand-writing each request. This should also improve parallelism with non-cairo
threads that use the same xcb connection.
Big thanks to Andrea Canciani for taking a look at this and finding lots of good
improvements (especially finding xcb_send_request was great).
cairo-perf-trace and cairo-perf-diff-files between master
(6732dbf2992891be4b1f08b14a5c449fd08b637c) and this change:
$ ./cairo-perf-diff-files ../master_perf ../xcb_no_socket_perf
old: master_perf
new: xcb_no_socket_perf
Speedups
========
xcb-rgba evolution-0 23558.86 (23558.86 0.00%) -> 19338.78 (19338.78 0.00%): 1.22x speedup
▎
xcb-rgba poppler-bug-12266-0 98.43 (98.43 0.00%) -> 82.36 (82.36 0.00%): 1.20x speedup
▎
xcb-rgba gnome-terminal-vim-0 5518.08 (5518.08 0.00%) -> 4905.92 (4905.92 0.00%): 1.12x speedup
▏
xcb-rgba gnome-terminal-20090601-0 45648.46 (45648.46 0.00%) -> 41231.25 (41231.25 0.00%): 1.11x speedup
▏
xcb-rgba evolution-20090607-0 71643.69 (71643.69 0.00%) -> 66314.95 (66314.95 0.00%): 1.08x speedup
▏
xcb-rgba poppler-0 3501.69 (3501.69 0.00%) -> 3322.26 (3322.26 0.00%): 1.05x speedup
Slowdowns
=========
xcb-rgba gnome-system-monitor-0 7500.01 (7500.01 0.00%) -> 7923.70 (7923.70 0.00%): 1.06x slowdown
xcb-rgba swfdec-youtube-full-0 26409.89 (26409.89 0.00%) -> 28430.76 (28430.76 0.00%): 1.08x slowdown
▏
xcb-rgba gnome-system-monitor-20090821-0 34801.61 (34801.61 0.00%) -> 37891.14 (37891.14 0.00%): 1.09x slowdown
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
The first fixes required to kick-start memfault testing of the xcb
backend.
|
|
A common operation is to store an image in a similar surface, so
construct a fast path to avoid the allocation and double-blit through a
temporary pixmap.
|
|
I updated the Free Software Foundation address using the following script.
for i in $(git grep Temple | cut -d: -f1 )
do
sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
|
|
Trying to build xcb on a system without SHM wrapped by xcb. The right
answer would be to build libxcb-shm. The quick answer is to compile out
shm support.
|
|
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.
|