Commit Graph

122 Commits

Author SHA1 Message Date
Chris Wilson 4e4e10935d sna: Flush upon change of target if GPU is idle
The aim is to improve GPU concurrency by keeping it busy. The possible
complication is that we incur more overhead due to small batches.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-08 22:42:11 +00:00
Chris Wilson 5d6dd9c5a7 Convert generation counter to octal
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-30 12:12:49 +00:00
Chris Wilson 1367e3f9ef sna: Exploit the alpha-fixup of the BLT for texture format conversions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-25 12:12:57 +00:00
Chris Wilson 94dd0b9ee9 sna/gen2: Fix use of uninitialised redirection
==29553== Invalid read of size 4
==29553==    at 0x4980E1B: _list_del (intel_list.h:218)
==29553==    by 0x4980EB3: list_del (intel_list.h:240)
==29553==    by 0x4981F53: free_list (sna_damage.c:403)
==29553==    by 0x4985139: __sna_damage_destroy (sna_damage.c:1467)
==29553==    by 0x49A527E: sna_render_composite_redirect_done (sna_render.c:1921)
==29553==    by 0x49C6904: gen2_render_composite_done (gen2_render.c:1136)
==29553==    by 0x497F917: sna_composite (sna_composite.c:567)
==29553==    by 0x8150C41: ??? (in /usr/bin/Xorg)
==29553==    by 0x8142F13: CompositePicture (in /usr/bin/Xorg)
==29553==    by 0x8145F58: ??? (in /usr/bin/Xorg)
==29553==    by 0x81436F2: ??? (in /usr/bin/Xorg)
==29553==    by 0x807965C: ??? (in /usr/bin/Xorg)
==29553==  Address 0x9407e188 is not stack'd, malloc'd or (recently) free'd

Reported-by: bonbons67@internet.lu
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56785
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-10 16:55:20 +00:00
Chris Wilson f5d79b202d sna/gen2: Add a modicum of fallback DBG
References: https://bugs.freedesktop.org/show_bug.cgi?id=56785
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-10 10:30:04 +00:00
Chris Wilson 72bcd8f85c sna: Try to reduce ping-pong migration for intermixed render/legacy code paths
References: https://bugs.freedesktop.org/show_bug.cgi?id=56591
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 09:30:18 +00:00
Chris Wilson 3ca7f8be5b sna/gen2: Count the number of dwords required for the invariant
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-07 22:39:10 +01:00
Chris Wilson 249051d90f sna/gen2: And the other compile failure
Typing on Sunday before coffee is a very bad idea.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-07 09:33:06 +01:00
Chris Wilson d2a26adc8e sna/gen2: Add a couple of assertions to track down a batch overflow
References: https://bugs.freedesktop.org/show_bug.cgi?id=55700
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-07 08:59:32 +01:00
Chris Wilson 3ad3a2d839 sna/gen2: Tidy DBG code for disabling composite operations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-04 15:14:08 +01:00
Chris Wilson 4608e48261 sna/gen2: Allow fine damage tracking for render operations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-04 11:23:36 +01:00
Chris Wilson 83b8669abc sna/gen2: Setup invariant blend arguments
I thought these were completely specified via the LOAD_STATE_IMMEDIATE
commands we used whilst seting up the render pipeline. I was wrong.

Reported-by: Timo Kamph <timo@kamph.org>
References: https://bugs.freedesktop.org/show_bug.cgi?id=55455
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-03 23:45:28 +01:00
Chris Wilson ba1dea5e37 sna/gen2: Clear STIPPLE setup before rendering with the 3D pipeline
One over-zealous removal too many.

Reported-by: Timo Kamph <timo@kamph.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55455
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-01 11:19:41 +01:00
Chris Wilson 3fbdedbf9d sna: Fix analysis of source extents for BLT composite
After we have computed the source offset vector for the transformed
source bo, we need to use that with respect to the destination rectangle
to verify that the source sample is wholly within bounds.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 22:10:08 +01:00
Chris Wilson c4d9940141 sna/gen2+: Add the missing assertions in case the drawrect is invalid
Only the later gen had these useful assertions, add them to the rest
just in case.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-01 10:44:50 +01:00
Chris Wilson f21079bad6 Revert "sna: Cleanup composite redirection after substituting the BLT"
This reverts commit 5a5212117e.

The clean up is in effect too early, as this is during preparation and
the actual work is already being correctly done at the end.
2012-08-27 11:26:58 +01:00
Chris Wilson 5a5212117e sna: Cleanup composite redirection after substituting the BLT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-26 13:38:23 +01:00
Chris Wilson 0e1e83ed49 sna: Allow the batch to be flushed if the GPU is idle upon a context switch
Submit early, submit often in order to keep the GPU busy. As always we
trade off CPU overhead versus concurrency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-24 09:46:26 +01:00
Chris Wilson 3ca1bfb51b sna: Trim a parameter from kgem_bo_mark_dirty() and add some assertions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-20 23:18:10 +01:00
Chris Wilson 01ebdb4d7a sna: Remove confusing is_cpu()
The only real user now has its own heuristics, so convert the remaining
users over to !is_gpu().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-20 16:06:13 +01:00
Chris Wilson 75a2fab766 sna: Avoid forcing an upload for an unblittable bo unless on a fallback path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-18 17:35:41 +01:00
Chris Wilson c9db2c74ab sna/gen2: Add break rather than fallthrough
The fall-through in this instance is irrelevant, and the static
analysers complain for not commenting on the fall-through. Silence the
analyser by removing the fall-through.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-16 20:42:50 +01:00
Chris Wilson 0c882f4fa9 sna/gen2,3: Prevent dereferencing a NULL bo with solid render fills
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-14 16:02:38 +01:00
Chris Wilson 6448801050 sna/gen2-5: Substitute an equivalent BLT composite operation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-11 11:12:33 +01:00
Chris Wilson a0d95a9c2d sna: Only update a buffer when it becomes dirty
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-21 00:01:59 +01:00
Chris Wilson e4fce3b780 sna/gen4: Hookup composite spans
Due to the unresolved flushing bug it is no faster (so only enable when
we definitely can't do the operation inplace), however it does eliminate
a chunk of CPU overhead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-19 11:01:52 +01:00
Chris Wilson ad4786b285 sna: Aim for consistency and use stdbool except for core X APIs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14 09:21:12 +01:00
Chris Wilson b11bc37684 sna: Simplify the DBG incarnation
It was only ever used in conjunction with HAS_DEBUG_FULL. For debug
purposes it is as easy to redefine DBG locally. By simplifying the DBG
macro we can create it consistently and so reduce the number of compiler
warnings.

Long term, this has to be dynamic. Sigh.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 11:41:17 +01:00
Chris Wilson 54ee41bf05 sna: Pass a hint to the backends when using copy_boxes for readback
If we expect to only emit this set of copy_boxes() and then submit the
batch, we would prefer to use the BLT for its lower latency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04 17:40:58 +01:00
Chris Wilson 41aff56a1f sna: Add tiling for spans
Semmingly only advisable when already committed to using the GPU. This
first pass is still a little naive as it makes no attempt to avoid empty
tiles, nor aims to be efficient.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 10:59:55 +01:00
Chris Wilson a26c05cc89 sna/gen2+: Tweak placement of operations for CPU-bound large pixmaps
Try to avoid uncessary migration to the GPU of large pixmaps that are
wholly bound to the CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-05 13:16:24 +01:00
Chris Wilson 15a00ba047 sna/gen2: Remove double 'const'
So constant, we const'ed it twice.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:09:52 +01:00
Chris Wilson 613902b60e sna: Fix off-by-one in checking available execbuffer slots
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-08 14:30:46 +01:00
Chris Wilson c5b6741d37 sna/gen2+: Fix typo for computing redirected extents for render copy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-06 12:51:23 +01:00
Chris Wilson 62f9833298 sna/gen2+: Approximate expensive gradients when using imprecise rendering
If we lack the ability to use a shader to compute the gradients
per-pixel, we need to use pixman to render a fallback texture. We can
reduce the size of this texture and upsample to reduce the cost with
hopefully imperceptible loss of quality.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-25 23:04:58 +01: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 49a80ce1ff sna/gen2+: Prefer not to fallback if the source is busy
As if we try to perform the operation with outstanding operations on the
source pixmaps, we will stall waiting for them to complete.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 00:58:38 +00:00
Chris Wilson 9944f1834a sna/gen2: Fix transformation of linear gradients
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-07 10:47:42 +00:00
Chris Wilson 8f3066f0c7 sna/gen2; Initialise channel.is-opaque for fills
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 15:32:09 +00:00
Chris Wilson 4d8369f8e6 sna/gen2+: Force upload rather than perform source transformations on the CPU
If both the source and destination is on the CPU, then the thinking was
it would be quicker to operate on those on the CPU rather than copy both
to the GPU and then perform the operation. This turns out to be a false
assumption if transformation is involved -- something to be reconsidered
if pixman should ever be improved.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-08 13:15:46 +00:00
Chris Wilson ea65887261 sna: Apply offsets correctly for partial src/dst in large copy boxes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-07 15:32:31 +00:00
Chris Wilson ec1ccb6bf6 sna: Set the damage for render->copy_boxes to NULL before use
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-07 13:37:52 +00:00
Chris Wilson 1467a4ba1a sna: Use the proper sna_picture_is_solid() test
Rather than the specialised routines that assumed pDrawable was
non-NULL, which was no longer true after f30be6f743.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-06 21:10:35 +00:00
Chris Wilson f30be6f743 sna/gen2+: Exclude solids from being classed as requiring an upload
We treat any pixmap that is not attached to either a CPU or GPU bo as
requiring the pixel data to be uploaded to the GPU before we can
composite. Normally this is true, except for the solid cache.

References: https://bugs.freedesktop.org/show_bug.cgi?id=45672
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-06 15:59:21 +00:00
Chris Wilson 93a0b10f16 sna: Apply redirection for the render copy into large pixmaps
If the pixmap is larger than the pipeline, but the operation extents fit
within the pipeline, we may be able to create a proxy target to
transform the operation into one that fits within the constraints of the
render pipeline.

This fixes the infinite recursion hit with partially displayed extremely
large images.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-04 15:19:05 +00:00
Chris Wilson ca252e5b51 sna: Detect batch overflow and fallback rather an risk an ENOSPC
Having noticed that eog was failing to perform a 8k x 8k copy with
compiz running on a 965gm, it was time the checks for batch overflow
were implemented.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-29 20:12:39 +00:00
Chris Wilson 5c6255ba2f sna: Determine whether to use a partial proxy based on the pitch
On gen4+ devices the maximum render pitch is much larger than is simply
required for the maximum coordinates. This makes it possible to use
proxy textures as a subimage into the oversized texture without having
to blit into a temporary copy for virtually every single bo we use.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-29 14:47:12 +00:00
Chris Wilson adb1320bba sna/gen2+: Include being unattached in the list of source fallbacks
If the source is not attached to a buffer (be it a GPU bo or a CPU bo),
a temporary upload buffer would be required and so it is not worth
forcing the target to the destination in that case (should the target
not be on the GPU already).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-26 16:05:48 +00:00
Chris Wilson 65164d90b7 sna/gen2+: Do not force use of GPU if the target is simply cleared
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-26 12:48:02 +00:00
Chris Wilson f0d8f5d377 sna/gen3: Set bo to NULL for render_fill_one
It had to happen, I missed one! From fc9531fc2d.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-20 14:37:33 +00:00