Commit Graph

6335 Commits

Author SHA1 Message Date
Chris Wilson d70be85dc7 sna: Assert that we never try to mix INPLACE / ASYNC hints for move-to-cpu
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-15 22:24:09 +00:00
Chris Wilson 1287c3a24c sna: Specialise sna_get_image_blt for clears to avoid sync readback
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-15 22:24:08 +00:00
Chris Wilson da4972eec5 sna/trapezoids: Avoid the multiply for an opaque source
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-15 22:24:08 +00:00
Chris Wilson 7f968c8c99 sna: Add DBG to use_shm_bo()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-15 22:24:08 +00:00
Chris Wilson af63fab504 sna: Hint that a copy from a SHM bo will likely be the last in a batch
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-15 22:24:08 +00:00
Chris Wilson 1be4364092 sna: Pass the async hint for the upload into the GPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-15 22:24:08 +00:00
Chris Wilson 2113f7f440 sna: Free the SHM pixmaps after b266ae6f6f
Since b266ae6f6f protected the static allocations from being reaped in
the normal course of events, we need to penetrate those defenses in
order to finally free the SHM mappings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-15 09:33:03 +00:00
Chris Wilson 441c481630 sna: Mark uploads with async hints when appropriate
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-15 01:26:19 +00:00
Chris Wilson 6abd442279 sna: Avoid allocating an active CPU bo unnecessarily
If we will not write back the GPU damage to the bo as we intend to
overwrite it for the next operation, we can forgo allocating the active
CPU bo and skip the synchronisation overhead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-15 00:18:42 +00:00
Chris Wilson f235c74cd6 sna: Tweak considering of last-cpu placement for inplace regions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-14 17:02:48 +00:00
Chris Wilson 70c5e41b51 sna: Limit temporary userptr uploads to large busy targets or LLC machines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-14 17:02:42 +00:00
Chris Wilson cf860da1c7 sna: Apply PutImage optimisations to move-to-cpu
We can replace the custom heuristics for PutImage by applying them to
the common path, where hopefully they are equally valid.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-14 17:02:42 +00:00
Chris Wilson e4ad447781 sna: Use userptr to accelerate GetImage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-14 15:04:56 +00:00
Chris Wilson 3cc04a8e24 sna: Initialize src_bo to detect allocation failure
sna_accel.c: In function 'sna_put_image':
sna_accel.c:3730:18: warning: 'src_bo' may be used uninitialized in this
function [-Wmaybe-uninitialized]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-13 17:34:03 +00:00
Chris Wilson 3f04b0b98d sna: Check size against aperture before attempting to perform the GTT mapping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-13 17:33:28 +00:00
Chris Wilson 7a7db06c62 sna: Add a compile flag for measuring impact of userptr uploads
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-13 14:14:05 +00:00
Chris Wilson bcc212dc7a sna: Use the pixmap size (not drawable) to determine replacement
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-13 14:14:05 +00:00
Chris Wilson 32f43f618d sna: Allow large image uploads to utilize temporary mappings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-13 14:14:05 +00:00
Chris Wilson bf2b2e2f91 sna: Allow creation of a CPU map for pixmaps if needed
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-13 14:14:00 +00:00
Chris Wilson b266ae6f6f sna: Relax limitation on not mapping GPU bo with shadow pointers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-13 14:13:55 +00:00
Chris Wilson a2d8216143 sna: Correct a few assertions after enabling read-only mappings
As these do not flush the active state if we have read-read mappings, we
need to be careful with our asserts concerning the busy flag.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-13 10:17:33 +00:00
Chris Wilson ab01fd696e sna: Experiment with a CPU mapping for certain fallbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-12 17:04:54 +00:00
Chris Wilson 03d392cd1d sna: Tweak max object sizes to take account of aperture restrictions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-12 08:51:52 +00:00
Chris Wilson d111c464bf sna: After a size check, double check the batch before flushing
As we may fail the size check with an empty batch and a pair of large
bo, we need to check before submitting that batch in order to not run
afoul of our internal sanity checks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-12 08:18:04 +00:00
Chris Wilson ec77a07b41 sna/dri: Prefer to preserve the ring of the destination bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-11 15:59:37 +00:00
Chris Wilson 42f1026e11 sna: Reorder struct kgem_bo to move related data into the same cacheline
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-11 15:59:37 +00:00
Chris Wilson aead71051e sna: Disable memcpy_to_tiled_x() uploads on 32-bit systems
It's far too slow due to the register starved instruction set producing
attrocious code and the extra overhead in the kernel for managing memory
mappings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-11 15:59:37 +00:00
Chris Wilson 220970b1a4 sna: Also prefer to use the GPU for uploads into a tiled bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-11 15:59:33 +00:00
Chris Wilson 672e59851c sna: Prefer userptr if copying to a tiled bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-11 12:57:22 +00:00
Chris Wilson 441ef916ae intel: Throttle harder
Filling the rings is a very unpleasant user experience, so cap the
number of batches we allow to be inflight at any one time.

Interestingly, as also found with SNA, throttling can improve
performance by reducing RSS. However, typically throughput is improved
(at the expense of latency) by oversubscribing work to the GPU and a
10-20% slowdown is commonplace for cairo-traces. Notably, x11perf is
less affected and in particular application level benchmarks show no
change.

Note that this exposes another bug in libdrm-intel 2.4.40 on gen2/3.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-11 12:56:08 +00:00
Chris Wilson a37d56f338 sna: Use some surplus bits to back our temporary pixman_image_t
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-10 16:28:24 +00:00
Chris Wilson 09ea1f4402 sna: Prefer to use the GPU for copies from SHM onto tiled destinations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-10 16:26:24 +00:00
Chris Wilson c63147a3c3 sna: Allow CPU bo to copy to GPU bo if the device is idle.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-10 15:19:36 +00:00
Chris Wilson 2933e75958 sna: Ignore the last pixmap cpu setting if overwritting all damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-10 15:19:36 +00:00
Chris Wilson 934ea64f7f sna: With a GPU bo and a shm source, do not fall all the way back
The normal source upload into GPU bo knows a few more tricks that we may
want to apply first before copying into the shadow of the GPU bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-10 15:19:36 +00:00
Chris Wilson 8a8edfe407 sna: Make sure all outputs are disabled if no CompatOutput is defined
If we have to fallback and the configuration is wonky, make sure that
all known outputs are disabled as we takeover the console.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-10 03:34:04 +00:00
Chris Wilson 5449e16c0c sna: Open-code xf86CompatOutput() to avoid invalid pointers
config->compat_output needs to be sanitized during device initialization
or we may dereference an invalid xf86OutputPtr.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-10 02:52:57 +00:00
Mickaël THOMAS 8881a14200 Set initial value for backlight_active_level
If the "Backlight" option is set, backlight_active_level is not set which
results in a default value of 0, causing a black screen upon starting Xorg.
2013-01-07 20:26:03 +00:00
Chris Wilson b8c9598294 sna: fixup damage posting to be done correctly around slave pixmap
Copied from commit c789d06cf8
Author: Dave Airlie <airlied@redhat.com>
Date:   Mon Jan 7 13:57:21 2013 +1000

This fixes the damage posting to happen in the correct ordering,
not sure if this fixes anything, but it should make things more consistent.
2013-01-07 09:37:51 +00:00
Dave Airlie c789d06cf8 intel: fixup damage posting to be done correctly around slave pixmap
This fixes the damage posting to happen in the correct ordering,
not sure if this fixes anything, but it should make things more consistent.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-07 13:57:21 +10:00
Dave Airlie 5891c89ff2 intel: drop pointless error printf in the slave pixmap sync code.
This is left over and spams logs, get rid.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-07 13:54:47 +10:00
Chris Wilson 27550e8148 sna/dri: Transfer the DRI2 reference to the new TearFree pixmap
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58814
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-06 17:30:34 +00:00
Chris Wilson 1a5e4fb725 sna: Only disable upon a failed pageflip after at least one pipe flips
If we have yet to update a pipe for a pageflip, then the state remains
consistent and we can fallback to a blit without disabling any pipes. If
we fail after flipping a pipe, then unless we disable an output the
state becomes inconsistent (the pipes disagree on what the attached fb
is).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-06 17:08:56 +00:00
Chris Wilson dd66ba8e56 sna: Try to create userptr with the unsync'ed flag set first
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-06 16:58:34 +00:00
Chris Wilson 9051f43fa3 sna/gen4+: Handle solids passed to the general texcoord emitter
The general texcoord emitter does handle solids (for the case of a
transformed mask) and so we need to be careful to setup the
VERTEX_ELEMENTS accordingly.

Fixes regression from
commit 2559cfcc4c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jan 2 10:22:14 2013 +0000

    sna/gen4+: Specialise linear vertex emissio

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-06 15:20:14 +00:00
Chris Wilson 4af910e8be sna/gen4+: Trim the redundant float from the fill vertices
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-06 13:47:12 +00:00
Chris Wilson 3244e4b233 Revert "sna/gen4+: Backport tight vertex packing for simple renderblits"
This reverts commit 8ff76fad1f and
commit 48e4dc4bd4.

I forgot gen4 and gen5 do not have the 'non-normalized' bit in their
sampler states.
2013-01-06 13:30:37 +00:00
Chris Wilson d3be77f879 sna/trapezoids: filter out cancelling edges upon insertion to edge-list
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-05 18:08:40 +00:00
Chris Wilson 2b4a2f52c4 sna/trapezoids: filter out zero-length runs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-05 17:21:34 +00:00
Chris Wilson 59a7b8b32c sna: Clear up the caches after handling a request allocation failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-04 18:23:36 +00:00