Commit Graph

7396 Commits

Author SHA1 Message Date
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
Chris Wilson 33be42bf50 sna: Fix the addition of the current output Mode to the probed lists
We need to add the current mode to the Modes list and not directly to
the output->probed_modes as that gets overwritten.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-20 09:06:23 +01:00
Chris Wilson b1ecadd7b4 sna: Unmap pixmap prior to release GPU bo
As the unmap routine will deference the GPu bo in its debugging code, we
need to be sure that the pointer is still valid at the time of
unmapping. Hence unmap before release.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-19 22:40:05 +01:00
Chris Wilson db086d02af sna: Do a quick pass on dirty damage before reduction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-18 20:40:46 +01:00
Chris Wilson eedcac9a2d sna: Drop now obsolete assertion
We no longer unconditionally clear the CPU hint when moving to the GPU
for readonly updates, so we can no longer assert that the priv->cpu ==
false afterwards.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-18 17:27:27 +01:00
Chris Wilson dd280a69b5 sna: Tighten pixmap map assertions
We need to also take account of upload buffers which include an offset
to the base map. To do so, we also need to stop conflating the cpu hint
with the current mapping flag.

References: https://bugs.freedesktop.org/show_bug.cgi?id=70461
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-18 12:35:21 +01:00
Chris Wilson f81a7f7192 sna/glyphs: Remove glyph_approx_extents
It didn't consider the height of the glyph above the baseline, i.e. it
was fundamentally flawed. The only thing to do is to make sure that
glyph_extents() is sufficiently fast never to show up in profiles.
(Until then QA should spot the ~10% regression.) An alternative would be
to feed the drawable clip extents to the render engine and avoid manual
clipping if the clip region covers the whole drawable.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70552
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-18 09:27:47 +01:00
Chris Wilson fb1c177eb7 Remove defunct file 'brw_eu_util.c' from git
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-18 08:33:58 +01:00
Chris Wilson 930b2c76c7 sna: Check return of source_bo for a potential failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-17 17:16:56 +01:00
Chris Wilson 2cf2312372 sna: Fix computation of clip boxes for stipple uploads
References: https://bugs.freedesktop.org/show_bug.cgi?id=67865
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-17 17:14:13 +01:00
Chris Wilson 621eaba0d5 sna: Assert mapped state
When mapped, assert that we point to the expected mapping of the GPU bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-17 12:09:52 +01:00
Chris Wilson efe5c737ed sna/dri: Refactor to use the common GPU damage routine
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-17 11:32:39 +01:00
Chris Wilson ec0866e86d sna/glyphs: Fix computation of extents for long strings
And make sure we consider such overflowing strings for correct clipping
against Windows.

To offset the cost of doing a full extents check (~10% on aa10text), we
introduce an approximate extents query (~1% on aa10text). The disparity
should be rare, and should be an overestimate to force redundant
clipping.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70541
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-16 22:54:09 +01:00
Chris Wilson 09121a61b3 sna: Fix inverted tiled CPU map check in has_coherent_ptr()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-16 12:43:43 +01:00
Chris Wilson 2068492fba sna: Only carry 32/64-bit compat wrapper for drm_mode_get_connector
This is the only structure we care about that has u64 and its size is
not a multiple of u64s.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-16 09:52:14 +01:00
Chris Wilson a63b4d5a07 sna: Expand packed KMS structs for 64-bit alignment
Pavel Roskin found that with a 32-bit build of the DDX with a 64-bit
kernel that the call to GETCONNECTOR was overwriting the 4 bytes beyond
the end of the drm_mode_get_connector structure. This would appear to be
due to the surreptious padding inserted by the compiler so that the
structure would be naturally aligned on a 64-bit system. To compenstate
we need to insert padding between the adjacent 32-bit structures on the
stack.

As usual, be paranoid and make sure that all the adjacent KMS structs we
use are padded out to an 64-bit boundary.

Reported-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-15 21:57:44 +01:00
Chris Wilson dc072db862 sna: Add DBG along all output init failure paths
Suggested-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-15 16:21:41 +01:00
Chris Wilson 8447e50824 sna: Allow read-mappings for has_coherent_ptr() assert
The assertion was a little too specific and disallowed us to have a CPU
read-only mapping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-15 14:58:57 +01:00
Chris Wilson f41b0663dc sna: Speed up inplace copies from SHM pixmaps to GPU bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-15 14:58:56 +01:00
Chris Wilson ad5b6a303b Revert "sna: Preserve the user backlight value for get_property calls"
This reverts commit 41b6b792d8 in favour
of the better fix to not ask RRChangeOutputProperty to reset the known
hardware values.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-15 12:48:57 +01:00
Chris Wilson e76b08cad2 sna: Disable updating properties upon reading their values
When we assign the hardware values to the output properties, we do not
need to process the set_property callback to write those values back to
hardware. This callback is triggered by the pending update flag passed
to RRChangeOutputProperty.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70406
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-15 12:47:46 +01:00
Chris Wilson 41b6b792d8 sna: Preserve the user backlight value for get_property calls
When querying the current backlight value, be sure not to overwrite the
last user set value by the call to RRChangeOutputProperty.
RRChangeOutputProperty calls into set_backlight_property, tricking us
into believing that the user has set a new backlight value. The result
is that we end up believing that the user chooses a 0 backlight if she
should happen to query the property whilst the output is disabled.

Reported-by: reztho@archlinux.us
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70406
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-15 11:31:29 +01:00
Chris Wilson 0345cbec97 sna/trapezoids: Initialise force_fallback
Remember to set it initially to false so that we randomly do not start
using fallbacks.

Fixes regression from
commit 0cd2c43fa8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Oct 13 14:46:45 2013 +0100

    sna/trapezoids: Use the aligned fast path for fallbacks

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-15 10:43:00 +01:00
Chris Wilson e952968ed7 sna: Assert that the mode/ring are set when marking active bo
As we use the current ring to encode upon the bo relocs, we need that
ring to be properly setup prior to performing relocations.

References: https://bugs.freedesktop.org/show_bug.cgi?id=70461
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-14 23:18:24 +01:00