Commit Graph

5455 Commits

Author SHA1 Message Date
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
Chris Wilson 79309dd55f sna: check for failure to change cache level on the bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 22:27:39 +01:00
Chris Wilson 9e2ac8a413 sna: Use set-cache-level ioctl to create CPU bo
As an alternative to vmap, we can use the kernel for all memory
management through bo, which is much preferred for its simplicity (i.e.
avoiding introducing even more vm complexity).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 20:08:02 +01:00
Chris Wilson f26163e916 sna: Guess when the client is attempting to read back the whole pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 18:51:46 +01:00
Chris Wilson c597e6cd4c sna: Fix iterator typo
Increment the iterator, not the end-stop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 13:26:33 +01:00
Chris Wilson 2d087eadd9 sna: Also prefer to use the dst GPU bo if CopyArea reduces to an inplace upload
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 12:02:45 +01:00
Chris Wilson dbe3a5ca1e sna: Attempt to reduce all-damage on the CPU
As we now treat CPU all-damaged as a special case for deciding when and
where to migrate, look out for that condition after adding damage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 11:48:15 +01:00
Chris Wilson 3a41248195 sna: Operate on the original boxes for CopyArea
Be consistent and avoid the confusion when mixing operations on the
region boxes and the original boxes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 11:26:52 +01:00
Chris Wilson e3bc91842b sna: Allow booting on older kernels by disabling HW acceleration
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 10:23:31 +01:00
Chris Wilson affdebcb2d sna: And free the DIR after use
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-02 18:50:26 +01:00