Commit Graph

4897 Commits

Author SHA1 Message Date
Chris Wilson fba49e1bb8 sna/traps: Fix off-by-one for filling vertical segments in tor_inplace
If the last solid portion was exactly 4-pixels wide, we would miss
filling in the mask.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 10:31:51 +00:00
Chris Wilson 27f8f121b3 sna/damage: Handle a reduced damage rather than assert
As we may reduce a damage to empty along the migration paths and not
detect that reduced damage till later, handle those scenarios rather
asserting.

References: https://bugs.freedesktop.org/show_bug.cgi?42426
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 23:43:20 +00:00
Chris Wilson abd1046002 sna: Treat unmapped but CPU-mappable bo as available for mapping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 23:08:31 +00:00
Chris Wilson 2c492c0064 sna: Disable tiling for single row pixmaps (unless required for hw limits)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 23:06:17 +00:00
Chris Wilson 6890592cd2 sna/traps: Explicitly create an unattach pixmap for fallback
References: https://bugs.freedesktop.org/show_bug.cgi?id=42426
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 21:30:33 +00:00
Chris Wilson 23b5640a0f sna: Avoid using kgem_bo_reference() internally
So that we can keep the assertion to track the refcnt elsewhere.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 20:50:52 +00:00
Chris Wilson 03731b4e37 sna: Ellide no-op image glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 20:50:52 +00:00
Chris Wilson d0e05b4294 sna: Don't mark cached upload buffers for inactivity expiration
As these do not follow the normal rules of damage tracking, we have to
be careful not to force migration.

References: https://bugs.freedesktop.org/show_bug.cgi?id=42426
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 20:21:26 +00:00
Chris Wilson 96ead26c4d sna: Add a couple of asserts for inactive_partial reference counting
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 19:56:42 +00:00
Chris Wilson 6a4ac18e37 sna/traps: Use a more direct fallback path for the CPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 11:55:45 +00:00
Chris Wilson 8580677ee6 sna/traps: Rasterise using pixman inplace where appropriate
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 11:51:34 +00:00
Chris Wilson 8a303f195b sna: Remove existing damage before overwriting with a composite op
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 11:26:03 +00:00
Chris Wilson 63eeb98463 sna/gen3: Look harder to see if we can indeed use the BLT for composite
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 10:30:47 +00:00
Chris Wilson d23ee0380b sna: Reuse the cached upload as a source GPU bo
References: https://bugs.freedesktop.org/show_bug.cgi?id=42426
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-13 22:00:25 +00:00
Chris Wilson 0acec16853 sna: Defer the release of the upload buffer cache till retirement
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-13 22:00:05 +00:00
Chris Wilson 06b28d541b sna: Destroy the cached upload buffer if before copying into it
As we discard the buffer after the next batch, we will lose the contents
of the pixmap. Instead discard the cache, and treat it as a normal
shadow again.

References: https://bugs.freedesktop.org/show_bug.cgi?id=42426
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-13 20:01:53 +00:00
Chris Wilson 015db20287 sna: Refactor source upload-to-gpu
This was originally split between into functions for flexibility that
nothing used, so merge the duplicated code into a common function.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-13 17:45:05 +00:00
Chris Wilson 6dfe28f978 sna/gen6: Remove the double application of the render offset
Cut'n'paste error from an older generation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-13 17:45:05 +00:00
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