Commit Graph

5934 Commits

Author SHA1 Message Date
Chris Wilson 033f75e5bd sna: Stage retirement through the flushing list
If the kernel replies that a bo is still busy, stage its retirement
through the flushing list to be certain that we never stall on a
subsequent write.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 01:43:00 +00:00
Chris Wilson 5f5711e62c sna: Disable dangerous assertions that depend upon external state
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 01:27:44 +00:00
Chris Wilson 42529336fd sna: Prevent falling back to swrast if source is on the GPU
Currently if the dst is wholly contained within the CPU, then we try to
continue to operate on the GPU. However, if we have FORCE_GPU set, it
means that one of the sources for the operation resides on the GPU, and
that would require a readback in order to perform the operation on the
CPU. Hence, if we try to use a CPU bo and fail, convert back to using
the GPU bo if forced.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 00:58:51 +00:00
Chris Wilson c2d06c407e sna: Improve DBG output for damaged slave outputs
After computing the intersection of the damage with the slave, give the
region extents.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 21:17:42 +00:00
Chris Wilson 8867aa6a46 sna/dri: Handle change of BackBuffer across a pending flip
If we encounter a delayed flip with a different back buffer than the
current, simply update the info rather than bug out.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 21:17:32 +00:00
Chris Wilson a31fd03bd4 sna: Add a bunch of assertions to make sure we do not misplace scanouts
As scanouts are uncached, they need to be treated carefully and
decontaminated before being placed in the general cache. So double check
that no bo in those caches are still marked as a scanout.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 17:28:19 +00:00
Chris Wilson 6f1b862282 sna: Pass the correct WRITE hint when migrating for rendering into the CPU bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
Chris Wilson 5011ed2e72 sna: Only discard the clear hint when writing inplace to the GPU pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
Chris Wilson 6312f58014 sna: Don't force a migration from CPU rendering for a DRI2 flushed pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
Chris Wilson 60a3b370ae sna: Retire the bo after a set-domain(CPU,0)
Having relaxed the earlier assertion because the kernel is wrong, we can
now retire for READ-READ optimisations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
Chris Wilson 78ad5a742f sna: Relax assertion the the kernel considers the bo idle when we call retire
All the callers have explicitly changed the domain upon the bo before
calling kgem_bo_retire(), so we still get the occasional sporadic
failure as kgem_busy() reports true. Kill the assertion for now.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-30 16:47:02 +00:00
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