Commit Graph

3900 Commits

Author SHA1 Message Date
Chris Wilson f65e73f8a3 sna: Use fill->boxes to unroll FillSpans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-26 15:04:03 +01:00
Chris Wilson 94f9cd40dc sna: Use fill->boxes to unroll PolyPoint
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-26 15:03:32 +01:00
Chris Wilson 5e08ca75a5 sna: Use the new fill->boxes for PolyRectangle
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-26 15:01:10 +01:00
Chris Wilson efdc7985e2 self-copy-damage 2011-10-26 14:57:28 +01:00
Chris Wilson 0ed3426a81 sna: Convert diagonal zero-width lines into blits
This is slower than falling back to swrast for x11perf (up to 4x slower
on SNB), it is still faster than doing that rasterisation through a
WC-mapping and much faster in ordinary usage due to avoiding the
readback hit.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-26 10:37:31 +01:00
Chris Wilson c12371d9e7 sna: Flatten the branching for fill-spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-23 17:59:00 +01:00
Chris Wilson e7f19d85fe sna/blt: Upload the box using a single 64-bit instruction
So long as we have 64-bit instructions of course!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-23 17:59:00 +01:00
Chris Wilson 40af32a0e9 sna: Execute blits directly for PolyRectangle
By constructing the batch buffer directly for PolyRectangle, rather than
via miPolyRectangle->(PolyFillRectangle/PolyLine), we dramatically
reduce the CPU overhead and can saturate the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-23 17:58:55 +01:00
Chris Wilson a18f559961 sna: Fix debug compilation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 16:43:49 +01:00
Chris Wilson a3a075201c sna: Treat a bo marked as being last seen on the GPU as requiring a flush
We are hitting this path upon retiring the old scanout buffer following
a page-flip. We want to treat this as being hot and available for reuse,
so mark it as such until the next retirement pass.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 16:11:15 +01:00
Chris Wilson 999d13f321 sna: Fast path unclipped points
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 16:11:15 +01:00
Chris Wilson eb80013f4e sna: Fast path for unclipped rectangles
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 16:11:15 +01:00
Chris Wilson d6ae86a51c sna: Optimise reduce_damage() to handle all-damaged pixmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 16:11:15 +01:00
Chris Wilson 5b945b85ee sna: Fast-path unclipped fill spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 16:11:15 +01:00
Chris Wilson e9a193e980 sna: Short-circuit GetWindowPixmap() to speed-up pixmap retrieval
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 16:11:15 +01:00
Chris Wilson 662402e41e sna: Micro-optimise PolyLine blt
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 16:11:15 +01:00
Chris Wilson c2040fb8e6 sna: Remove the memset(0) of the fill op
The backends are all expected to initialise the state required.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-21 16:11:15 +01:00
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