Commit Graph

4977 Commits

Author SHA1 Message Date
Chris Wilson 1ecf17b250 sna/gradient: Compute the absolute delta between color stops
Otherwise we do not detect gradients that start from white!

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48407
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-07 10:02:23 +01:00
Chris Wilson 4356fae72d sna/video: Only wait upon the scanout pixmap
Caught by the addition of the assertion.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-06 21:10:50 +01:00
Chris Wilson b790ba2ec9 sna: Correct the damage offset for redirected rendering
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48385
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-06 15:38:02 +01:00
Chris Wilson 0b81bafb80 sna/glyphs: Prefer a temporary upload mask for large glyph masks
If the required temporary mask is larger than the 3D pipeline can
handle, just render to a CPU buffer rather than redirect every glyph
composition.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-06 15:14:45 +01:00
Chris Wilson 42a84613e3 sna: Relase the upload cache when overwriting with PutImage
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48359
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-06 14:21:33 +01:00
Chris Wilson 999aa210ff sna: Use a sentinel value to prevent accessing beyond the end of the y_buckets
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-06 09:37:03 +01:00
Chris Wilson 1ae6328c57 sna: Remove redundant check from tor_inplace()
We only execute full-steps for vertical edges so we do not need the
second check.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-06 09:12:08 +01:00
Chris Wilson 51b9202d27 sna: Only engage the GPU detiler for multiple rows
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-04 11:13:27 +01:00
Chris Wilson 98ad4c3cd8 sna/gen3: Don't force use of the render pipeline just for vmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-03 19:47:15 +01:00
Chris Wilson 0915d414f5 sna/gen3: Fix pre-multiplication of mask value
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-03 19:04:29 +01:00
Chris Wilson 04851e4210 sna/gen3: Convert the clear-color from picture->format to a8r8g8b8
The shaders treat colours as an argb value, however the clear color is
stored in the pixmap's native format (a8, r5g6b5, x8r8g8b8 etc). So
before using the value of the clear color as a solid we need to convert
it into the a8r8g8b8 format.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48204
Reported-by: Paul Neumann <paul104x@yahoo.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47308
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-03 12:36:22 +01:00
Chris Wilson 87a672dafd sna: Apply CoordMode when computing point extents
Reported-by: Patrick Truebe <eko-priv@gmx.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48220
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-03 09:24:06 +01:00
Chris Wilson 0a0ee491ea sna: Debugging flil spans and their clipping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-03 09:23:49 +01:00
Chris Wilson ec1267df74 sna: Use the solid spans fast paths for dashed zero-width lines as well
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-02 16:39:13 +01:00
Chris Wilson 2d1f3cb198 sna/gen4: Remove the accidental debugging hack from the last commit
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-02 13:51:37 +01:00
Chris Wilson 5c4dc9c5db sna/gen3+: Fix sampling of borders around gradients
Incurs a slight loss of precision for the internal gradient, but much
more preferable to the artefacts around the borders with RepeatNone.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45016
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-02 13:42:35 +01:00
Chris Wilson 0b2651dc04 sna: Apply composite offset to damage for spans fast paths
Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-01 19:43:15 +01:00
Chris Wilson 4ea9ab9303 sna: Fix assertion to look at bbox of all boxes/points
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-01 16:36:16 +01:00
Chris Wilson 932743bb33 sna: Assert that drawing boxes are within bounds
More sanity checks required.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-01 09:54:43 +01:00
Chris Wilson cc20c45aa0 sna: Minimise the risk of hotplug hangs by checking fb before vsync
Everytime we issue a MI_WAIT_FOR_EVENT on a scan-line from userspace we
run the risk of that pipe being disable before we submit a batch. As the
pipe is then disabled or configured differently, we encounter an
indefinite wait and trigger a GPU hang.

To minimise the risk of a hotplug event being detected and submitting a
vsynced batch prior to noticing the removal of the pipe, perform an
explicit query of the current CRTC and delete the wait if we spot that
our framebuffer is no longer attached. This is about as good as we can
achieve without extra help from the kernel.

Reported-by: Francis Leblanc <Francis.Leblanc-Lebeau@verint.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45413 (and others)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-30 23:01:21 +01:00
Chris Wilson 305734ebdf sna: Separate out scanline waiting for gen4
So that we do not set a gen4 bit on gen2 and apply the old workaround of
trimming y2 instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-30 22:02:08 +01:00
Chris Wilson 6f2814db6f sna/traps: Align the pointer+index
It's the location of the pixels within the row that matter for
alignment!

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47418
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Magnus Kessler <Magnus.Kessler@gmx.net>
2012-03-30 22:02:08 +01:00
Chris Wilson ee075ced84 sna/traps: Align the pointer not the indices
Magnus found that inplace_row was still crashing on his setup when it
tried to perform an 8-byte aligned write to an unaligned pointer. This
time it looks like the row pointer itself was not 8-byte aligned, so
instead of assuming that and fixing up the indices, ensure that the
(index+row) results in an 8-byte aligned value.

Reported-by: Magnus Kessler <Magnus.Kessler@gmx.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47418
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-30 19:09:30 +01:00
Chris Wilson fde8a010b3 uxa: Remove broken render glyphs-to-dst
Reported-by: Vincent Untz <vuntz@gnome.org>
Reported-by: Robert Bradford <robert.bradford@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48045
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-30 12:47:21 +01:00
Chris Wilson 451489b499 sna/gen7: Allow per-device specific maxima
As the maximum thread count and urb size differs between different
incarnations of the GT units, be a little more flexible in programming
those maximums.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-30 10:21:26 +01:00
Eugeni Dodonov ea36f2c4a3 Add support for Ivy Bridge GT2 Server chipset
Sometimes known as Bromlow.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-30 09:34:13 +01:00
Chris Wilson 6142232fa0 sna: Add video sprite support for ILK+
Based on the work by Jesse Barnes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-28 22:53:17 +01:00
Chris Wilson ae8aa172a7 sna: Fix up 32-bit overflow for maximum object size calculation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-28 22:07:10 +01:00
Chris Wilson 2e7b5f7eaf sna/traps: Prefer to try mono spans on the GPU before trying inplace CPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-27 11:26:08 +01:00
Chris Wilson 522b41b393 sna/traps: Fix the width of the left-hand edge of an unaligned box
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-27 11:26:08 +01:00
Chris Wilson 008ad39b72 sna/gen6: Reduce opaque solid OVER to SRC for render composite
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-27 11:26:08 +01:00
Chris Wilson a9e9041934 sna: Remove bogus assertion of no references to in-flight upload buffers
As we may hold a cached reference to an upload buffer whilst it is
in-flight, the assertion that there are no such references to a buffer
being reused is no longer true. Those cached references will be released
as soon as we retire the buffer during the readback and so we are free
to reuse such an upload buffer for immediate readback.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-26 16:08:14 +01:00
Paulo Zanoni 89091dd8a3 Avoid duplicated code with intel_output_create_ranged_atom
Same change for intel_display.c and sna_display.c.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-26 14:12:56 +01:00
Chris Wilson 62f9833298 sna/gen2+: Approximate expensive gradients when using imprecise rendering
If we lack the ability to use a shader to compute the gradients
per-pixel, we need to use pixman to render a fallback texture. We can
reduce the size of this texture and upsample to reduce the cost with
hopefully imperceptible loss of quality.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-25 23:04:58 +01:00
Chris Wilson 25807f472d uxa: Remove hook for CompositeRectangles
It was broken and not flushing damage correctly. With the
improvements made to the kernel, it is no longer a significant advantage
per se and not worth its additional complexity.

Reported-by: Tilman Sauerbeck <tilman@code-monkey.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32547
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-23 15:00:53 +00:00
Chris Wilson 4460c6d0d3 configure: Stop the debug build erroring out if it cannot find valgrind
Another case where I passed an empty string believing that would be
sufficient to replace the error path...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-23 11:05:55 +00:00
Chris Wilson 168ecd96f2 sna: Make the fallback debugging messages more consistent
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-22 23:48:58 +00:00
Chris Wilson 8693005b54 sna: Update the target bo after changing from Y tiling
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-22 23:45:42 +00:00
Chris Wilson 83f98d6e5c sna: Correctly test for clear glyphs when searching for ones to skip
With xterm, it is quite common for it to redraw itself by using lots of
spaces and so it is efficient for us if we ellide those clear glyphs and
only draw the backing boxes. However, we were only checking the first 8
pixels in each line because of a missing pointer increment.

Fixes absent '=' characters when using a compositor and ImageText.

Reported-by: Jiri Slaby <jirislaby@gmail.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47735
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-22 21:57:14 +00:00
Chris Wilson 86121a3af9 sna: Adjust the damage region for the composite offset
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-22 11:23:02 +00:00
Chris Wilson a6b48dd7f1 sna: Force fallbacks if the destination is unattached
Since the removal of the ability to create a backing pixmap after the
creation of its parent, it no longer becomes practical to attempt
rendering with the GPU to unattached pixmaps. So having made the
decision never to render to that pixmap, perform the test explicitly
along the render paths.

This fixes a segmentation fault introduced in 8a303f195 (sna: Remove
existing damage before overwriting with a composite op) which assumed
the existence of a backing pixmap along a render path.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47700
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-22 09:22:52 +00:00
Chris Wilson 52f39ae169 sna: Assert that the bo created is large enough
Double check that the maximum access size computed from the bo
parameters is within the allocated size for the bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 13:31:03 +00:00
Chris Wilson 2f23c660f5 sna: Assert that the tiled blt is correctly clipped
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 13:31:00 +00:00
Chris Wilson e0cd13e2af sna: Fallback to inplace upload if forced to tile the indirect replacement
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47629
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 09:06:10 +00:00
Chris Wilson 1db1eced54 sna: Tidy an assertion when handling tiled copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 09:05:58 +00:00
Chris Wilson 38b0cc24b4 sna: Remove the short-circuiting of move-to-cpu for read if no damage
The danger now is that we may have either discarded the shadow pixels or
have replaced them with a GTT mapping, either way undesirable and so we
should reconstruct the shadow mapping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 01:03:05 +00:00
Chris Wilson f49a6b1fd7 sna: Decouple the private data after UnrealizeFont
As the font is kept around and reused after UnrealizeFont, we need to
nullify the pointer to our private data in order to prevent the later
use-after-free.

Reported-by: Peter Jordan
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-20 21:36:26 +00:00
Chris Wilson 1bdd6461de sna/traps: Remove bogus assertion
As we only enter that path for singular unbounded boxes, we are
guaranteed to fill the entire trapezoid extents and so do not need the
unbounded fixup the assertion was fretting about.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-20 11:08:44 +00:00
Chris Wilson 1c2932e9cb uxa: Defer the call to EnterVT till after outputs are initialised
We need to do this apparently or else we never perform the VT switch.
However, we can not do it too early, especially not before we have
finished intialising the outputs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47395
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-19 16:12:37 +00:00
Chris Wilson 972e1108a5 sna: Declare videoRam correctly on gen2 devices
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-19 14:38:28 +00:00