Commit Graph

4879 Commits

Author SHA1 Message Date
Chris Wilson c751242e24 sna: Only use the cpu bo for xfer between CPU and GPU if either is busy
The synchronisation costs overwhelm any benefit from offloading the
copy, unless we are currently streaming the updates anyway.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-13 17:45:05 +00:00
Chris Wilson c9668a772f sna: Reduce OVER with a clear pixmap to a BLT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-13 17:45:05 +00:00
Chris Wilson 2ea58256f5 sna: Reuse the same upload buffer for the duration of the batch
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-13 17:45:05 +00:00
Chris Wilson 8b9abe2be1 sna: Prefer to render very thin trapezoids inplace
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-13 14:28:31 +00:00
Chris Wilson 1e2d6ee31a sna: Always reset the source counter after rendering to with the CPU
The goal is to avoid moving to the GPU too early for a frequently
modified CPU buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-12 20:34:42 +00:00
Chris Wilson 7bde1f55a1 sna: After move-to-gpu signals yes, force the GPU bo creation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-12 20:25:50 +00:00
Chris Wilson 2ee7de1f17 sna/trapezoids: Reduce mono ADD/OVER against a clear background to a SRC
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-12 20:09:05 +00:00
Chris Wilson 99c239e380 sna: Treat backing pixmaps no differently from their forward facing cousins
Another fix for the large buffers overhaul.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-12 19:54:55 +00:00
Chris Wilson 28792be1f3 sna/display: Only flush pending output when installing a new scanout
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-12 19:45:35 +00:00
Chris Wilson 278c329b9e sna/trapezoids: Further improve the clipping criteria for inplace traps
Not only must we defend against the span starting too far to the right,
we must also defend against the span terminating too far to the left.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-12 12:04:53 +00:00
Chris Wilson 7ae4558432 sna/trapezoids: Add paranoia to ensure that the span starts within the clip
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47226
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-12 10:49:46 +00:00
Chris Wilson 8136bc5e11 sna: Make the maximum BLT pitch assertions consistent
The maximum permissibly BLT pitch value is 32767, so make the assertions
match...

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47206
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-11 19:53:20 +00:00
Chris Wilson 9896154936 sna: Feed fallback mono trapezoids through the mono rasteriser
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-10 10:45:54 +00:00
Chris Wilson 552e4fbd2c sna/traps: Add a fast path for narrow masks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-09 21:31:52 +00:00
Chris Wilson 494edfaaac sna: Handle partial reads with a pending clear
Skip the filling of the whole pixmap if we have a small read and we
know the GPU bo is clear. Also choose to operate inplace on the GPU bo
if we meet the usual criteria.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-09 12:19:33 +00:00
Chris Wilson bd62dc73dc sna/traps: Apply somes simple but common operator reduction for clipmasks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-09 10:37:34 +00:00
Chris Wilson c25a3f7f46 sna/dri: Only delivered a delayed flip if the drawable is still on the root
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-09 09:43:46 +00:00
Chris Wilson 93846b468e sna/traps: Remove some dead code
This function was never used in this implementation, remove it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-09 09:43:24 +00:00
Chris Wilson 90c9957365 sna: Emit a INFO when compiled with debugging enabled
It is useful to know and to receive confirmation that you have
successfully compiled and executed the driver with debugging enabled.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-09 00:37:32 +00:00
Chris Wilson 2e194f33db sna/traps: Fix the initialisation of the error term for vertical mono edges
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 18:07:22 +00:00
Chris Wilson 635c604b78 sna/traps: Unroll insertion sort
As the compiler cannot know the loop is bounded by a sentinel, manually
unroll it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 18:06:51 +00:00
Chris Wilson a087430ad9 sna/gen6: Replace the memset with explict initialisation
The profiles told me to kill it...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 17:13:39 +00:00
Chris Wilson 61226cd41f sna: Fix handling of large glyphs following large and shared buffer work
Part of the large buffer handling was to move the decision making about
whether to create GPU bo for a pixmap to creation time. The single
instance where we change our minds later is involving large glyphs which
we choose not to cache.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 14:05:20 +00:00
Chris Wilson aa7a2bd712 sna: Fix reversed logic for CREATE_NO_RETIRE
If the flag is set, we cannot retire, not the other way around!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 12:27:23 +00:00
Chris Wilson f8d520950e sna: Avoid NULL deference in DBG
Only print out the details of the allocated CPU bo, if we actually
allocate it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 12:18:11 +00:00
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