Commit Graph

3795 Commits

Author SHA1 Message Date
Chris Wilson 4d227d43f0 sna/accel: Correct syntax for constifying BoxPtr
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-02 12:26:07 +01:00
Chris Wilson 3dd8052416 sna/accel: Only throttle after flushing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-02 11:21:32 +01:00
Chris Wilson 04b8f0a5a1 sna/accel: Add a compile option to force flushing on every blockhandler
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-02 11:21:32 +01:00
Chris Wilson 32cef71efe sna/accel: Add an compile option to disable use of spans
Using spans has a tremendous effect (~100x) on x11perf, some good but
mostly bad. However, in reality operations are mixed and so preventing
migration on alternate opertaions is a win. In the x11perf slowdowns, it
appears to be CPU bound and so it seems like there should be plenty of
scope for recovering the lost performance.

However, for the time being, just go back to the old fallbacks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-02 11:21:32 +01:00
Chris Wilson dc1ec0dd1a sna/accel: Only disable the flush migitration if nothing changed
Previously we ignored updating the scanout in place, and so we were not
amoritizing the shadow cost of common core rendering operations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-01 20:39:09 +01:00
Chris Wilson c6acf13258 sna/accel: Micro-optimise sna_fill_spans_blt
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-01 20:39:09 +01:00
Chris Wilson 8029765515 sna/accel: Don't attempt converting to spans if we will only fallback
As the span code does not yet handle plane masks or stippling, it is
disadvantageous to convert to spans only to fallback.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-01 20:39:09 +01:00
Chris Wilson cd11bd69f4 sna/accel: Use miPolyArc to convert arcs into spans for gpu bo
This is actually tricker than it looks since miPolyArc() sometimes uses
an intermediate bitmap which performs worse than the fbPolyArc() fallback.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-01 20:39:08 +01:00
Chris Wilson d07256cc33 sna/accel: Convert segments into spans similarly to PolyLine
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-01 20:39:08 +01:00
Chris Wilson d09a229e32 sna/accel: Use the mi*Line routines to convert the line into spans for gpu bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-01 20:39:08 +01:00
Chris Wilson e7a662b92e sna: Sort partials by remaining space
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-01 20:39:08 +01:00
Chris Wilson 13b9b5d8d6 sna/io: Only mark the buffer as LAST if we know we will flush the IO
Otherwise we can continue to batch up the data upload into larger
buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-01 09:23:41 +01:00
Chris Wilson 7ecc6993b8 sna/gen6: Fix offset of Scan-Line-Compare register
Reported-by: Frank Mariak <fmariak@macrosystem.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 16:11:05 +01:00
Chris Wilson d8fe941bc2 sna: Check for request retires after every batch
In the beginning, I did perform a retire after ever batch. Then I
decided that it was too much CPU overhead for too little gain. On
reflection, i.e. further benchmarking, we do see a performance
improvement for recycling active buffers faster.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-28 23:03:00 +01:00
Chris Wilson e74a39b454 sna/gen7: Confusion reigns as trying to fix errors found by an outdated checker
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-28 15:05:33 +01:00
Chris Wilson 6395894ada sna/gen7: Fix up a couple instances of my inability to count
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-27 23:26:33 +01:00
Chris Wilson a53538659d sna/accel: Fix s/x/y/ typo in computing relative drawing coordinates
Reported-by:Roman Jarosz <kedgedev@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41165
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-25 12:40:01 +01:00
Chris Wilson 960688d168 sna/accel: Debug option to force CPU fallbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-25 12:23:10 +01:00
Chris Wilson 4fd46b8bb7 sna/glyphs: Add glyphs directly onto a client temporary buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-25 10:02:02 +01:00
Chris Wilson 5154e281ed sna/glyph: Avoid useless attempt at GPU glyph rendering to a1 destinations
The actual bug is a little involved as we don't damage the temporary
glyph mask correctly presuming that we only hit GPU paths. However,
should we fail to prepare the composite operation that paints the mask
on to the destination, things fail horribly.

One particular example is that wine like to create its own temporary a1
buffer for the glyphs (which we render to via another temporary mask...)
which triggers the delayed fallback and then sw compositing with a random
buffer.

Reported-by: Roman Jarosz <kedgedev@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41165
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-25 09:56:16 +01:00
Chris Wilson 46fedf0cf1 sna/kgem: Check all operation bo in a single amalgamation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-25 09:38:43 +01:00
Chris Wilson ccf6547a8f sna: Paranoid debug flush after every op (as well as before)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-24 23:16:57 +01:00
Chris Wilson 0233760034 sna/gen5: Debug option to disable state caching
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-24 23:16:43 +01:00
Chris Wilson af4d3853ae sna/glyphs: Convert all sub-8bpp masks to a8
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-24 19:47:41 +01:00
Chris Wilson c79e90da71 sna: Add a debug option to disable caching
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-24 19:47:41 +01:00
Kenneth Graunke 6bbb88af09 Fix incorrect maximum PS thread count on IvyBridge
I mistakenly set GEN7_PS_MAX_THREAD_SHIFT to 23; it's actually 24 on
Ivybridge.  Not only did this halve our thread count, it caused us to
write 1 into a bit 23, which is marked as MBZ (must be zero).
Furthermore, it made us write an even number into this field, which is
apparently not allowed.  Apparently we were just lucky it worked.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-24 09:28:45 +01:00
Chris Wilson 7f7f95abbf sna/accel: Use the PolyFillRect to handle tiled spans
Would be preferrable to duplicate the tiling logic. Leave the task of
reimplementing XAA to another day!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-23 11:49:43 +01:00
Chris Wilson 964c96b181 sna/accel: Always subtract the enlarged region from the outstanding GPU damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-23 11:49:43 +01:00
Chris Wilson c68856f346 sna/accel: Only skip undamaging the GPU for reads
Introduced with ac1b83240e (sna/accel: Simplify single pixel read-back)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-23 11:49:43 +01:00
Chris Wilson 5913c90967 sna/accel: fix assert to include the offset of copy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-22 17:13:15 +01:00
Chris Wilson 3185706802 sna: move an assert
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-22 17:13:15 +01:00
Chris Wilson 61764af13a sna/dri: Bump DRI2INFOREC_VERSION
An intervening dri2 patch landed in the sever.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-22 13:00:02 +01:00
Chris Wilson 12070b8eb1 sna/dri: Play with marking bo reusable
Since we have no recycling of wc pages in the kernel, we try hard to
recycle buffers in userspace to avoid GTT thrashing. This requires
co-operation between DRI clients and X, which is sadly lacking and so we
need to discard any buffer given out to a client after it is finished.
We cheat slightly for page-flips and access to the scanout.

A further compromise.

References: https://bugs.freedesktop.org/show_bug.cgi?id=38732
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-22 12:28:57 +01:00
Chris Wilson 902a023419 sna: Use pot buckets for active cache
On x11perf one of the major hotspots is the search through the active
list for an object large enough to reuse as the target surface. We can
eliminate that overhead by keeping those active objects in pre-sorted
lists by size.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-19 20:34:15 +01:00
Chris Wilson 7bb2c5c4d5 sna: Move an assertion to the point of import
All the guesswork is so that when we require an inactive bo, we do
actually get a buffer that is not currently on a GPU active list. For
some unresolved reason, this assertion was firing when putting the
buffer onto the inactive list - so just workaround the worrisome issue
by delaying the check until use.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-19 19:12:46 +01:00
Chris Wilson 686a5ec52c sna/trapezoids: Fix overflow during sorting of mono edge step
We were tracking the 32bit value of the prev_x using only a 16bit
variable, and so failing to sort the edges after advancing to the next
scanline.

Fixes cairo a1-clip-fill-rule.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-19 18:14:55 +01:00
Chris Wilson 0390105bc2 sna: compile fixes for debugging
Update the DBG messages to reflect changes in function parameters.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-19 12:49:27 +01:00
Paulo Zanoni 7f0cba3a25 Remove useless assertion
Removes 17 instances of:
warning: comparison of unsigned expression >= 0 is always true

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-18 09:47:55 +01:00
Paulo Zanoni 2d9effca14 Fix "always false" conditionals
Enums are unsigned by default in gcc and we can't rely on any specific
signedess for the other compilers.

i965_render.c: In function ‘i965_prepare_composite’:
i965_render.c:2018:2: warning: comparison of unsigned expression < 0 is always false
i965_render.c:2025:2: warning: comparison of unsigned expression < 0 is always false
i965_render.c:2050:3: warning: comparison of unsigned expression < 0 is always false
i965_render.c:2057:3: warning: comparison of unsigned expression < 0 is always false

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
[ickle: take advantage and rename the enum values]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-18 09:47:31 +01:00
Chris Wilson 7bcd1d2b75 sna: perform a warnings reduction pass
Didn't spot anything that might have led to a genuine bug, but this
should help improve the signal-to-noise ratio of warnings in the future.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-17 22:33:28 +01:00
Chris Wilson a5b5b4ebb1 sna: Apply the screen offset for direct upload of a composited pixmap
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38733
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-17 00:28:57 +01:00
Chris Wilson daeb9291e2 sna/trapezoids: Ensure we do not overrun the vertical edges for mono
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-17 00:27:55 +01:00
Chris Wilson 481df2618a sna: Add debug option to force allocaiton of gpu-only pixmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-17 00:27:32 +01:00
Chris Wilson 52f93c9546 sna/glyphs: Disable the glyph cache for debugging
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-16 23:24:16 +01:00
Chris Wilson c8a144d6f8 sna/glyphs: Correct offset of fallback-via-mask glyphs
Under a compositing manager where we have fun values for both
drawable->x/y and pixmap->screen.x/y, we were not drawing either the
glyphs into the mask correctly and then failed to composite the mask in
the right position on top of the pixmap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-16 23:06:43 +01:00
Chris Wilson 1eea2c4e60 sna: Can't free bo from the active list
As the active bo is still referenced in the request list, we can not
simply free it but need to wait for it to be purged on expiration.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-16 23:00:55 +01:00
Chris Wilson d743c456db sna: Debug option to disable tiling
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-16 20:34:33 +01:00
Chris Wilson 8c35df4493 sna: Remove bad assert
The caller intentionally violates this assert, so it is useless.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-16 20:33:57 +01:00
Chris Wilson 72ca1fdf2f configure: Introduce --with-builderstring
Julien Cristau disliked my broadcasting of the git tree used to build
his distribution package as it bore little relevance to his users. As it
is only useful for people installing their own drivers (as a means of
sanity checking that they are running the right driver), we introduce
the --with-builderstring idiom borrowed from the xserver. This allows
the builder to override the use of `git describe` and either leave it
blank or to fill it with something useful for their own purposes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-15 18:00:07 +01:00
Chris Wilson 544a4167c1 sna/trapezoids: Amalgamate adjacent mono spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-14 18:38:57 +01:00