Commit Graph

4344 Commits

Author SHA1 Message Date
Chris Wilson f9ee02be26 sna: Fix debug message for read-boxes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-28 22:52:44 +00:00
Chris Wilson 698bd43e0f sna: Do not create glyph caches if the gpu is wedged
As these will only be created in normal memory and never used.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-28 21:45:12 +00:00
Chris Wilson 78425a1559 sna: Refactor common code for testing gpu busyness of a pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-28 21:38:11 +00:00
Chris Wilson 9105b7e03a sna: Perform clip mask compositing inplace
Avoid the extra composite-in pass for simple clipmask construction.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-28 15:20:10 +00:00
Chris Wilson a5583165da uxa: Remove concept of global FB ownership made obsolete by GEM and KMS
With the introduction of GEM, we can continue to submit batch buffers
irrespective of ownership of the console, so do so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-28 13:57:09 +00:00
Chris Wilson 337635ab97 sna: Add some more debugging to find the source of a read-boxes error
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-28 10:56:57 +00:00
Chris Wilson 3bf81241cb sna: Skip zero-sized glyphs
Similar to the empty glyphs make sure that we just advance by the
character width without drawing anything.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-27 17:09:59 +00:00
Chris Wilson 8fc21328a0 sna: Don't discard empty glyphs, just skip them
A space is encoded as a 1x1 blank glyph, but we still need to advance by
its character width and so we cannot simply discard the glyph.

References: https://bugs.freedesktop.org/show_bug.cgi?id=44091id=44091
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-27 15:33:51 +00:00
Chris Wilson 726290ea2a sna: Rearrange damage for tail-call optimisations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-27 13:16:34 +00:00
Chris Wilson 04396b6e50 sna: Don't force the creation of a GPU bo if it will be untiled
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-27 09:58:40 +00:00
Chris Wilson 655a96cd5f sna: Mark the glyph cache as being unpageable
In order to prevent it falling foul of the inactive pixmap reaper, we
need to mark the pixmap as pinned.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-26 14:37:37 +00:00
Chris Wilson 2934e778f0 sna: Increase the minimum alignment constraint for g33
Still not getting the single-stream mode that I am aiming for!

Reported-by: Matti Hamalainen <ccr@tnsp.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44150
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-26 11:30:39 +00:00
Chris Wilson f7593a995a sna: Move the is-mappable check into the callers of region_inplace()
As they slightly differ in their requirements.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-25 11:20:40 +00:00
Chris Wilson aff32e3e08 sna: Tweak damage not to reduce if it will not affect the outcome of reducing to all
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-25 00:36:33 +00:00
Chris Wilson be21a09fef sna: Only call move-to-gpu on scanout flush if we have cpu damage to move
Reduce the number of redundant calls.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-25 00:28:55 +00:00
Chris Wilson 7b69dc8809 sna: Inline the common portion of sna_get_pixel_from_rgba()
The function overhead completely dominates for the common case.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-25 00:21:21 +00:00
Chris Wilson b117f65520 sna: Jump straight to the fallback copy routines if the dst is not attached
Marginally simplify the convoluted logic for choosing the most
appropriate path and help prevent further errors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 21:31:06 +00:00
Chris Wilson 72217790ee sna: Use shadow if the GPU is busy or not immediately mappable
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 21:31:06 +00:00
Chris Wilson 0be136c21f sna: use indirect uploads if the bo was last known to be unmappable
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 21:31:06 +00:00
Chris Wilson e764a52ee8 sna: Encourage large operations to be migrated to the GPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 21:31:06 +00:00
Chris Wilson f9f8535db6 sna: Fix damage reduction by adding new boxes to the tail of the box list
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 21:31:06 +00:00
Chris Wilson f8c91f229a sna: We can always compare the box to be subtracted against the dirty extents
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 12:17:53 +00:00
Chris Wilson cc21d3fa04 sna/damage: Fix the is-contained test
It was a non-overlapping test which is almost the reverse of what was
intended.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 12:14:33 +00:00
Chris Wilson b86e4f5929 sna: Check that the copy dst is attached before replacing damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 11:45:27 +00:00
Chris Wilson 3bcc9f08e1 sna: Create a GPU for a streaming write
If we are about to do a write-only drawing operation that will exceed
our cache, allocate a GPU bo and perform the operation inplace.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 10:08:06 +00:00
Chris Wilson efc8d04fc1 sna: Promote an unattached pixmap to the GPU for inplace copies
If we would prefer to perform the copy on the GPU and if the pixmap is
virgin, create a GPU bo for the operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 09:47:37 +00:00
Chris Wilson 8c0e7ff5ac sna: Clear the CPU damage for other overwriting rectangular blits as well
And make the accessing of the sna_pixmap safe -- it may not even exist!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 09:47:36 +00:00
Chris Wilson 7f9ed3ca56 sna: reset the pixmap on the initial clear after being swapped out
Pixmaps are swapped out into the CPU after a period of inactivity. This
then prevents the core rendering routines from migrating the pixmap back
to the GPU until it gets used again on a Render path. However, we can
clear that CPU damage and enable migration before a number of key steps
in the expose process.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 09:15:08 +00:00
Chris Wilson 8c987b6ccf sna: Cheaply reduce damage when subtracting and removing the entire damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 09:15:08 +00:00
Chris Wilson 098592ca5d sna: Remove the independent tracking of elts from boxes
Following the switch to a global mode for damage, the elts array became
redundant and all that is required is the list of boxes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 02:59:21 +00:00
Chris Wilson 73df0c7ab7 sna: Tune region upload inplace threshold
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 02:50:47 +00:00
Chris Wilson ef66c5b5ad sna: Search the inactive VMA cache first for a linear mapping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-24 01:09:56 +00:00
Chris Wilson 1cc07fa2d2 sna: Avoid forced creation of GPU bo for tiny operations and dirty pixmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-23 22:11:19 +00:00
Chris Wilson e5bfea5826 sna: Discard any GPU damage when overwriting with trapezoids
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-23 22:11:19 +00:00
Chris Wilson 819dc93e52 sna/glyphs: Create GPU bo for large enough destination surfaces with glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-23 22:11:19 +00:00
Chris Wilson 9580ae8490 sna: Pass usage-hint to move-to-gpu
When simply creating a source GPU bo it is preferrable not to mark it as
all-damaged.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-23 22:11:19 +00:00
Chris Wilson 98f15fc613 sna: Don't align pwrite to cachelines for doing discontiguous copies
The batch compaction breaks the 1:1 mapping between the cpu buffer and
the bo, so we can no longer safely align the transfer to whole
cachelines.

References: https://bugs.freedesktop.org/show_bug.cgi?id=44091
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-23 17:28:14 +00:00
Chris Wilson 3850f4ad48 sna: Silence unsigned comparison against 0
The good news is if this ever failed, the kernel is far too broken...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-23 12:42:02 +00:00
Chris Wilson d9ca113a83 sna: Trim the unused pages from the batch between the last command and surface
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-23 11:18:21 +00:00
Chris Wilson 013eda17e9 sna: Free the additional bindings on proxies 2011-12-23 10:41:22 +00:00
Chris Wilson 84d97bdba0 sna/gen2+: Reuse source channel for mask where possible
GTK+ has a clever trick for premultiplying its images by loading the
same pixel data into both the source and mask, and then performing the
composite. This causes us to upload the same pixel data twice!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-23 00:28:12 +00:00
Chris Wilson 281f620573 sna: Age active wholly damaged GPU buffers more slowly
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-22 23:36:33 +00:00
Chris Wilson f8575b8bd1 sna: Cancel the immediate batch submit once handled in the block handler
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-22 23:36:33 +00:00
Chris Wilson 609e1d9da2 sna: Bump the inactivity timeout
With the goal of removing inactive pixmap froms the GPU after 5 minutes
of idleness.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-22 15:54:39 +00:00
Chris Wilson 62602209e5 sna: discard damage-all even for width|height==0 operations
Even if we don't know the extents of the render operation, if the entire
pixmap is damaged we can still reduce the damage tracking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-22 15:52:37 +00:00
Chris Wilson f68a99a55e sna: Mark fresh GPU only bo as being all damaged
Presume that we will not fallback and so treat a GPU only bo (one that
is initially created on the GPU) as being all-damaged. This makes future
operations cheaper as the damage tracking overhead is much reduced, and
the cost of the first readback will mainly be in the synchronisation
overhead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-22 15:09:40 +00:00
Chris Wilson 1f2cd536bc sna: Reduce damage after complete solid fills
RenderFillRectangles is often used to initially clear a pixmap after
creation by flooding it with a solid colour, as is PolyRect. We can
reduce further damage operations by checking for this condition.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-22 14:34:43 +00:00
Chris Wilson 7a6a2c5d4c sna: Setup the pixmap correctly in order to attach our private
During creation of sna_pixmap we validate that we can use a GPU bo with
the target pixmap. This fails if we pass in a raw pixmap header, so
make sure the scratch pixmap is fully initialised first.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-22 14:13:00 +00:00
Chris Wilson f621b3de84 sna: flatten source alphamaps
Replace the source picture+alpha with a bo that contains the RGB
channels from source and A from the alpha map.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-22 14:11:39 +00:00
Chris Wilson 6c08eb4d6f sna/gen2+: Prefer to use the CPU if we have a source alphamap and CPU pictures
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-22 11:51:59 +00:00