Commit Graph

3631 Commits

Author SHA1 Message Date
Chris Wilson 7577d6ea45 sna: Add some error messages to explain why we failed to create the screen
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-08 10:24:34 +00:00
Chris Wilson 33256af40b sna: Fixes for DBG_NO_HW (i.e. simulated GPU hanges);
A couple of the recent GPU paths were failing to check for !wedged.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-08 09:55:07 +00:00
Chris Wilson 5f0886dae2 sna/trapezoids: Use ints for the offsets to accommodate multiplication
Although the original precison need only 16-bits to store the offsets,
after projecting on to the sample grid we need a few more bits of
precision and so need a larger integer type to avoid overflow and render
glitches.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42680
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-08 08:43:23 +00:00
Chris Wilson 33351d5c3d sna/glyphs: Bypass masks for single glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-07 22:57:44 +00:00
Chris Wilson e4872225ac sna/io: Minor tidy of setting command flags
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-07 22:57:05 +00:00
Chris Wilson 5ba8ba7421 sna: Avoid overwriting an upload buffer during readback
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42677
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-07 22:56:46 +00:00
Chris Wilson 8f7a8a8023 sna/composite: Minor fixes in operator and colour reduction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-07 20:10:28 +00:00
Chris Wilson b1234f3d3a sna: Expand multiplies of two 16-bit values to a full 32-bit range
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-07 20:10:27 +00:00
Chris Wilson afdf931e61 sna: Add some more debugging in the hunt for overflows
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-07 20:10:27 +00:00
Chris Wilson 8f3c845782 sna/blt: Small cleanups
Whilst perusing for overflows, remove some redundant conditionals.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-07 20:10:26 +00:00
Chris Wilson 8e775ceccc sna/gen3: Fix false reduction of ComponentAlpha with white source
The principle behind the opertator reduction of WHITE * maskca is valid,
except that we failed to account for the src/mask transposition when
emitting the vertices - garbage ensued.

Given that we agressively reduce the shader required for WHITE * maskca,
it does not seem worthwhile to special case the primitive emitter as
well.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42676
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-07 20:09:31 +00:00
Chris Wilson 65a440543b sna: Fix 16-bit overflow of rowlength for memcpy
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42619
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-07 20:00:20 +00:00
Chris Wilson d4edbd4804 sna/glyph: Fallback if we fail to clear the scratch pixmap for the glyph mask
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42663
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-07 11:25:50 +00:00
Chris Wilson cd3d860377 sna: Beware unsigned promotion of int16_t to uint32_t
Mmakes for an unhappy mempy!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-06 11:14:28 +00:00
Chris Wilson 0b9408d972 sna: Self-intersection of wide PolyLine are only drawn once
We need to process the union of the PolyLine command if lineWidth!=0 so
we cannot generally feed lineWidth==1 into our special case handler.
Proving the lines do not intersect is as difficult as finding the
intersections and thereby finding the union of the path - so there is no
advantage in adding a check whether a wide line could be special cased.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-06 09:56:52 +00:00
Chris Wilson c1e1e20fe7 sna: Add the pixman version to the debug output
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-05 22:34:27 +00:00
Chris Wilson e2165f0e6b sna: For a 32k max window size, we need to handle up to 128k strides
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42619
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-05 19:43:34 +00:00
Chris Wilson c5d94b21d5 sna: Extend the zero-line segments by one
Fixes misrendering of the wine tabs

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42606
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-05 14:33:43 +00:00
Chris Wilson 0cf29afda9 sna/glyphs: Fix clip detection for small masks
-ENOCOFFEE.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-05 12:36:53 +00:00
Chris Wilson d21c30d0b8 sna: Constrain GPU pixmaps to always fit within the blitter
Otherwise we end up always doing expensive readbacks where we would
obviously prefer it if we simply used cached memory for the CPU
operation and then upload.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-05 11:56:17 +00:00
Chris Wilson e309cea3ae sna: Do the supported PictOp check first
There is no point even attempting a BLT operation if we know that it is
an unusual render operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-05 11:28:06 +00:00
Chris Wilson ab3d6d878f sna: Render small glyph masks on the CPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-05 11:20:53 +00:00
Chris Wilson c25cf434d8 sna/gen3: Initiailse the op for fill_boxes()
After removing the memset(0), a couple of fields where left
uninitialised, causing potential rendering glitches.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-05 01:04:54 +00:00
Chris Wilson 96e760ea75 sna: s/flush/vblank/ fixes for DBG()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-05 01:04:24 +00:00
Chris Wilson 676cb4e38d sna: Run the deferred flush at vrefresh
This helps to reduce the perceived jerkiness of the redraw.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42413
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 23:34:46 +00:00
Chris Wilson 8052c3904a sna: Drain the delayed timer after forcing a flush
The goal is to remove a spurious wakeup when we have no work outstanding
afterwards and so would end up prematurely disabling the timer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 21:14:23 +00:00
Chris Wilson 112c61f655 sna: Convert GXcopy with -1 to GXset
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 21:13:55 +00:00
Chris Wilson 573b23c6b6 sna: Add some asserts to detect buffer overflow.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 18:12:38 +00:00
Chris Wilson 4ba55c3d11 sna/gen5: Prefer using the BLT for many solid fills
Even if it means incurring a context switch, the BLT unit is
significantly faster so long as we do enough fills. And there is the
catch ;-)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 18:12:17 +00:00
Chris Wilson 703cf8abdb sna: Add earlier guards against to wedged to sna_glyph_blt
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-04 16:08:48 +00:00
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 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