Commit Graph

5464 Commits

Author SHA1 Message Date
Chris Wilson 747ed0ca28 sna: Only promote to full GPU if we already have a GPU bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-10 17:08:15 +01:00
Daniel Stone 232217eef8 i810: Make DGA optional
Don't build DGA when it's not available, or when we don't want it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-10 09:36:40 +01:00
Daniel Stone 78dc0c0474 i810: Make XAA optional
Don't build XAA when it's not available, or when we don't want it.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-07-10 09:32:01 +01:00
Chris Wilson 45ab003a58 sna: Check for overlapping glyphs within each list, then overlapping lists
Spotted by Zhigang Gong is this optimisation to avoid the problem with
multiple lines passed in a single request (using multiple lists). As the
start of line will overlap with the previous line when we use the simple
bbox comparison, we always declare those runs as overlapping and so we
cannot substitute a glyph mask. However, we can reduce the problem to
only checking for overlapping glyphs within a list and then checking for
overlapping lists. Very, very clever.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 21:35:06 +01:00
Chris Wilson 8066bc33d7 sna: Fix reversal of inside logic for BitmapToRegion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 11:41:17 +01:00
Chris Wilson 8a9a17cd09 sna: Improve the check for assertions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 11:41:17 +01:00
Chris Wilson b11bc37684 sna: Simplify the DBG incarnation
It was only ever used in conjunction with HAS_DEBUG_FULL. For debug
purposes it is as easy to redefine DBG locally. By simplifying the DBG
macro we can create it consistently and so reduce the number of compiler
warnings.

Long term, this has to be dynamic. Sigh.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 11:41:17 +01:00
Chris Wilson 21798a8867 sna: Promote large operations to use the whole GPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 09:57:00 +01:00
Chris Wilson 1b6ad7a6ae sna: Only consider large clears as candidates for GPU migration
If we only operating on a small region of the pixmap and have require
damage migration in the past, we are likely to require migration again
at some point. So keep track of small damage areas.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 09:57:00 +01:00
Chris Wilson d8a75538ea sna: PadPixmap only writes to the out-of-bounds bits
So we only need to delcare it as reading the source pixmap and not mark
it as damaged.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 09:57:00 +01:00
Chris Wilson eafb454edf sna: Rename conflicting symbols with uxa
Reported-by: Christoph Reiter <reiter.christoph@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51887
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 09:57:00 +01:00
Chris Wilson 0af29175a0 sna: Just use a linear scan to find the terminating clip box
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 01:24:23 +01:00
Chris Wilson 2941a5fe15 sna: Remove the consideration of CPU damage for overwriting FillRect
We consideer a singular FillRect to be a sequence point in the rendering
commands, that is it is usually used to clear the background as the first
operation in a drawing sequence. So it is useful to ask if we can move
the sequence to the GPU at that point.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 00:47:21 +01:00
Chris Wilson 8be00b6d47 sna: Substitute the reduce clip region for fallback ops
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 22:29:43 +01:00
Chris Wilson 0457935a70 sna: Review placement hints for fallback operations
Look for those operations that maybe better via the GTT and those that
are preferred to be in CPU cache. The wonders of multiple layers of
heuristics.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 22:29:43 +01:00
Chris Wilson b7f0b0e7e3 sna: Remove function for force-to-gpu
This is now enitrely done in the core move-to-gpu as a special case.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 22:29:43 +01:00
Chris Wilson bb8770158c sna: Apply the clear color when resizing the front buffer
If the existing front buffer is clear, just apply the clear color to
then new buffer rather than copy the old one across.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:22 +01:00
Chris Wilson 8dd14855d7 sna/dri: Review stale comments
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:22 +01:00
Chris Wilson 3bb7a530e7 sna/dri: Fix cross-chaining of pageflip vs vblank
And double-check that the drawable is still flippable before completing
the delay exchange.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 1454df8caa sna/dri: Use draw ref directly
As we hook into the DestroyWindow notification, we can reliably use the
original Drawable reference and avoid the secondary object lookups.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 9abb6c09bd sna/dri: Remove dead code for 'old_fb'
The member still exists but is never set and is unused.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson ad877abdc7 sna/dri: Attach the chain of frame events to the Window, not pixmap
So that we can have multiple clients swapping in separate windows
concurrently.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 81cd9aa800 sna: Tweak start/stop of the deferred flush
As we now emit work whenever we wakeup and find the GPU idle, we rarely
actually have pending work in the deferred flush queue, so try to avoid
installing a timer if we are not accumulating work.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 6cb0c631e4 sna/dri: Clarify the message for one failure case
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 9a314d18ce sna/dri: Add a couple of missing VG_CLEAR on vblanks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 66a53c15cb sna/dri: Couple the frame events into DestroyWindow
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 975a566bed sna/dri: Replace the DRI2 drawable type with a devPrivate
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson 0da1c98f66 test: Add missing header for distcheck
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-08 21:34:21 +01:00
Chris Wilson e3e58123d3 sna: Fixup fb wrapper
To accommodate changes in the Xserver and avoid breakage; would have been
much easier had the fb been exported in the first place.
2012-07-08 21:34:21 +01:00
Chris Wilson 5d2f88fd99 sna: Add a couple of DBG flags to control upload buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-07 10:08:20 +01:00
Chris Wilson 18b3090381 sna: Fixup USE_INPLACE debug hint
After we enabled inplace readback, we can just apply the INPLACE hint to
all fallbacks, but instead apply it to the automatic testing for a
potential inplace operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-07 00:09:38 +01:00
Chris Wilson 24b59a8955 sna: Refactor a common function: is_clipped()
Had I done this earlier, I would not have the bug in the open-coded
version. Le sigh.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-06 14:16:36 +01:00
Chris Wilson 68b357454a sna: Clear garbage from the new front buffer when resizing
Avoid displaying a buffer filled with random junk when resizing (and
thereby creating a new) framebuffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-06 10:58:06 +01:00
Chris Wilson 5784e0f21d Allow matching against any device supported by drm/i915
However we cannot enable acceleration if we do not recognise its
hardware layout or instruction set.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-06 10:06:16 +01:00
Chris Wilson 1ee10cc3b2 Make the detection of broken pre-production hardware verbose
These SDV should have been returned to the manufacturer long ago and
replaced with real systems. So if they are still in use, add a gentle
reminder.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-06 09:22:39 +01:00
Chris Wilson cd2dd3016e sna: Fix clipping of glyphs-to-dst for partially obscurred windows
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-05 19:58:54 +01:00
Chris Wilson 0f086acb25 sna: Fallback to attaching a shadow fb if we fail to setup the crtc
As we've chosen to fix the kernel to handle CRTC offsets > 4096, drop
the automatic workaround. However, allow the user to force creation of
PerCrtcPixmaps for the purpose of debugging (and to workaround the bug
in older kernels) and to fallback to trying a shadow fb if the setcrtc
fails with the composite fb.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-05 12:52:51 +01:00
Chris Wilson 7e8060f837 sna: Do not force GPU allocation if CPU bo is already busy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-05 03:31:12 +01:00
Chris Wilson c32bb286dc sna: Make sure damage is flushed to the CPU bo before use
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-05 03:18:12 +01:00
Chris Wilson d46cc00b3c sna/dri: Assert that our pixmaps sizes are invariant
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-05 02:19:26 +01:00
Chris Wilson 3c1f58fe45 sna: drop an unused ret var
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04 23:03:44 +01:00
Chris Wilson a69a47f940 sna: Fix detection of EIO through throttle
When using drmIoctl, one needs to check the errno for the actual error
code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04 22:15:45 +01:00
Chris Wilson f2fdb0da83 sna: Use throttle() to confirm a GPU hang
This has two effects. The first is that we confirm that the EIO was
indeed a GPU hang and not some other form of I/O failure (for example
swapin). And the second is that it means we also print the warning to
look for an i915_error_state when we detect a GPU hang.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04 21:43:22 +01:00
Chris Wilson b8c2b34e39 sna: Simplify timer execution
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04 19:53:27 +01:00
Chris Wilson 844ab84c64 sna: Fix leak around ENOMEM error path in sna_copy_boxes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04 17:58:27 +01:00
Chris Wilson 54ee41bf05 sna: Pass a hint to the backends when using copy_boxes for readback
If we expect to only emit this set of copy_boxes() and then submit the
batch, we would prefer to use the BLT for its lower latency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04 17:40:58 +01:00
Chris Wilson d36623aaeb sna/dri: Remove broken code for buffer xchg from AsyncSwap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04 14:25:13 +01:00
Chris Wilson 0bdb4d0d36 sna/dri: Fixup blit fallback path to use xchg when possible
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04 13:23:43 +01:00
Chris Wilson aeeed323f9 sna/dri: Select the appropriate copy engine based on the current src ring
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04 11:52:27 +01:00
Chris Wilson 5026b6a147 uxa: Install the drm_wakeup_handler for vblank events in !use_page_flipping
Even if page-flipping itself is disabled, we still want to allow the
client to schedule wakeups for some future vblank which requires
listening to the kernel vblank notifications.

Reported-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51699
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04 09:55:10 +01:00