Commit Graph

7441 Commits

Author SHA1 Message Date
Chris Wilson 6cb84c8d55 sna: Guard the replace-with-xor fallback path
Before attempting to map the destination for uploading into after a
failure to use the BLT, we need to recheck that it is indeed mappable.

References: https://bugs.freedesktop.org/show_bug.cgi?id=70924
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-01 15:57:56 +00:00
Chris Wilson 5da329735c sna: Process all clip boxes when rastering segments
The macro still had buried returns which were no longer valid after the
translation to handle clipping. They needed to be breaks from the inner
most loops to the outer clip box instead.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70802
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-01 14:30:14 +00:00
Chris Wilson 0d93b0ef34 sna/gen7: Undo overzealous flushing
commit d580a30aaf
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Oct 31 15:58:47 2013 +0000

    sna/gen7: Flush render cache when changing CC state

ultimately doesn't prevent the issue and in the process adversely
affects perforamnce.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-01 12:49:36 +00:00
Chris Wilson 6b1a6f3217 sna: Scale uses of aperture_mappable by PAGE_SIZE
After converting aperture_mappable to count in pages, there were a few
residual users expecting a byte count.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71117
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-01 11:05:34 +00:00
Chris Wilson d580a30aaf sna/gen7: Flush render cache when changing CC state
References: https://bugs.freedesktop.org/show_bug.cgi?id=68410
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-31 15:58:47 +00:00
Chris Wilson 82e6d41c2f sna/gen6: Tweak flush around CC state changes
In order to fix some font corruption, it appears that we need an extra
flush in the Sandybridge pipeline when we change the CC stage and the
render cache is dirty. We previously triggered a full pipeline stall
for this case.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-31 13:37:51 +00:00
Chris Wilson 5cdc2bbc9c sna: Tweak deletion of used buffers
Make sure we never unwind a used buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-31 13:35:37 +00:00
Chris Wilson ed16e34c00 sna: Allow limited recursion within sigtrapped routines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-30 18:52:14 +00:00
Chris Wilson 426efd5f4b Revert "sna: Detect and handle mi recursion"
This reverts commit c6b0e3fe0c.
2013-10-30 18:52:14 +00:00
Chris Wilson ed28245624 sna: Assert that the batch is in the correct mode prior to inserting BLT commands
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-30 13:42:44 +00:00
Chris Wilson c6b0e3fe0c sna: Detect and handle mi recursion
Some of the mi routines recuse back into the generic accel routines and
so confuse our trapping of SIGBUS. Add extra assertions to pinpoint the
recursion and unwrap sufficiently to avoid that recursion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-30 13:42:44 +00:00
Chris Wilson 4d13d52258 sna: Queue retirement when placing a BO on the deferred flushing list
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-30 13:42:44 +00:00
Chris Wilson 59531ba31a sna: Check for wedged after submitting
If we submit prior to an operation, check that we didn't just wedge the
GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-30 13:42:44 +00:00
Chris Wilson 87655e7df4 sna: Wrap access of upload buffers with sigtrap
For an extra layer of paranoia, catch any sigbus when trying to upload
a bitmap, and convert it to a no-op.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-29 21:19:02 +00:00
Chris Wilson 0e69280005 sna/gen7: Refactor BYT vsync using IVB routines
The BYT vsync is closer to the IVB vsync, and using gen6 is just
erroneous. Apparently. At least that is what is in bspec today.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-29 20:19:24 +00:00
Chris Wilson 9352769eee sna: Fix assertion checks for fake flushing requests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-29 18:27:41 +00:00
Chris Wilson eddd80c44d sna: Remove an overzealous assert
Testing with a slow gen2 triggers this harmless assertion, so drop it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-29 18:00:49 +00:00
Chris Wilson 9f36e83d76 sna: Handle deferred retiring of active-buffers
Yikes, the new assertions found cases where we would retain an active
buffer even though it was still owned by the next batch. Fortunately,
this should only be a bookkeeping issue rather than lead to corruption.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-29 17:01:27 +00:00
Chris Wilson d26036d40e sna: Always run the retire_buffers during ring_idle
As we know that we had a request to retire, we know that we may make
progress retiring active buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-29 16:20:14 +00:00
Chris Wilson 72544ad5d1 sna: Perform an explicit retire for old active upload buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-29 15:41:08 +00:00
Chris Wilson d86b36dc41 sna: Check for retired upload buffers after checking for an idle ring
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-29 15:34:43 +00:00
Chris Wilson 0e6aca90c7 sna: asserts bitmap uploads are correct
Place guards around the pointer accesses to verify that they are within
the bitmap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-29 14:05:27 +00:00
Chris Wilson 56e3761dec sna: Don't attempt to move the GC back to the GPU before it is moved away
Fixes regression from

commit e3f15cbf39 [2.99.905]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Oct 22 15:19:15 2013 +0100

    sna: Move gc back to GPU after failure to move it to CPU

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-29 12:46:58 +00:00
Chris Wilson 4f41bf3de0 sna: Try harder to complete writes
Expunge our caches if we fail to write into a bo (presuming that
allocation failure is the likely fixable cause).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-29 09:56:28 +00:00
Chris Wilson 76b14a90c1 sna: Quieten a couple of valgrind warnings about unknown ioctls
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-28 20:55:41 +00:00
Chris Wilson 54aaf14dbf sna: Tidy RegionNil checks
After computing the clip intersection, we immediately check for the
empty result, so refactor the check into the common routine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-28 13:16:12 +00:00
Chris Wilson 003f26a571 sna: And be pessimistic when checking aperture limits
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-28 13:16:12 +00:00
Chris Wilson 671e4b44b2 sna: Account for extra guard pages around snooped BO in aperture checks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-28 13:16:12 +00:00
Chris Wilson f7d1da8ca5 sna: Defer opportunistic flush if all bo are current on the GPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-28 13:16:12 +00:00
Chris Wilson d69a4f118a sna: Leave extra room in the mappable aperture for fence alignment
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-28 13:16:12 +00:00
Chris Wilson 40d4199f15 sna: Use page-count for mappable aperture size
For consistency with the other aperture metrics and correctness when
passing around required number of pages.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-28 10:47:43 +00:00
Chris Wilson 9266e35b42 sna: Fallthrough to opportunistic flushing after aperture checks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-27 16:45:53 +00:00
Chris Wilson 4e0a01a7a3 sna: Handle transient TearFree flip failures
If we get a pageflip fail when trying to do a TearFree update, just
fallback to a copy (before turning off the display for complete
failure). The rare tearing copy should mar the user experience far less.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-27 15:33:13 +00:00
Chris Wilson b480e1ec50 sna: Trim usuable fenced aperture by unfenced usage
This will overcount buffers that both fenced and unfenced (likely most
fenced buffers!) but is required to prevent ENOSPC due to alignment
issues.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-25 17:47:54 +01:00
Chris Wilson 64b9f57451 sna: Don't assert indirect GPU state
kgem_check_bo_fenced queries whether the GPU is idle, and so its result
is timing dependent and not suitable for assertion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-25 14:28:46 +01:00
Chris Wilson f0da01aa90 sna: Remove stale mappings when replacing GPU bo
References: https://bugs.freedesktop.org/show_bug.cgi?id=70527
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-25 14:22:05 +01:00
Chris Wilson 4e4d643794 sna: Fix overallocation of fences for BLT commands (gen2/3)
Fixes a regression introduced in
commit 4d2840919f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Sep 26 15:30:58 2013 +0100

    sna: In desperation, query the actual available aperture space

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-25 13:20:16 +01:00
Chris Wilson da0de7e55a sna: Add a line of DBG for when we discard uploads into CPU bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-25 11:35:39 +01:00
Chris Wilson 51c87f9aca sna/io: Propagate failure to XOR uploads
Similar to the handling required for the normal upload paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-25 11:26:40 +01:00
Chris Wilson 51590e55c0 sna/io: Wrap the XOR upload paths with SIGBUS handling
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-25 11:03:05 +01:00
Chris Wilson f0d2f1d4e0 man: Mention the new default accel
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-24 19:45:30 +01:00
Chris Wilson 0d87113080 man: State the negative aspects of TearFree
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-24 19:40:59 +01:00
Chris Wilson 2b6cb1cf45 sna: Do not apply drawable offsets to DamageRegionAppend
DamageRegionAppend() will itself apply the drawable offsets, so we need
to pass it the untransformed region. This also fixes an issue where we
might fallback without applying any Damage.

Reported-by: Christian Nassau <nassau@nullhomotopie.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32734
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-24 15:42:12 +01:00
Chris Wilson 8e44b1f554 sna: Fix canonical mode name to correctly use asprintf
Whoops. Only the kernel sprintf() accepts NULL as a valid target string,
not libc's.

Reported-by: Jay Little <jaylittle@jaylittle.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70835
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-24 13:05:16 +01:00
Chris Wilson 638d4f6028 sna: Remove the move-to-gpu shortcircuiting for partial GPU, no CPU damage
Otherwise we may not correctly undo COW or pending move-to-gpu updates.

v2: goto move_to_gpu instead for correcting the damage handling.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70821
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-24 07:30:22 +01:00
Chris Wilson e685e10070 Revert "sna: Remove the move-to-gpu shortcircuiting for partial GPU, no CPU damage"
This reverts commit bccbbf8a68.
2013-10-24 07:28:18 +01:00
Chris Wilson bd20791e8e man: Describe the TearFree option
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-23 16:15:35 +01:00
Chris Wilson b70390b4f8 sna: Reset bo after allocation failure during wait-for-shadow
If we fail to allocate an alternate bo to replace the still visible
scanout bo, we stall and were supposed to continue using the old
wait->bo. However, we chose to use NULL instead which is going to lead
to an eventual crash.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-23 11:15:28 +01:00
Chris Wilson 585340f75c 2.99.905 snapshot 2013-10-23 09:50:24 +01:00
Chris Wilson aff67ada6c sna: Tidy opportunistic flushing
Rearrange the common code so that it should be tail-call optimised.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-23 08:40:43 +01:00