Commit Graph

4007 Commits

Author SHA1 Message Date
Chris Wilson fc415ec3d3 sna/gen5: Also experiment with lazy spans here
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 13:53:17 +00:00
Chris Wilson 567cfa508f sna/gen6: Enable spans interface for boxes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 13:43:03 +00:00
Chris Wilson 465515a144 sna: Silly compile fix, escaped when testing uxa
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 13:40:13 +00:00
Chris Wilson a26c5d44cc uxa: Ensure that alphaMaps are mapped into the CPU for fallbacks
Reported-by: Hans-Peter Budek <peter.budek@gmx.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 13:11:14 +00:00
Chris Wilson 34758895cd sna: Ensure operations on a ShmPixmap are synchronous with clients
If we are rendering to or from a ShmPixmap, we need to be sure that the
operation is complete prior to sending an XSync response to client in
order to preserve mixed rendering coherency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 13:11:14 +00:00
Chris Wilson 5525691eb0 sna/gen6: Poor man's spans layered on top of the exisiting composite
Performance of this lazy interface looks inconclusive:

Speedups
========
 xlib         swfdec-giant-steps  1063.56 -> 710.68:     1.50x speedup
 xlib          firefox-asteroids  3612.55 -> 3012.58:    1.20x speedup
 xlib       firefox-canvas-alpha  15837.62 -> 13442.98:  1.18x speedup
 xlib                  ocitysmap  1106.35 -> 970.66:     1.14x speedup
 xlib             firefox-canvas  33140.27) -> 30616.08: 1.08x speedup
 xlib                    poppler  629.97 -> 585.95:      1.08x speedup
 xlib          firefox-talos-gfx  2754.37 -> 2562.00:    1.08x speedup
Slowdowns
=========
 xlib                       gvim  1363.16 -> 1439.64:    1.06x slowdown
 xlib              midori-zoomed  758.48 -> 904.37:      1.19x slowdown
 xlib           firefox-fishbowl  22068.29 -> 26547.84:  1.20x slowdown
 xlib       firefox-planet-gnome  2995.96 -> 4231.44:    1.41x slowdown

It remains off and a curiosity for the time being.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 12:45:27 +00:00
Chris Wilson 5dba7028cd sna: Make sure the alpha map is accessible by the CPU on fallbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 11:24:03 +00:00
Chris Wilson 70c9e70f35 sna: Don't reuse partial vmapped bo
A fun use after free.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 10:20:26 +00:00
Chris Wilson 7e8c9a5b8b sna: Submit the batch on the next blockhander if operation overflows
If an operation overflows from one batch into another, we submit the
complete batch and begin a new. That new batch will not be submitted
unless it is filled or on the next delayed flush update. This can cause
a flicker as a large operation is broken up, such as performing a
CopyArea through a Clipmask. So if we submit a full batch during a flush
interval, immediately flush any partial batch at the next blockhandler.

This stops rude Santa flashing Rudolf in xsnow!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 09:32:21 +00:00
Chris Wilson 5b21838471 sna: Compute the correct extents for the PolyRectangle
Otherwise we may leave one behind...

A regression from the introduction of sna_poly_rectangles:
40af32a0e9 (sna: Execute blits directly
for PolyRectangle)

Reported-by: Matti Hamalainen <ccr@tnsp.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42568
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 22:51:24 +00:00
Chris Wilson 2174f84015 uxa: Remove caching of surface binding location
If the pixmap were to be used multiple times within a batch with
mulitple formats, the cache would only return the initial location with
the incorrect format and so cause rendering glitches. For instance, GTK+
uses the same pixmap as an xrgb source and as an argb mask in order to
premultiply and composite in a single pass. Rather than introduce an
overly complication caching (handle, format) mechanism, kiss and remove
the invalid implementation.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40926
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 20:41:31 +00:00
Chris Wilson a1b40a20bb sna: Support binding of a bo for multiple formats
Applications may use the same pixmap with multiple formats within the
same operation. For instance, you can premultiply and composite a normal
pixmap in this manner.  However, as we reused the sampler binding
locations of the source (without an alpha channel) for the mask, we
failed to read and multiply by the alpha channel causing it to remain
black instead of transparent.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40926
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 20:40:07 +00:00
Chris Wilson 31c5eb8e90 sna: Clean up the fallback code for glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 17:07:48 +00:00
Chris Wilson fa0fefd638 sna: Restore the lowlevel glyph routines for the sake of Damage
Damage bypasses the Text interface, preventing the backend from hooking
into the font and storing private glyph representations, and calls
directly into the Glyph routines. So to prevent a segfault we have to
restore them.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 15:33:25 +00:00
Chris Wilson 1677b273af sna: Skip encoding zero sized glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 14:33:24 +00:00
Chris Wilson 239cfb99f9 sna: Unroll the quadword upload of the glyph data
We know that the length is nicely aligned and so can avoid a relatively
expensive call into memcpy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 14:32:10 +00:00
Chris Wilson e2542bad88 sna: Add the missing returns to prevent fbImageGlyphBlt fallbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 14:32:10 +00:00
Chris Wilson bc032c9be1 sna: Coalesce reduction of cpu damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 13:06:56 +00:00
Chris Wilson c92671b33e sna: Coalesce reduction of gpu damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 13:06:56 +00:00
Chris Wilson 3b4a508eb0 sna: Translate glyphs into MSBFirst upon initial load
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 13:06:56 +00:00
Chris Wilson 8a259e34d3 sna: gc->miTranslate is always 1
So we can perform some constant folding and eliminate dead code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 12:56:07 +00:00
Chris Wilson 8f68f9e5f8 sna: Trimming is redundant given that we always have a CompositeClip
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 12:56:07 +00:00
Chris Wilson f4bdd84b84 sna: Simplify the uncommon check for gpu-only damage by using damage-all
The use of a gpu-only scratch bo is uncommon with the core acceleration
routines, and we can eliminate the check for not incrementing the damage
by allocating a damage-all and using the common optimisation of
reduce_damage().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 12:56:07 +00:00
Chris Wilson 353fa4218c sna: Don't call into retire unless there are outstanding requests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 12:56:07 +00:00
Chris Wilson 6fdd0f254d sna: Use an integer value for the sentinel
clang complains otherwise.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 12:56:07 +00:00
Chris Wilson 1073c78f6c sna: Pack small 1-bpp uploads into immediate buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 12:56:06 +00:00
Chris Wilson 73b2ef5a7d sna: gc->pCompositeClip always exists after validate
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03 12:02:52 +00:00
Chris Wilson 6fd0754e9c sna: defer calling fbValidateGC until we fallback
A secondary effect is that this prevents needless migration of the
tiling pixmap which we want to optimistically keep on the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-02 19:32:31 +00:00
Chris Wilson 6f8875e216 sna: Wait an extra interval before switching off periodic updates
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-02 15:41:40 +00:00
Chris Wilson def6b5e733 sna: Only execute the accel block handler if we are about to block
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-02 14:47:12 +00:00
Chris Wilson 088b875aff sna: Use the packed 8x8 stipple for non-repeating small rectangles
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-02 13:11:04 +00:00
Chris Wilson 0c373db73d sna: Fix the 8x8 stippled pattern origin
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-02 12:43:55 +00:00
Chris Wilson 9cdf8be550 sna: Add clipped stippled upload support
For xsnow!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-02 12:17:31 +00:00
Chris Wilson 6553c9e1cb sna: Quieten a fewer compiler sign compare warnings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-02 10:03:45 +00:00
Chris Wilson 42e2036cda sna: Use bo for scratch pixmaps allocated by the dix/mi routines
Now that we have the rudiments of accelerated deep-plane copies, we can
begin to benefit from using BO for the core dix/mi routines like
ShmPutImage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-01 21:12:02 +00:00
Chris Wilson 45cc952994 sna: Fix debugging assertions for Composite
When comparing drawable clip extents against pixmap boundaries we need
to include the pixmap screen offset on a Composited desktop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-01 21:12:02 +00:00
Chris Wilson ebc9f3966d sna: Accelerate deep-plane copy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-01 21:12:02 +00:00
Chris Wilson e0fd07bc25 sna: Accelerate XYPixmap upload when using GXcopy
Mostly for the lols.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-01 21:12:02 +00:00
Chris Wilson 22c43efe6b sna: Implement 8x8 stippled rect fills
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-01 21:12:02 +00:00
Chris Wilson c58b7643e9 sna: Accelerate 1bpp uploads
These still get used (see Wine and Swing) by applications which like to
do "crisp" 1-bit rendering on the client side and then put onto the
scanout. So avoid the readbacks, and push them through the BLT instead. It
turns out to be faster than using fb too, bonus!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-01 21:12:02 +00:00
Chris Wilson 8939ddbc27 sna: Improve rendering of thin segments
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-31 19:15:01 +00:00
Chris Wilson 98b830a975 sna: Improve rendering of thin lines
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42443
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-31 19:11:31 +00:00
Chris Wilson 6a5834ae56 sna/gen3: Fix invalid assert
SHADER_CONSTANT is expected here, the other IMMEDIATES however should
have already been handled.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-31 16:27:43 +00:00
Chris Wilson e12375d05b sna: Fix a few minor cut'n'paste errors
Use the constant value [last_box-box] where applicable.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-31 14:25:20 +00:00
Chris Wilson 20a4f53395 sna: Apply the GPU damage for clipped PolyFillRectangles
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42425
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-31 14:14:40 +00:00
Chris Wilson 7172f28c2b sna: Fix placement of clipped wide PolyRectangle
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-31 12:53:35 +00:00
Chris Wilson 59535d0e1c sna: Set the flush interval based on output vrefresh
Rather than a blank 25Hz, use twice the vblank interval to hopefully
avoid bad values.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-31 12:31:23 +00:00
Chris Wilson 9a2e59bfba sna: Fix reversal of zero/wide for PolyRectangle
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42414
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-31 11:56:53 +00:00
Chris Wilson b1287e4934 sna/video: Fix copy region for cropped video
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42412
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-31 11:27:36 +00:00
Chris Wilson b4ab412cb3 sna/blt: Optimise fill with GXcopy and pixel==0 to a GXclear
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-31 10:37:43 +00:00