Commit Graph

3883 Commits

Author SHA1 Message Date
Chris Wilson 7e7759db4c sna: Pass a BoxRec to the fill op
For many of the core drawing routines, passing a BoxRec for the fill is
more convenient since they already have one generated by the clip
intersection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 15:34:28 +01:00
Chris Wilson 98bca2dbb9 sna: Check whether we can blt whilst determining the PolyLine extents
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 12:01:57 +01:00
Chris Wilson 91f4954975 sna: Speed-up blitting of unclipped lines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 12:01:57 +01:00
Chris Wilson 06d7574d7d sna/damage: Stash the last freed damage for quick reallocation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 12:01:57 +01:00
Chris Wilson 1471ef82b5 sna/damage: Only track the mode globally
As damage accumulation is handled modally, we do not need to track the
mode per elt and so attempt to simplify the code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 12:01:56 +01:00
Chris Wilson 1229bf6a69 sna: Actually apply the composite offset for the self-copy
I translated the region to copy by the composite pixmap offset, only
failed to use the translated region for the actual copy command (using
instead the original boxes). Fix that mistake by avoiding the temporary
region entirely and applying the translation inplace.

We also have to be careful in the case of copying between two composited
windows that have different offsets into the same screen pixmap.

This fixes the regression introduced with a3466c8b69 (sna/accel:
Implement a simpler path for CopyArea between the same pixmaps).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-20 17:58:55 +01:00
Chris Wilson 3526d83e46 sna/dri: Perform a little dance to restore the gpu status on release of the bo
As the bo is outside of our control whilst it is under the influence of
an external renderer, we try to maintain it on the gpu so as to avoid
unnecessary ping-pong. But once it is wholly back under our control, we
want to stop paying the penalty for sharing it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-20 11:15:01 +01:00
Chris Wilson 50b980f12e sna: Reuse any partial write buffer for readback
Take advantage of any available temporary buffer that we reuse for
readback knowing that it is the last operation in the batch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-19 21:09:01 +01:00
Chris Wilson 972989276d sna: Add some debug to discern the nature of the Cr fallback
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-19 20:41:14 +01:00
Chris Wilson fc224e2f8c sna: Clean up some debug messages for 64bit
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-19 20:20:55 +01:00
Chris Wilson f4346e5d25 sna/blt: Use SCANLINE_BLT for multiple fill boxes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-19 20:20:49 +01:00
Chris Wilson d7fb98efdc sna: The initial aperture check for a set of bo is unlikely to fail
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-19 19:36:08 +01:00
Chris Wilson 3c8e1c5c4c sna: Reset the ring flag upon idling
We track the last ring used when active so as to avoid stalling between
batches. Once the GPU has retired all the pending requests, we can use
whichever ring is preferrable for the next operation without any danger
of stalling upon submission.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-19 19:36:08 +01:00
Chris Wilson 594c5f86bb sna: Don't rewrite the solid colour cache if it hasn't changed
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-19 16:26:38 +01:00
Chris Wilson 5515f75647 sna: Enlarge the minimum pixmap size to migrate for Render
This is to workaround a ping-pong issue involving small icons. The
horrible sequence of operations appears to use a tiled FillRect to copy
from the scanout onto to a temporary pixmap, which causes us to
readback from the scanout. We are destined to hit the fallback path there
anyway until we implement stippling...

References: https://bugs.freedesktop.org/show_bug.cgi?id=41718
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-19 13:49:55 +01:00
Chris Wilson 87ba33bc0b sna/damage: Avoid reducing the damage for simple tests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-19 13:11:24 +01:00
Chris Wilson 63aa84ef57 sna/gen6: Apply the unknown blitter death workaround
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-19 13:11:24 +01:00
Chris Wilson 25f2d18194 sna: Compute region extents in place to eliminate redundant stack space
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-19 13:11:24 +01:00
Chris Wilson 1a43b2a46a sna: Use the unlikely wedged() throughout
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-19 13:11:24 +01:00
Chris Wilson 7a9c76e181 sna: Micro-optimise fill-spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-19 13:11:24 +01:00
Chris Wilson 0b83abfb2b sna/gen6: Don't modify composite arguments whilst checking for BLT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-18 14:43:37 +01:00
Chris Wilson ae7bd2bf70 sna/blt: Move the conditional out of the fill-many hotpath
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-18 13:35:10 +01:00
Chris Wilson 86f99379ee sna/gen4: Add fill-one
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-18 13:35:10 +01:00
Chris Wilson 26c082dbd3 sna/gen6: Precompute floats_per_rect
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-18 13:35:10 +01:00
Chris Wilson c69a7989b3 sna/gen5: Add fill-one implementation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-18 13:35:09 +01:00
Chris Wilson 26a1918290 sna/gen6: Try continuing with the BLT if the last batch was also BLT
In the vain hope of reducing switching between rings and introducing
stalls between batches.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-18 13:35:09 +01:00
Chris Wilson 4b1398f26d sna/gen6: Micro-optimise gen6_rectangle_begin
We can only emit state between primitives, ergo we need only check for
state updates if we've finished the vbo or are starting a new operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-18 10:29:33 +01:00
Chris Wilson b2d842df5e sna/gen2: Precompute floats-per-rect
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-18 10:29:33 +01:00
Chris Wilson 729f1ec786 sna/gen2: Prefer to use the BLT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-18 10:29:33 +01:00
Chris Wilson adef3a56cd sna/gen3: Prefer to use the BLT where possible for composite ops
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-18 10:29:33 +01:00
Chris Wilson f40e6ab50b sna/gen3: Prefer to use the BLT to clear the scratch glyph pixmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-18 10:29:33 +01:00
Chris Wilson 941e3504e0 sna: Some more debug output for request/bo retirement
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 21:25:17 +01:00
Chris Wilson 1d82fe3e52 sna: Only retire the flush handler if nothing was submitted within the period
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 21:25:16 +01:00
Chris Wilson 7758e33340 sna/gen3: Use immediates for black/white solid sources
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 21:25:16 +01:00
Chris Wilson 29ca1a3922 sna/gen3: More removal of memset(0)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 17:59:53 +01:00
Chris Wilson 88bc108788 sna/gen5: Rearrange the BLT->RENDER workaround
So that we can simply use the pending DRAWRECT as the non-pipelined
flush required following use of a BLT command.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 16:44:59 +01:00
Chris Wilson 18aed47ba3 sna: Fast path common colour conversions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 16:41:14 +01:00
Chris Wilson a3466c8b69 sna/accel: Implement a simpler path for CopyArea between the same pixmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 16:10:31 +01:00
Chris Wilson 8afa05191a sna: Improve debug output for mi/fb fallbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 16:08:17 +01:00
Chris Wilson 2b118658d5 sna/gen3: Remove memset(0) from fill_boxes
And initialise only the state used for the operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 16:08:17 +01:00
Chris Wilson f1bb4ebfd8 sna/damage: Clear damage->all when subtracting
I missed clearing the all-damaged flag on the subtract fast paths,
causing us to disregard further GPU damage and losing track of render
coherency.

Reported-by: Roman Jarosz <kedgedev@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41769
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 14:24:04 +01:00
Chris Wilson 46f97127c2 snb,ivb: Workaround unknown blitter death
The first workaround was a performance killing MI_FLUSH_DW after every
op. This workaround appears to be a stable compromise instead, only
requiring a redundant command after every BLT command with little
impact on throughput.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=27892
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39524
Tested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 13:09:17 +01:00
Chris Wilson 71bf291e56 sna/gen3: Micro-optimise gen3_rectangle_begin()
We only need to emit the vbo description either at the beginning of a
new op (when the state may have changed) or after finishing a full vbo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 12:53:19 +01:00
Chris Wilson a032feb253 sna/gen3: Store floats_per_rect alongside floats_per_vertex
Moves a multiply out of the hot path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 12:41:21 +01:00
Chris Wilson 2cbe79b85b sna/gen3: Improve reduction of render operator to blt
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 11:57:07 +01:00
Chris Wilson 606e18bd36 configure: Add a check for pixman version
As SNA requires a fairly recent release and calls directly into pixman.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 10:50:33 +01:00
Chris Wilson 17acaf8e23 sna: Defer CPU fallback if fb calls into mi
If the fb routine does not access the pixel data directly, but instead
calls into an mi routine, we can defer the readback and possibly avoid
it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17 00:58:02 +01:00
Chris Wilson c348b69f66 sna: Prefer to accelerate non-RENDER operations if already using the GPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-16 19:39:24 +01:00
Chris Wilson 6fdc9e3fd3 sna: Simplify busy tracking by trusting the bo->gpu flag
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-16 19:39:24 +01:00
Chris Wilson 30dff81cd6 sna/accel: Upload source to GPU for !copy CopyAreas
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-16 19:39:24 +01:00