Commit Graph

7488 Commits

Author SHA1 Message Date
Chris Wilson 96d1fe314c sna: Add a few missing checks for all-damaged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 09:21:25 +01:00
Chris Wilson 30f521c717 sna: Discard GPU damage for the magic upload proxy
The magic upload proxy is initially considered damaged in both the GPU
and CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 09:21:24 +01:00
Chris Wilson e5b94c2d9b sna/glyphs: DBG compile fix
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17 08:12:42 +01:00
Chris Wilson a4d845bc8f sna: Regularly check the cache level on bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 15:59:12 +01:00
Chris Wilson 09f0fe9b39 sna/dri2: Allow single crtc exchanges to be queued up
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 14:20:12 +01:00
Chris Wilson 4ab99d6799 uxa: Allocate frontbuffer to meet old fence constaints
libdrm is a little lax and does not allocate sufficient space for us to
safely use buffers on old gen. So compute the size we want for
ourselves.

Reported-by: Cem Aydin <cem.aydin@gmx.ch>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80088
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 13:01:17 +01:00
Chris Wilson 10cb36e1dd sna/glyphs: Add DBG option to force use of the glyph image mask
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 10:33:07 +01:00
Chris Wilson 8f0fc2ed4c uxa: Add some explanation to why bo were rejected
References: https://bugs.freedesktop.org/show_bug.cgi?id=80088
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 10:27:16 +01:00
Chris Wilson 6b82962e58 sna: Fix logic inversion for final placement in is_gpu_dst()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 10:13:09 +01:00
Chris Wilson 62102f505c sna: Promote better active buffer reuse
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 09:50:23 +01:00
Chris Wilson 2877d018d3 sna/glyphs: Show number of glyphs in DBG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 09:25:48 +01:00
Chris Wilson 38434b29f4 sna: Fix some batch DBG
Helps to check for a successful read when we want to show the batch
after execution.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 08:03:21 +01:00
Chris Wilson 243bd26ad3 sna: Clear our private hints about front rendering exported bo
Unlike GLXWindows, GLXPixmaps are rendered directly into, without a
staging copy. Therefore we must treat those carefully when exported and
clear our hints everytime control passes back to the Client.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79999
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 07:00:40 +01:00
Chris Wilson 500e77d765 sna: Add more DBG to track transitions between CRTC and its shadow or flip bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16 06:59:01 +01:00
Chris Wilson 981aafe797 sna: Enable TearFree by default for systems with PSR
Panel Self-Refresh requires us to avoid frontbuffer rendering in order
to be power efficient. This is a job for TearFree!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-14 06:53:02 +01:00
Chris Wilson b27837d537 sna: Fix assertions for discarding upload caches
The upload caches are special, along with having a bo->proxy, they also
claim to be completely damaged on both the GPU and CPU. Allow that to
pass through when discarding the proxy.

Reported-by: Nick Bowler <nbowler@draconx.ca>
Bugzilla; https://bugs.freedesktop.org/show_bug.cgi?id=79992
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-14 06:53:02 +01:00
Chris Wilson 15485602d8 sna: Use the right is-clipped hint
The region here has yet to be clipped, and so the only valid is-clipped
hint is from the flags computed from the PolyRect extents. Make sure we
use those when determining whether it is valid to discard damage.

Fixes regression from
commit ad03900688 [2.99.903]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Sep 24 10:00:03 2013 +0100

	sna: Separate out copy preferrence from operating in place decision

Reported-by: Nick Bowler <nbowler@draconx.ca>
Tested-by: Nick Bowler <nbowler@draconx.ca>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79992
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 21:45:22 +01:00
Chris Wilson b082a07a69 sna: Only discard the CPU bo if we have a GPU bo to transfer the damage to
References: https://bugs.freedesktop.org/show_bug.cgi?id=79992
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 21:43:59 +01:00
Chris Wilson 0a0b9dc353 sna: Refine decision whether to use the GPU or render inplace
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 16:53:35 +01:00
Chris Wilson dd87aa8f85 sna: Track the pageflip bo's busyness
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 15:06:13 +01:00
Chris Wilson 8322e3e5c6 intel: Check that the fd points to i915 after authorising
The call to GETPARAM requires either a rendernode or authorisation.
Therefore we can only assert that the fd is a valid i915 handle after
authorise() and not before.

Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 13:52:52 +01:00
Chris Wilson 97003b1a2d sna/gen6+: Prefer the BLT for large overlapping copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 13:52:41 +01:00
Chris Wilson 87fc78ac4f sna: Try to reuse the current cursor if we fail to update
As a last resort, continue to display the old cursor if we tried and
failed to create a new cursor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 10:52:47 +01:00
Chris Wilson d47a01fce4 sna: Reorder ignore_cpu_damage() to avoid asserts
Tricksy asserts making sure that the correct arguments are passed
around!

Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 08:51:20 +01:00
Chris Wilson c4d4bd5d92 sna/gen8: Allow reads from scanout to be cached
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 08:32:34 +01:00
Chris Wilson 8e743ccef8 sna/gen8: Check for WT support before attempting to use the WT mocs
It appears the kernel has a better idea when WT is supported on which
gen8 parts. I assumed it was always supported, but experience suggests
otherwise, so only use WT support when advertised.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79967
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13 08:27:05 +01:00
Chris Wilson ffe067705b sna: Try to use CPU uploads before BLT uploads
As the BLT upload implies a sync (and a likely GPU boost), only do so if
we cannot do an immediate upload with the CPU, either directly to
backing memory or through the GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-12 18:17:04 +01:00
Chris Wilson 93444ea673 sna: Refactor USE_INPLACE debug macro
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-12 09:26:14 +01:00
Chris Wilson abbf6d6b79 sna/gen8: Clear a couple more push constants
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 21:14:00 +01:00
Chris Wilson 7f9b015d87 sna: Remove bogus assertion
The sna_pixmap is cleared afterwards, it does not need to be clear on
free.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 19:10:22 +01:00
Chris Wilson e3a0e40310 sna: Fix direction flags for memmove
Under a compositor, the current deltas may invert the sense of the copy
direction, causing scrolling corruption. Simplify handling those flags
by making them invariant for the function.

Reported-by: Bruno Prémont <bonbons@linux-vserver.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79843
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 18:54:54 +01:00
Chris Wilson 55660376d5 sna: Use the pixmap header creation routine
A few more places could use the common pixmap creator, just remember to
handle the SHMPixmap complication!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 18:54:54 +01:00
Chris Wilson 1beaa980ea sna/gen6+: On small GT avoid the intermediate copy for overlaps
If the memory bw is constrained on the GPU avoid doing the 2-pass copy
for overlaps on the render ring, and do the single pass slower BLT copy
instead - as since it has to transfer less data it will be faster.

Reported-by: Ildar Nurislamov <absorbb@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 16:57:14 +01:00
Chris Wilson 31467b01e3 sna/gen6+: Overlapping bo by definition have compatible depths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 16:21:13 +01:00
Chris Wilson 0dfe7d93de sna: First copy to overlap temporary must be using GXcopy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 16:12:26 +01:00
Chris Wilson ad076b3940 sna: Remove debugging hunk
Stray hunk in self-copy boxes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 15:49:43 +01:00
Chris Wilson a90160dcec sna: Update damage pointer after the implicit reduction
sna_damage_contains_box() routine implicitly reduces the damage before
performing its check. This may alter and even destroy the damage entry,
so pass in the handle so that it can be updated correctly.

References: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 15:43:06 +01:00
Chris Wilson c9003c6d96 sna: Fix scanout creation routine for old kernels <= 3.11
With an old kernel, we would fail to actually mark the display as part
of the scanout domain, but proceed to assign it a fb id. This caused our
asserts to report our bookkeeping error.

Reported-by: Pavel Ondračka <pavel.ondracka@email.cz>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79909
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 15:43:01 +01:00
Chris Wilson 5705e66a32 sna: Add some DBG to the memmove path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 15:29:56 +01:00
Chris Wilson b41a51e0f5 sna: Tweak self-copy boxes to hit the GPU more often
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 14:22:26 +01:00
Chris Wilson b879de6246 sna: Recheck source bo after migrating dst (in case of src == dst)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 14:08:31 +01:00
Chris Wilson 21c150a873 sna: Skip redundant clears
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 14:02:54 +01:00
Chris Wilson e1a4438f07 sna/glyphs: Always print some DBG when performing fallback
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 13:59:46 +01:00
Chris Wilson 040eccb9b1 sna: Add some asserts to track redundant damage operations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 13:18:33 +01:00
Chris Wilson 4fccfe3a51 sna/gen8: Check offset alignment before using a userptr for RENDER
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79053
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 11:05:27 +01:00
Chris Wilson 1217dbc88e sna: Support efficient cursor updates for old machines
Given a kernel patch to fix coherency of physical objects, we can use a
more efficient method for updating cursors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 11:05:27 +01:00
Chris Wilson ee7d2e0a8e sna: MST topologies may change on any hotplug event
As the kernel does not send out an explicit DISCOVER event, we have to
reinspect every connector after every hotplug event to detect topology
changes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 11:05:27 +01:00
Chris Wilson 782c920b01 sna: Create a stable output name based on MST topology
In order to provide persistent names for MST devices, which may change
topology dynamically, the kernel exports a PATH blob. We can then use
this path to generate the output name, and so reuse existing XID when a
monitor is plugged back in.

Based on the patch for -modesetting by Dave Airlie.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 11:05:27 +01:00
Chris Wilson e680e54eab sna: Ignore setting read-only for temporary userptr maps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 11:05:27 +01:00
Chris Wilson d9bf6f3fec sna: Prefer to operate inplace on the GPU rather than stall on the CPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11 11:05:16 +01:00