Commit Graph

4854 Commits

Author SHA1 Message Date
Chris Wilson 33af42e628 sna: Force the creation of a backing pixmap for scanout
Ordinarily if the GPU is wedged, we just want to create a shadow buffer.
Except that we must ensure that we do allow a bo to be created for
attaching to the scanout.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 12:18:11 +00:00
Chris Wilson 6abfa4c566 sna: Mark the pixmap for writing when creating the screen resources
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 11:59:02 +00:00
Chris Wilson 5c5ebd6a3e intel: Fix typo s/asert/assert/
The joy of conditional compiles masked this compilation failure when
testing.

Reported-by: Reinhard Karcher <reinhard.karcher@gmx.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 11:18:01 +00:00
Chris Wilson f6474883d3 sna/gen2+: Use the reduced operator from CompositeRectangles
Do not attempt to further reduce the operator locally in each backend as
the reduction is already performed in the upper layer.

References: https://bugs.freedesktop.org/show_bug.cgi?id=42606
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 11:18:01 +00:00
Chris Wilson 2ae3cd36ae sna: Tidy marking pixmap->clear for CompositeRectangles
Reduce the two unsightly checks into one.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 11:18:01 +00:00
Chris Wilson 8b21659ef2 sna: Add some assertions around pixmap creation for render operations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 11:18:01 +00:00
Chris Wilson 7d74300647 sna: Discard unbound partial buffers
Instead of keeping a virgin partial buffer around on its inactive list,
just transfer it to the global bo cache (in actuality destroy it since
it is just a kmalloc with no pages bound).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 11:18:01 +00:00
Chris Wilson 9eb8ba4df2 sna: Preserve the offset alignment when trimming unused rows from partials
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 11:18:01 +00:00
Chris Wilson 8e6166a0e8 sna: Becareful not to reduce operators for superluminal colors
wine-1.4 is such an example of a crazy application.

References: https://bugs.freedesktop.org/show_bug.cgi?id=42606
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 09:04:37 +00:00
Chris Wilson 3f73cc706f sna/dri: Use a counter for the number of DRI drawables attached to a pixmap
The root pixmap, for instance, may have unique DRI2Drawables for each
inferior window. We only want to clear the flush flag on the last
release, so we need to keep a count of how many DRI drawables remain
attached rather than a solitary flag.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 08:58:12 +00:00
Chris Wilson 49a80ce1ff sna/gen2+: Prefer not to fallback if the source is busy
As if we try to perform the operation with outstanding operations on the
source pixmaps, we will stall waiting for them to complete.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 00:58:38 +00:00
Chris Wilson 4899740f6f sna: Do not reset partial buffers if they are not attached to the current batch
As we may be holding on to them as an active mapping whilst they are
executing; reseting the used counter back to zero in this case can cause
corruption.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 00:58:38 +00:00
Chris Wilson 72a7538d4e sna: Convolution filter fixes
A couple of typos made the convolution filter explode rather than
convolve.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-07 18:47:58 +00:00
Chris Wilson 34fe3cbb31 sna: Avoid recursive calls to kgem_retire_partials()
Whilst iterating the partial list and uploading the buffers, we need to
avoid trigger a recursive call into retire should we attempt to shrink a
buffer. Such a recursive call will modify the list beneath us so that we
chase a stale pointer and wreak havoc with memory corruption.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47061
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-07 18:25:44 +00:00
Chris Wilson 46c79e4d59 sna: Restore checking for all-clipped-out for CompositeRectangles
In the refactoring to avoid repeatedly applying the singular
pCompositeClip, the check for the all-clipped state was lost.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-07 13:17:21 +00:00
Chris Wilson 9944f1834a sna/gen2: Fix transformation of linear gradients
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-07 10:47:42 +00:00
Chris Wilson df25495eaa sna/gen4: Hook in the poor-man's linear gradient
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-07 10:46:04 +00:00
Chris Wilson 69d6a0387b sna/gen5: Hook in the poor-man's linear gradient
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-07 10:44:57 +00:00
Chris Wilson b0d3c4f661 sna/gen7: Hook in the poor-man's linear gradient
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-07 10:43:24 +00:00
Chris Wilson dcc364a7b1 sna/gen6: Add poor-man's linear implementation
Still no JIT, in the meantime we can at least cache the gradient ramps.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-07 10:40:50 +00:00
Chris Wilson 232972c0e5 sna: Remove the 2-step damage flush
The idea was to reduce the number of unnecessary flushes by checking for
outgoing damage (could be refined further by inspecting the reply/event
callback for a XDamageNotifyEvent). However, it does not flush
sufficiently for the compositors' liking. As it doesn't appear to restore
performance to near uncomposited levels anyway, remove the complication.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-06 12:25:55 +00:00
Chris Wilson eb10ade0fc sna: Defer the FlushCallback removal until after the next flush
Try to reduce the amount of Add/Delete ping-pong, in particular around
the recreation of the DRI2 attachment to the scanout after pageflipping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-05 23:08:25 +00:00
Chris Wilson 60dacdb127 sna: Only install the flush callback for the duration of the foriegn buffer
After we are no longer sharing the bo with foreign clients, we no longer
need to keep flushing before every X_Reply and so we can remove the
callbacks to remove the overhead of having to check every time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-05 22:48:49 +00:00
Chris Wilson b39d9f9166 sna: Check for flush at the start of every WriteToClient
The goal is to simply avoid the flush before going to sleep when we have
no pending events. That is we only want to flush when we know there will
be at least on X_Reply sent to a Client. (Preferably, it would a Damage
reply!) We can safe assume that every WriteToClient marks the beginning
of a new reply added to the Client output queue and thus know that upon
the next flush event we will emitting a Reply and so need to submit our
batches.

Second attempt to fix a438e4ac.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-05 22:29:38 +00:00
Chris Wilson f30b0beea4 sna/trapezoids: Ellide empty cells
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-05 21:53:08 +00:00
Chris Wilson b69c9dfae1 sna/composite: Skip clipping the rectangle region against the singular clip
As we will already have taken it into account when constructing the
region from the rectangles.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-05 21:47:14 +00:00
Chris Wilson f4846168a6 sna: Flush dirty CPU damage before notifying the compositor
Fixes regression from a438e4ac (sna: Revamp vmap support)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-05 21:35:52 +00:00
Chris Wilson d7600e4e77 sna: Add some assertions to partial buffer list tracking
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-04 19:14:24 +00:00
Chris Wilson 3b5d556a93 sna: Fix assertion for checking inactive shadow buffers
We may have an ordinary malloc with no CPU bo attached so check before
dereferencing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-04 15:48:33 +00:00
Chris Wilson aaed9e9722 sna: Encourage promotion of snooped CPU bo to real GPU bo
This fixes the regression in performance of fishietank on gen2. As
the texture atlas is too large to be tiled, one might presume that it
has the same performance characteristics as the snooped linear CPU
buffer. It does not. Therefore if we attempt to reuse a vmap bo, promote
it to a full GPU bo. This hopefully gains the benefit of avoiding the
copy for single shot sources, but still gives us the benefit of avoiding
the clflushes.

On the plus side, it does prove that gen2 handles snoopable memory from
both the blitter and the sampler!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-02 23:49:58 +00:00
Chris Wilson 599cd0e8ef sna: Align allocations with partial buffers to 64 bytes.
A magic number required for so many functions of the GPU. In this
particular case it is likely to be that the offset of a texture in the
GTT has to have a minimum alignment of 64 bytes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46415
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-02 20:18:32 +00:00
Chris Wilson 4918e309df sna: Silence an assertion failure during shutdown
Clear the scanout flag on the front buffer during teardown to silence
the debugger.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-02 18:18:48 +00:00
Chris Wilson f890fc25c6 sna: And fix compilation for last commit
I skipped a GCC warning about the implicit function declaration, which
of course results in a runtime silent death. Oops.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-02 18:11:56 +00:00
Chris Wilson 4f853acfec sna: Prevent backing pixmaps being created later
We used to allow the backing pixmap to be created later in order to
accommodate ShmPixmaps and ShmPutImage. However, they are now correctly
handled upfront if we choose to accelerate those paths, and so all
choice over whether to attach to a pixmap are made during creation and
are invariant.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-02 17:45:35 +00:00
Chris Wilson 866a61a259 sna: Disable vmap on 965gm
The sampler just dies if it encounters a snoopable page, for no apparent
reason. Whilst I encountered the bug on Crestline, disable it for the
rest of gen4 just to be safe.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-02 16:12:09 +00:00
Chris Wilson 1c65378689 sna: Pass usage hint for creating linear buffers
As we wish to immediate map the vertices buffers, it is beneficial to
search the linear cache for an existing mapping to reuse first.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-02 14:34:23 +00:00
Chris Wilson 29ec36ff06 sna: Only discard the inplace flag for LLC partial buffers
KGEM_BUFFER_WRITE_INPLACE is WRITE | INPLACE and so the typo prevented
uploading of partial data through the pwrite paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-02 10:01:07 +00:00
Chris Wilson f039ccf958 sna: Be careful not to discard the clear operation for move-region-to-cpu
When moving only a region to the CPU and we detect a pending clear, we
transform the operation into a move whole pixmap. In such situations, we
only have a partial damage area and so need to or in MOVE_READ to
prevent the pending clear of the whole pixmap from being discarded.

References: https://bugs.freedesktop.org/show_bug.cgi?id=46792
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-02 09:53:27 +00:00
Chris Wilson 392593e61d sna/gen5: Help the compiler avoid an uncached read
Debug builds are excruitatingly slow as the compiler doesn't store the
temporary in a register but uses an uncached readback instead. Maybe
this will help...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-01 21:19:22 +00:00
Chris Wilson 9c0c04cac2 sna: Split storage of inactive partials
As we now attempt to keep retain partial buffers after execution, we can
end up will lots of inactive buffers sitting on the partial buffer list.
In any one batch, we wish to minimise the number of buffers used, so
keep all the inactive buffers on a seperate list and only pull from them
as required.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-01 21:19:22 +00:00
Chris Wilson a438e4ac9b sna: Revamp vmap support
Dust off the kernel patches and update to reflect the changes made to
support LLC CPU bo, in particular to support the unsynchronized shadow
buffers.

However, due to the forced synchronisation required for strict client
coherency we prefer not to use the vmap for shared pixmaps unless we are
already busy (i.e. sync afterwards rather than before in the hope that
we can squash a few operations into one). Being able to block the reply
to the client until the request is actually complete and so avoid the
sync remains a dream.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-01 21:19:22 +00:00
Chris Wilson 272f5d9f84 sna: Discard use of inplace GTT uploads on LLC architectures
As the buffer is cache-coherent, we can read as well as write to any
partial buffer so the distinction is irrelevant.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-01 15:17:49 +00:00
Chris Wilson 43b1a717ba sna: Sort the partial buffers after stealing a write buffer
It will be decoupled and not used again, but this keeps the sanity
checks happy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 13:37:14 +00:00
Chris Wilson 8198e5872c sna/gen3: Tweak glyph rendering fast paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 10:51:49 +00:00
Chris Wilson 3c4f29820b uxa/gen3: Remove special casing of solid pictures
Fixes use of alpha-groups and opacity masks in cairo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 16:28:41 +00:00
Chris Wilson 8f3066f0c7 sna/gen2; Initialise channel.is-opaque for fills
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 15:32:09 +00:00
Chris Wilson 3640a0d4cb Revert "meh"
This reverts commit 4adb6967a8.

Oops, this debugging commit was not intended to be pushed along with the
bugfix. :(

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 12:29:15 +00:00
Chris Wilson 6fd8d74a6a sna: Upload the ordinary partial buffers!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 12:21:59 +00:00
Chris Wilson 4adb6967a8 meh 2012-02-27 11:36:35 +00:00
Chris Wilson 4fbb0baff5 sna: Avoid reusing mmapped partial write buffers for readback
An artefact of retaining the mmapped partial buffers is that it
magnified the effect of stealing those for readback, causing extra
writes on non-llc platforms.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 09:15:05 +00:00