Commit Graph

7419 Commits

Author SHA1 Message Date
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
Chris Wilson 11e8b299e1 sna: Flush the pending move-to-gpu upon Pixmap free
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 18:21:50 +01:00
Chris Wilson 4eb736d61a sna: Handle pending move-to-gpu for userptr uploads
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 17:57:59 +01:00
Chris Wilson c9e304a719 sna: Pass the async hint when pushing GPU damage for redisplay
So that we don't accidentally clear any other hints.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 17:57:59 +01:00
Chris Wilson c51dd18ead sna: Fix inconsistency in has_coherent_ptr assertion
We occasionally will read from an "incoherent" ptr in the belief that
the clflush hit will be worth it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 17:57:59 +01:00
Chris Wilson bccbbf8a68 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.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 17:57:58 +01:00
Chris Wilson 1c282afb21 sna: Make sure CPU damage is flushed to the TearFree shadow
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 17:57:58 +01:00
Chris Wilson 247ebf86a3 sna: Only force the TearFree exchange before a write
We can read from the current scanout buffer without incurring a visual
tear, so delay the GPU bo exchange until we see a write to the object.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 17:57:57 +01:00
Chris Wilson 7b78f25d89 xvmc: Handle errors along allocation path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 16:43:19 +01:00
Chris Wilson 27249537d7 sna: Free our CRTC private after failing to create the xf86Crtc
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 16:43:19 +01:00
Chris Wilson 9fcda71d75 sna/trapezoids: Fix inversion of initialisation test for triangles
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 16:43:19 +01:00
Chris Wilson 9fc95bebe7 sna: Ignore overflow in CPU count rather than abort
If there are more processors than we ever expect, good! Just use lots of
them, rather than none at all.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 16:43:19 +01:00
Chris Wilson e3f15cbf39 sna: Move gc back to GPU after failure to move it to CPU
As the failure in gc move-to-cpu occurs late, i.e. after the function
pointers are updated to point to CPU functions, we need to undo those
changes, i.e. call move-to-gpu for the GC on failure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 16:43:19 +01:00
Chris Wilson 0d18b39565 sna: Discard GPU bo when failing to setup the shared pixmap
If we fail to mmap the pixmap when preparing it for use with prime, be
sure to throw away the now lost priv->gpu_bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 15:19:12 +01:00
Chris Wilson c0f31d822a sna: Free bo along unlikely one-off error path
Add a missing free for a never-hit error.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-22 15:00:16 +01:00
Chris Wilson d788b69fdb sna: Enable TearFree rendering for transformed scanouts
References: https://bugs.freedesktop.org/show_bug.cgi?id=22969
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-21 23:46:47 +01:00
Chris Wilson fa2687bdd5 sna: Eliminate the synchronous wait from inside TearFree
Defer the actual wait until the next use of the screen pixmap, and then
if needed replace the GPU bo with an alternative back buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-21 23:44:16 +01:00
Chris Wilson 83c1d1efa1 sna: Improve handling of blit fallbacks for untransfomed large scanouts
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-21 17:52:05 +01:00
Chris Wilson 8c562bac64 sna: Tweak opportunistic flushing to reduce power consumption
When trying to conserve power, reduce the number of small batches we
emit - trying to maximise GPU efficacy and minimise CPU overhead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-21 15:35:27 +01:00
Chris Wilson 11211cd7c0 sna: Set the canonical name for the current mode if none match
Always give the mode a name for pretty printing for the user.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-21 13:37:40 +01:00
Chris Wilson 5d5dfb3e7a sna: Copy the EDID mode name for the current CRTC mode
As the kernel does not preserve the name and driver type when returning
the current CRTC mode, we need to reconstruct those from the EDID mode
when available.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-21 13:25:01 +01:00
Chris Wilson e1027ad7c6 sna: Fix typo inside an assertion
Use the right dst_priv variable instead of priv!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-21 11:16:02 +01:00
Chris Wilson 0b87b0c49a sna: Suppress log messages for unchanging EDID
Whenever we reprobe an unchanging output and re-read its EDID, we emit a
useless log message. Previously this was squelched by trying to spot
when an EDID was unchanged through the use of its blob.id, however we
need to do a complete check on the contents in case the kernel returns
us a new EDID with the old id. So make a temporary copy of the current
EDID data and only squelch the log messages if the new EDID is an exact
match.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-21 11:12:05 +01:00