Commit Graph

3943 Commits

Author SHA1 Message Date
Chris Wilson bb840ee09f sna: Convert PolyRectangles to use Box32
For the same overflow protection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-30 16:13:04 +00:00
Chris Wilson af52e234a7 sna: Fix compilation
Remember to drink coffee and compile "obvious" fixes before pushing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-30 15:34:34 +00:00
Chris Wilson 23b314729c sna: Rewrite box32_add_rect() to enable int32_t promotion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-30 15:24:21 +00:00
Chris Wilson 427622aca3 sna: Push overflow detection to the end of extents
Removes a couple of conditionals from the middle of the hotpath and on
Intel we are not realising the benefit of only utilising 16-bit values.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-30 12:09:44 +00:00
Chris Wilson 2d3aba8518 Revert "sna: Don't flush the render caches if in the process of writing again"
This reverts commit 15266e1b95.

KDE relies upon the ability to render into a sampler and then render
upon itself. Not the first sign of madness...

Will have to find another way of winning back the compwinwin
performance.
2011-10-30 11:23:23 +00:00
Chris Wilson d406270517 sna/composite: Fix incorrect operator reduction for RenderFillRectangles
As exemplified by KDE (using Kate) on gen3, it would attempt to render a
large set of boxes using OVER and a transparent colour. As gen3 copied
across some of the BLT assumptions, it was incorrectly reducing that to
a CLEAR and thus rendering incorrectly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-30 10:45:26 +00:00
Jeremy Huddleston da3f865674 Use malloc/calloc/realloc/free directly
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-29 20:15:11 -07:00
Chris Wilson 17ba07a7be sna/gen3: Set the src flags for fill
A regression from c2040fb8e6 (sna: Remove
the memset(0) of the fill op) left the flags for the source channel
uninitalised leaving the shader construction undefined and causing
visual glitches.

Reported-by: Paul Neumann <paul104x@yahoo.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42367
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-29 20:10:28 +01:00
Chris Wilson 4835fe5b2e sna/genX: Improve reduction of Render operator to BLT alu
This appeared to introduce a visual gitch into the xfce4 selection box
on gen6 at least.

References: https://bugs.freedesktop.org/show_bug.cgi?id=42367
Reported-by: Paul Neumann <paul104x@yahoo.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-29 18:58:07 +01:00
Chris Wilson 33383fde55 sna: Tweak PolyRectangle blitting
A box of height/width 1 and lineWidth 0 can also be drawn with a single
box as the far edge is contiguous with far side of the near edge.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-29 13:42:54 +01:00
Chris Wilson 64a57c8dbe sna: Further clipping bugs
Make sure the line is clipped to the current clip box and discard if the
clip is reduced to nothing.

References: https://bugs.freedesktop.org/show_bug.cgi?id=42361
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-29 11:02:35 +01:00
Chris Wilson 719626ef79 sna: Increment clip box when short-circuiting the iteration
Reported-by: nkalkhof@web.de
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-29 10:34:10 +01:00
Chris Wilson 32a9e0352a sna: Retire and search inactive again before creating new buffer
Attempt to retire an active buffer into the inactive cache before giving
up and creating a new buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-29 10:33:31 +01:00
Chris Wilson 15266e1b95 sna: Don't flush the render caches if in the process of writing again
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-28 18:00:56 +01:00
Chris Wilson d3c7ee9211 sna: Faster unclipped rectilinear segments
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-28 16:44:16 +01:00
Chris Wilson 3cd909cfe9 sna: Call miZeroArcLine where appropriate for GPU paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-28 16:15:39 +01:00
Chris Wilson 9921c98df0 sna: Faster unclipped PolyFillRect
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-28 14:35:42 +01:00
Chris Wilson c1718f96f5 sna: Faster unclipped PolyPoint
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-28 14:35:42 +01:00
Chris Wilson a4762ed891 sna: Call directly into tiled rects for tiled spans.
As we already know the extents and that this is a candidate for
GPU-acceleration, we can skip over those steps and emit the tiled rects.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-28 13:39:43 +01:00
Chris Wilson a02069df2d sna: Faster unclipped spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-28 11:55:27 +01:00
Chris Wilson 48eff1676c sna/gen2: Reset BLT registers across 2D/3D context switches
It appears the hardware trashes the BLT registers after a 3D context
switch, so we need to reload.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 23:56:34 +01:00
Chris Wilson f006fac72a sna: Fast path typically unclipped tiled rects
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 21:50:25 +01:00
Chris Wilson d6f543011b sna: Use private identifier for internal scratch pixmaps
This was meant to be a part of the previous commit.

These are the scratch pixmaps for which we truly do want to allocate
GPU-only.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 20:16:35 +01:00
Chris Wilson 14a065a267 sna: Create scratch pixmap on the CPU
Contrary to earlier belief, the only usage of
CREATE_PIXMAP_USAGE_SCRATCH in the dix/mi are either along paths unused
by us or more importantly for operations which are detrimental to create
GPU-only buffers. So create CPU pixmaps instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 18:06:34 +01:00
Chris Wilson 5d52d50093 sna: Tweak zero line spans to include missing last segment
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 17:07:33 +01:00
Chris Wilson 72e0009635 sna: Fix advance through clip boxes for fill->boxes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 16:36:59 +01:00
Chris Wilson c7bd89fb54 sna: Fix PolyPoint not to always send 512 boxes
Just emit the remaining boxes!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 16:21:07 +01:00
Chris Wilson cfd5b7f6ce sna: Use fill->boxes to pack PolyFillRectangle
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 15:36:00 +01:00
Chris Wilson 8d304f47e3 sna: Use fill->boxes for rectilinear blits
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 15:00:09 +01:00
Chris Wilson 5d51ff0cf9 sna: Clip PolyLines to the current clip box
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 13:57:59 +01:00
Chris Wilson 990043f6b8 sna: Handle singular clip regions for PolyRectangles
Otherwise X will crash!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 12:42:50 +01:00
Chris Wilson 991582f667 sna/io: Update batch mode after submitting partial requests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 10:25:37 +01:00
Chris Wilson 91745de113 sna: Further improve use of fill->boxes for PolyRectangle
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 10:25:37 +01:00
Chris Wilson ffe1bdea82 sna/blt: After submitting the batch, it will be empty
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 10:25:37 +01:00
Chris Wilson b34e745457 sna/blt: Convert Copy with color 0 into a Clear
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 10:25:37 +01:00
Chris Wilson 389241aa64 sna: Suppress an overwritten fill
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 10:25:36 +01:00
Chris Wilson baf78fcddb sna/gen2: Cache the last solid colour for spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 10:25:36 +01:00
Chris Wilson ff4715a369 sna/composite: Discard opaque masks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 10:25:36 +01:00
Chris Wilson 0079579ebd sna: Fix debug compilation, again. 2011-10-27 10:25:36 +01:00
Chris Wilson 5988422455 sna: Handle degenerate copy area whilst wedged
We want to return early to avoid handing the empty box as the lower code
makes the assumption that it has work to do.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-27 10:25:33 +01:00
Chris Wilson 3fc7cd2dc8 sna/blt: Rename the composite paths
Whilst re-reading, I found the old naming scheme slightly muddled and
not nearly as descriptive as it should be. Hopefully this slight tweak
reads better in 6 months time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-26 16:40:28 +01:00
Chris Wilson 280325900b sna/blt: Share the common fill->boxes between blt and render paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-26 16:40:27 +01:00
Chris Wilson 56f65e6520 sna: Inline box_intersect()
Most of this branchy function is spent in manipulating the stack for the
function call, so inline it.

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