Commit Graph

9105 Commits

Author SHA1 Message Date
Chris Wilson 656c0a6946 list: Add missing ';' for the compatiblity macro for intermediate xorg
Reported-by: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-12 12:31:27 +01:00
Chris Wilson 5a9a3e73a9 sna/dri2: Keep the most-recent back buffer cache when reaping on idle
When the client misses a swap, we consider it idle and unlikely to swap
again for a while. We try to take advantage of that and remove the old
back buffers. But it is likely to swap again and so having some of that
cache around would be advantageous.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-11 10:48:48 +01:00
Chris Wilson 4cea803798 sna/dri2: Restore caching of fullscreen triple buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-08 22:10:58 +01:00
Chris Wilson fd5f44f4d2 sna: A couple more asserts for valid flip data and handling
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-08 22:10:57 +01:00
Chris Wilson cadea260de sna/dri2: Add the old buffer from a chain swap to the swap cache
Rather than just discarding the old buffer, we want to add it to the swap
cache and so hand it back to the client in the near future.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-08 15:39:05 +01:00
Chris Wilson 611ec7d7d4 sna: Remove incorrect assertion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 17:19:25 +01:00
Chris Wilson f324506f7d sna: Prefer direct writes if the target is LLC
If we can use WB CPU writes into the target, prefer to do so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 16:45:38 +01:00
Chris Wilson 095528e6c3 sna: Tweak the semantics for small uploads into Damage tracked pixmaps
Based on further study of behaviour under a compositing manager, always
prefer to upload directly into the flushed bo, with a couple of
exceptions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 16:38:32 +01:00
Chris Wilson 07bcd3f0c7 sna: Use direct uploads into a Damage tracked for v.small operations
If the batch is being frequently flushed due to Damage+Composite
tracking, we cannot amalgamate the small copies into the destination and
so end up sending thousands and thousands of tiny batches with tiny
render copies hogging the GPU.

References: https://bugs.freedesktop.org/show_bug.cgi?id=91577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 15:26:30 +01:00
Chris Wilson 3f128867d9 sna: Skip a no-op copy
If the source has no contents, the destination is equally undefined.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 15:21:33 +01:00
Chris Wilson a3ac461a30 sna: Add a handle=%d to a DBG for consistency
Helps with grepping if the DBG are consistent.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 15:18:49 +01:00
Chris Wilson 5ef9d68043 sna: More simple DBG tracing around cleanup/retire handling
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 14:04:31 +01:00
Chris Wilson fd0236bb8e sna: Release the reference on the rq->bo during forced cleanup
Since the switch to preallocating the batch buffer, the request owns its
reference to the rq->bo. However, dropping that reference was missed
during the cleanup.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 13:48:38 +01:00
Chris Wilson 6bab82b91d sna: Always prefer a fresh allocation for the batch if !llc
An unwanted subtle change in preference from

commit 8c465d0fbf
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Aug 7 10:15:42 2015 +0100

    sna: Fallback after a bo allocation failure for the batch

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 13:25:52 +01:00
Chris Wilson a00fdce1fd sna: Add a little more DBG information to kgem_retire()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 13:24:13 +01:00
Chris Wilson d78685787a sna: Fix sync'ing to the most recent request on forced cache cleanup
We picked the oldest, not most recent and so were not recovering as much
memory as desired.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 12:59:57 +01:00
Chris Wilson 862c0d3cc9 sna/dri2: Make event chaining DBG clearer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 12:57:31 +01:00
Chris Wilson f1b1baa7ff sna: Add a DBG for when we discard an invalid old mmapping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 12:45:26 +01:00
Chris Wilson 672436efd5 sna: Treat being wedged as unlikely during rendering with HW
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 12:03:34 +01:00
Chris Wilson ccc553ff03 sna: Stop allocating requests once wedged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 12:01:38 +01:00
Chris Wilson b0f125495c sna: Tweak DBG traces for cache cleanup
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 11:57:27 +01:00
Chris Wilson 90b6cba066 sna: Add DBG trace when doing a forced cache cleanup
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 11:07:09 +01:00
Chris Wilson ca71199679 sna: Harden batch allocation against resource starvation
If the batch allocation fails, retire the oldest request and try again.

References: https://bugs.freedesktop.org/show_bug.cgi?id=91577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 10:48:20 +01:00
Chris Wilson 8c465d0fbf sna: Fallback after a bo allocation failure for the batch
If we fail to allocate the next bo to use for the next_request, we can
just fallback to the delayed allocation used by !llc.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 10:16:56 +01:00
Chris Wilson 69d8edc111 sna: Handle batch allocation failure
Whilst we currently do not try and submit a failed batch buffer
allocation, we still treat it as a valid request. This explodes much
later when we inspect the NULL rq->bo.

References: https://bugs.freedesktop.org/show_bug.cgi?id=91577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-07 10:08:17 +01:00
Chris Wilson bc063c9f4a sna: Undo a CRTC flip that results in a pageflip failure
If the pageflip following the CRTC fixup fails, we can be left with the
flip-to bo being left as the CRTC scanout. If that is so, reset the
desired mode (and original scanout bo).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-31 17:17:26 +01:00
Chris Wilson 9451976a5b sna: Assert that flip handler/data exists before invoking
Just an explanatory assert in case we ever jump off into a NULL function
pointer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-31 17:14:12 +01:00
Chris Wilson 6a2dcb388e intel: Refactor i915.ko loading support
Different OS name the i915 KMS module differently, so make it convenient
for us to be able to feed in the right name, or even just try them all
and pick the first one that exists!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-31 10:47:24 +01:00
Chris Wilson 4246c63347 sna: Fix off by one in constructing XCopyPlane on bdw
Broadwell expanded all the relocations and we needed to adjust our
command construction to match. I missed offsetting the XY_SRC_COPY_IMM
used for XCopyPlane resulting in garbage for small copies on Broadwell.

Reported-by: Omar Sandoval
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91499
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-29 09:45:50 +01:00
Chris Wilson 66e16d97ee test: Exercise copyplane
Reported-by: Omar Sandoval
References: https://bugs.freedesktop.org/show_bug.cgi?id=91499
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-29 09:45:47 +01:00
Chris Wilson 4f0a58c9db sna: Batch process hotplug events
Read all available HOTPLUG uevents and batch them into a single topology
probe. Like waiting for a bus, when one hotplug uevent arrives expect a
few more.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-28 13:51:49 +01:00
Chris Wilson 6be2bea5f0 sna: Double check for Present takeover before TearFree flips
References: https://bugs.freedesktop.org/show_bug.cgi?id=91467#c17
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-26 19:58:53 +01:00
Chris Wilson d11dc75fb5 sna: Only check non-NULL Pixmaps
check_pixmap() can be called very early in the Window setup proceeding,
before a pixmap is even assigned to a Window. There we expect the Window
to be NULL, so be more careful in our check_pixmap.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91467#c16
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-26 19:08:39 +01:00
Chris Wilson e5f8f90f68 sna: Stall for outstanding TearFree flips when taking over with Present
When juggling Present and TearFree, we have to hide the extra flips from
Present as it cannot account for them. Preferrably we want to schedule
the Present flip following completion of the TearFree flip, but for the
moment simply block and wait until TearFree completes before starting
Present.

Reported-by: Andreas Reis <andreas.reis@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91467
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-26 19:03:46 +01:00
Chris Wilson 7e5e006be4 sna: Add a few more DBG and assertions around Present/TearFree interactions
References: https://bugs.freedesktop.org/show_bug.cgi?id=91467#c12
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-26 18:41:03 +01:00
Chris Wilson 50f3e9c41c sna: Add a small pixmap sanity check
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-26 18:22:16 +01:00
Chris Wilson f7cb248169 sna: Add a some DBG info to Window creation/destruction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-26 17:45:30 +01:00
Chris Wilson c7d0acf785 sna: Add a DBG trace to reusing pixmap headers
References: https://bugs.freedesktop.org/show_bug.cgi?id=91467#c9
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-26 16:46:22 +01:00
Chris Wilson bff0272b4f sna: Put the assert(!kgem->can_fence) back to where they were
Still need to improve the handling of set_gpu_tiling() to mark up the
unfenceable buffers better, but we can't more the asserts here as we
don't have the kgem struct available.

Fixes 2f1623daed94b98d3bae3c9ee8346e8de9afc33d with asserts enabled

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-25 11:54:04 +01:00
Chris Wilson 8090a65e2d sna: Only reset the bo->needs_flush flag if the buffer is busy-write
Since the kernel now differentiates whether the buffer is busy for
read/write, we can use that knowledge to better set our own
bo->needs_flush flag only when there are outstanding writes to the
buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-24 12:16:02 +01:00
Chris Wilson 4cc2fb8fbf sna: Add logging for set-tiling failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-24 11:39:53 +01:00
Chris Wilson f252dba9da sna: Use DBG_NO_TILING to disable all fencing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-24 11:34:25 +01:00
Chris Wilson ad20fd401b sna: Ensure that DRI2 buffers are created with a fence
We use the fence as a backchannel to commuicated the tiling mode to the
DRI2 client, so in such cases we cannot tolerate a failure to set the
tiling mode.

References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c114
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-24 11:30:46 +01:00
Chris Wilson 2050d03f52 Start splitting out the benchmarks from test/
First comes the swap overhead measurement for various window modes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-23 14:51:02 +01:00
Chris Wilson a29e765ec0 sna: Fix the last character before a colon in the fake-edid paths
I chopped off one too many characters when creating the path in the
presence of a colon-delimited list.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-22 11:34:51 +01:00
Chris Wilson 8d9e496670 sna/dri2: Take over the placeholder vblank
If we are doing synchronous but immediate swaps, we may notice that we
have a vblank placeholder from the last swap. If so, we can replace it
with the swap we need to perform on the next vblank.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-22 11:27:29 +01:00
Chris Wilson 7301516b63 tools/cursor: Error on malloc failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-21 14:09:01 +01:00
Chris Wilson 18b947b999 sna: Abort output construction on allocation failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-21 14:05:40 +01:00
Chris Wilson 6742fea212 sna: Terminate the fake-edid path correctly
An off-by-one on the NUL terminator placed it after the path string.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-21 13:52:23 +01:00
Chris Wilson 2cd7cb9e93 sna: Allow user override of EDID for an output
As a slightly more convenient approach than loading the EDID on the
kernel command line, allow the user to specify the EDID path in the
Device section of xorg.conf, e.g.

Section "Device"
	Identifier "igfx"
	Option "CustomEDID" "DP1:/path/to/dp1.edid,DP2:/path/to/dp2.edid"
EndSection

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89945
2015-07-18 12:07:48 +01:00