Commit Graph

7367 Commits

Author SHA1 Message Date
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
Chris Wilson 9f009c13be sna/gen6: Fix the invert fix
Eek, missed that 8-wide dispatch branch still had the opposite fix that I was
testing first.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-14 11:54:35 +01:00
Chris Wilson 8909f74235 sna/gen6+: Fix calculation of 1/z for projective textures
A typo crept in causing the shader to read from the wrong temporaries
for the invert operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-14 09:44:37 +01:00
Chris Wilson 21577742e7 sna: Tighten has_coherent_ptr() assertion
Pass along the flags for read/write direction so that we know whether or
not we expect the gpu bo to be in the CPU write domain.

Reported-by: Pavel Ondračka <pavel.ondracka@email.cz>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-14 09:33:52 +01:00
Chris Wilson 2987a6d566 sna: Fix typo in DBG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-13 18:50:03 +01:00
Chris Wilson 0cd2c43fa8 sna/trapezoids: Use the aligned fast path for fallbacks
Route the fallback methods through the force_fallback aligned fast
paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-13 14:46:45 +01:00
Chris Wilson 87d675061e sna: Cleanup up unused variables
commit 951f969fa6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Oct 13 12:47:20 2013 +0100

    sna: Update DPMS on attached outputs before disabling the CRT

left behind a couple of variables now deceased.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-13 13:39:20 +01:00
Chris Wilson 951f969fa6 sna: Update DPMS on attached outputs before disabling the CRTC
We may want to take action such as preserving the current user value of
the backlight before disabling it whilst forcing a CRTC off. This
requires us to record that value first.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-13 12:47:20 +01:00
Chris Wilson 8e7d6ddb9b sna: Cleanup allocation of sna_output after late syscall fail
If the second syscall fails (presumably as a deferred allocation failure
check), cleanup the allocations made so far before reporting the
failure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-13 11:04:02 +01:00
Chris Wilson f9a18c9f38 uxa: Check for allocation failure in i915 video
For a large screen, we have to create a temporary surface for rendering
the textured video. If this pixmap creation fails we may be left with a
system memory only pixmap leading to a segfault.

Reported-by: Bas Wijnen <wijnen@debian.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-13 10:40:21 +01:00
Chris Wilson 978b93a20b uxa: Abort CreateScreenResources after allocation failure
One of UXA's invarients is that the ScreenPixmap is complete (i.e. has
an intel_pixmap private with a bo attached). If we fail to create that
private during CreateScreenResources we will die very soon afterwards,
so just report the failure and shutdown gracefully.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-13 10:40:21 +01:00
Chris Wilson e914dada55 configure: Allow manual specification of intel-gen4asm path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-11 10:51:35 +01:00
Chris Wilson 3e3af6936e sna: Populate bo->size from dma-buf
Recent kernels gained the ability to report the actual size of the
dma-buf through an lseek. We can use this to set the correct size of the
bo when available, overriding the guess provided by the caller.

Suggested-by: Kristian Høgsberg <krh@bitplanet.net>
Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-10 22:19:44 +01:00
Chris Wilson f0bd716425 sna: Sanitize output->crtc before falling back oto xf86InitialConfiguration
During initialisation, we stash the currently attached CRTC id in
output->crtc. This is fine as ordinarily we would not dereference
output->crtc until after it had been assigned a real CRTC. However,

commit 6fda305e2f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Oct 9 15:59:42 2013 +0100

    sna: Append the current mode to the output list if not found

introduces such an early dereference and causes a crash if we fail to
probe the KMS configuration (usually due to a user override).

Reported-by: Łukasz Maśko <ed@yen.ipipan.waw.pl>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-10 16:27:22 +01:00
Daniel Martin 700a845cc6 configure: Add xfixes to X11 pkg check
Add xfixes to the list of PKG_CHECK_MODULES for X11. '-lXfixes' was
hardcoded in test/Makefile.am before. This could lead to a broken build
in very rare cases where the build environment has all specified X
libraries but Xfixes.

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
2013-10-10 14:36:37 +01:00
Chris Wilson 79f8ff4bbb sna/gen4+: Share a few common routines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-10 13:24:46 +01:00
Chris Wilson 8bd9d63a86 sna/gen6+: Share the common routines for ring preferrence
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-10 13:24:46 +01:00
Chris Wilson ddcd860702 sna/gen6+: Only allow switching to BLT for fills if we have semaphores
An extra caveat to these generations for

commit 97d809c26b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Oct 10 00:15:55 2013 +0100

    sna: Pass usage hint down to render fill routines

is that we don't want to incur ring switch overheads that may overwhelm
any advantages from using the BLT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-10 12:19:20 +01:00
Chris Wilson c99d44d7f0 sna: Prevent changes in tiling/pitch of existing framebuffers
Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-10 08:32:51 +01:00
Chris Wilson 97d809c26b sna: Pass usage hint down to render fill routines
For the scanlines emitted for rendering Core drawing primitives, it is
preferable to use the BLT engine, so pass those hints down.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-10 00:16:58 +01:00
Chris Wilson b16999da21 sna: Upon unwinding operations, also check for exec objects to clear
If we cancel an operation after partially committing it, we may leave
the batch bookkeeping in an inconsistent state with an exec object with
a zero-length batch. Ordinarily, this would not be an issue as we could
pass the extra object to the next batch. However, if we switch rings, we
need to clear the extra objects as they are currently flagged as being
on the wrong ring, leading to hilarity.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-10 00:00:46 +01:00
Chris Wilson b9ad5b625e 2.99.904 snapshot 2013-10-09 17:18:43 +01:00
Chris Wilson d1aa2ac5dd sna: Steal the current mode name
Rather than duplicating a string, we can simply transfer ownership from
the temporary mode to the mode list.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-09 16:22:59 +01:00
Chris Wilson 6fda305e2f sna: Append the current mode to the output list if not found
If for some reason the current mode on the CRTC (inherited most likely
from fastboot) doesn't match any of the modes reported by the output, we
end up with a stray mode that the client cannot control.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70132
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-09 16:10:17 +01:00
Chris Wilson d1cb39d0a8 sna/gen3+: Flush vertex buffer after computing resize
Upon aligning the buffer, we may enlarge the vbo to accomodate the
vertex alignment and push the current index past the end of the buffer.
Move the space check from before the alignment computation to
afterwards.

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-10-09 11:15:24 +01:00
Chris Wilson 38333443b8 sna: Emit DBG for when we fallback to xf86InitialConfig detection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-08 16:12:06 +01:00
Chris Wilson 082c08789c sna: Rework the num_threads refinement to avoid the division
We can replace the division by a multiplication.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-08 09:40:34 +01:00
Chris Wilson 06a8ad9690 sna/trapezoids: Recompute num_threads to match range
We need to be careful not to execute threads past the end of the alloted
buffer by making sure the clip extents correctly align.

Reported-by: Joseph Yasi <joe.yasi@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70204
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-08 00:04:54 +01:00
Chris Wilson 1fb4f60671 sna: Trim color cache allocation to a single page
Instead trying to allocate 4100 bytes, fix the logic to only require a
maximum of 4096 bytes in the cache buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-07 22:06:32 +01:00
Chris Wilson 55cd67485f sna/trapezoids: Only use a single thread to emit rectilinear spans
If the trapezoids are rectilinear, they should hit a fast path through
the span compositors and so threading them seems pointless. Expect
possibily for inplace pixman operations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-07 21:39:43 +01:00