Commit Graph

6412 Commits

Author SHA1 Message Date
Chris Wilson 83bcd310d2 sna: Prefer to use snooped buffers for readbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
Chris Wilson 496f3ff044 uxa: Harden against failures to submit batchbuffers
If we fail to submit a batchbuffer, the driver is broken and likely to
continue to fail to render. Give up, and fallback to swrast so that the
session remains usable.

References: https://bugs.freedesktop.org/show_bug.cgi?id=59771
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
Chris Wilson 04d48fee71 sna: Fix errors found from asserts in a66c5f9ed5
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 11:46:20 +00:00
Chris Wilson bc8b191ef6 sna: Return early if the Drawable box exactly matches one CRTC
If we are trying to find the best coverage, then by definition if the
drawable is an exact match for one CRTC, we can stop looking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 09:04:10 +00:00
Chris Wilson de28027ffc sna/dri: Make sure we discard the existing mappings when swapping GPU bo
If the GPU bo is currently mapped to the Pixmap, we need to be sure to
invalidate that mapping if we swap the GPU bo (for SwapBuffers). If we
forget, we leave a dangling pointer to chase.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60042
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 08:45:47 +00:00
Chris Wilson cf9b9ac318 sna: Only discard the mapping prior to the actual read when uploading
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 08:45:47 +00:00
Chris Wilson a66c5f9ed5 sna: Before replacing the devPrivate.ptr assert it is not already mapped
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 08:45:46 +00:00
Chris Wilson 3fdd28419a sna: Only migrate the sample box if using the BLT engine for a composite
Modify the presumption that if we are using a core operation on a shadow
pixmap, then we are likely to continue migrating that pixmap back and
forth.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-29 22:26:15 +00:00
Chris Wilson 0c3b0f11d7 sna: Verify that we always add the SHM CPU bo to the flush list when using
As we need to synchronize that bo before the next reply, we need to keep
track of it whenever it is active on the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-29 22:24:30 +00:00
Chris Wilson f743cd5734 sna: Avoid promoting SHM CPU bo to GPU to maintain coherence with SHM clients
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-29 18:04:40 +00:00
Chris Wilson 9383c5efe9 sna/gen3+: Fix a DBG for composite_boxes()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-29 17:26:10 +00:00
Chris Wilson b02a1ea557 sna: Add GT1/GT2 thread counts for Haswell
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-29 09:28:33 +00:00
Chris Wilson 1dc2d9ede5 sna: Add some more paranoia that we correctly map before fallbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-28 23:14:57 +00:00
Chris Wilson 63c71bcd96 sna: Fix typo in vertex count for threaded source span emitter
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-27 23:17:13 +00:00
Chris Wilson b0d26ca931 sna: Replace the forced vertex finish with just a wait
When completing a batch mid-operation, we need to wait upon the other
threads to complete their writes so that memory is coherent before
submitting the work to the GPU. This was achieved by forcing the finish,
but all that from that is the wait, which makes the handling of threads
much explicit and removes the unnecessary vbo refresh.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-27 21:07:03 +00:00
Chris Wilson b0c3170c10 sna: Add the pixmap to the flushing list when creating for inplace CPU writes
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>
2013-01-27 19:09:38 +00:00
Chris Wilson 73f574945f sna: Disable all signals in the render threads
X uses them (SIGIO especially) for input handling, and gets rightfully
confused if it finds itself in a different thread.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-27 16:06:15 +00:00
Chris Wilson 9a7bf70365 sna: Enable threaded rasterisation for non-antialiased geometry
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-27 13:06:46 +00:00
Chris Wilson 8178cff571 sna: Begin sketching out a threaded rasteriser for spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-27 13:06:46 +00:00
Chris Wilson 8ffb3f50b3 sna: Spawn threads to rasterize trapezoids through pixman
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-25 10:51:34 +00:00
Chris Wilson 0ec2f3a8ba sna: Spawn threads to composite trapezoids inplace
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-24 23:41:07 +00:00
Chris Wilson 427b7311fe sna: Perform the last threaded composite operation directly
The point of the refactor was to execute the last stage of the composite
in the master thread, so do so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-24 22:25:46 +00:00
Chris Wilson 326dcd75f2 sna: Parse cpuinfo to determine the actual number of physical cores/caches
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-24 21:13:47 +00:00
Chris Wilson f597b64718 sna: Tidy construction of data for threaded composite
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-24 19:13:34 +00:00
Chris Wilson 1643c97f8f sna: Use threads for simple mask generation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-24 19:13:34 +00:00
Chris Wilson d60128c55e sna/dri: Compensate clipExtents for drawable offset
The clipExtents is in screen coordinates whereas we just want to confirm
that the maximum pixel to be copied lies with the DRI2 buffer, which is
relative to the drawable.

Reported-by: Matthieu Baerts <matttbe@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59806
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-24 15:38:06 +00:00
Chris Wilson 264b3b7250 sna: Refactor to use a common fbComposite fallback
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-24 15:25:44 +00:00
Chris Wilson 8ecfbea9d1 sna: Experiment with a threaded renderer for fallback compositing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-24 15:25:16 +00:00
Chris Wilson 778dba90cf sna/dri: Don't contribute missed frames to the target_msc
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-23 21:33:31 +00:00
Chris Wilson 50b41cb485 sna/dri: Only reject DRI2 buffers that are too small for the request blit
The goal is to reject stale DRI2 buffers that are smaller than the
target due to not-yet-handled ConfigureNotify, but not to reject
blitting from Windows that are larger than the frontbuffer.

Fixes a regression from the overzealous
commit b27ecf3059
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Nov 12 14:06:06 2012 +0000

    sna/dri: Prevent scheduling a swap on stale buffers

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-23 21:21:42 +00:00
Chris Wilson 98b312e579 sna/dri: Stop feeding I915_TILING_Y to mesa i915c
Only i915g handles Y-tiling, and we can't differentiate between the two
types of clients.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-23 20:55:09 +00:00
Chris Wilson 3179640091 sna: Clean up WAIT_FOR_EVENT on gen2/3
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-23 19:37:23 +00:00
Chris Wilson ea8148b24d sna/dri: Prefer to use the BLT ring for vsync'ed copies on IVB+
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-23 18:02:18 +00:00
Chris Wilson 3c3a87a2d4 sna/gen6: Correct the event definition for secondary pipes for MI_WAIT_FOR_EVENT
It helps to wait upon the event we program and enable.

References: https://bugzilla.kernel.org/show_bug.cgi
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-23 17:38:53 +00:00
Chris Wilson 88753c5a8c sna/gen7: Correct the event definition for secondary pipes for MI_WAIT_FOR_EVENT
It helps to wait upon the event we program and enable.

References: https://bugzilla.kernel.org/show_bug.cgi
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-23 17:37:44 +00:00
Chris Wilson 2d92d8ec56 sna: Extend rectangular PolyLines to cover corner pixels on ccw paths
Reported-by: Joe Peterson <joe@skyrush.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55484
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-22 09:24:04 +00:00
Chris Wilson c8817e24a9 sna/gen7: Fix inversion of bool return code from CA pass
As we inverted the predicate, we no longer restored the original
operation after performing a CA pass - glyph would randomly become
white.

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>
2013-01-22 09:06:50 +00:00
Chris Wilson 10f549332e sna: Free a non-reusable bo if it expires on the flushing list
Still no sure just how the bo ends up there, but as there seems to be
the occasional malinger, just free it.

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>
2013-01-21 16:48:34 +00:00
Chris Wilson d7f0df27ed sna: Use the maximum backlight value if we fail to read the current value
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-21 16:36:28 +00:00
Chris Wilson 46a3a68e60 sna: Assert that if marked as a scanout it is indeed bound.
On further review, the invariant must have been violated earlier, so
make the assert earlier.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-21 16:29:30 +00:00
Chris Wilson 0507d55dd1 sna: Only add bound scanouts to the scanout list
If we never used the bo as an actual scanout it will never have had been
moved to the uncached domain and so we can return it back to the system
cache.

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>
2013-01-21 16:24:49 +00:00
Chris Wilson 5a0bc67ba5 sna: New execbuffer flags for lut-handle and fast-relocs are upstream
Now the flags are upstream, we can rely on runtime tests as the
interface is now frozen.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-21 11:41:38 +00:00
Chris Wilson 208ca91a31 sna/gen7: Place the vsync commands in the same cacheline
Do as told; both the LRI and WAIT_FOR_EVENT need to be in the same
cacheline for an unspecified reason.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-20 18:10:58 +00:00
Chris Wilson 9a3e3abfe9 sna/gen7: Offset start/end scanlines by one
The hardware needs to be programmed with the line before the desired
scanline, wrapping around as required.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-20 17:48:31 +00:00
Chris Wilson e6a64f872b sna/gen3+: Remove bogus assertion that the vbo in included before finish
If we are carrying over a nearly full vbo from one batch to the next, we
may indeed finish it prior to writing any new primitives and so the
assert is truly bogus.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-20 17:01:24 +00:00
Chris Wilson 5de919336f sna/gen6: Tweak programming scanline values
The documentation says that both start/end scanline need to be the line
before the desired value, and so to program the first scanline we need
to set it to the last scanline. The docs also say that the lower 3 bits
are ignored, so tweaked the values programmed accordingly with an extra
check that the window is not reduced to 0.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-20 16:39:11 +00:00
Chris Wilson 2f9ac4e8a1 sna/gen3+: And restore non-CA compositing state after the CA pass
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-20 15:53:32 +00:00
Chris Wilson 650c9d5ce8 sna/gen3+: Reset vertex relocation state after discarding the batch
Fixes a regression from commit a6ecb6d31d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jan 16 09:14:40 2013 +0000

    sna: Discard the batch if we are discarding the only buffer in it

as we may keep a stale relocation for the vertex buffer alive if we
attempt to clear the bo using the render engine before discarding it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-20 15:00:50 +00:00
Chris Wilson 492952e0d6 sna/gen3+: Handle flushing vbo for CA glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-20 14:55:06 +00:00
Chris Wilson b52c921204 sna: Adapt error detection and handling for invalid batchbuffers
Allow the DDX to continue even if the kernel rejects our batchbuffers by
disabling hw acceleration - just extends the existing hang detection to
also handle the driver producing garbage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-20 14:02:07 +00:00