Commit Graph

6196 Commits

Author SHA1 Message Date
Chris Wilson ac9ef1fc60 sna/gen6+: Keep the bo on its current ring
Track the most recent ring each bo is executed on, and prefer to keep it
on that ring for the next operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-16 10:02:43 +00:00
Chris Wilson 15ccb7148d sna/gen6+: Apply the is_scanout to the key not value in the binding cache
Oops, we never managed to reuse the cached location of the target
surface as we entered it into the cache with the wrong key.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-16 10:02:42 +00:00
Chris Wilson fde25b0892 sna/trapezoids: Add another inline hint
cell_list_alloc() is only called from one place, and the compiler should
already be inlining it - but does not appear to be. Hint harder.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-16 10:02:42 +00:00
Chris Wilson 2a21c8b351 sna: Include shm hint in render placement
The goal is to reduce the preference of rendering to a SHM pixmap - only
if it is already active, will we consider continuing to use it on the
GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-16 10:02:42 +00:00
Chris Wilson a467102a95 2.20.16 release
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-15 10:00:48 +00:00
Chris Wilson b0f8c823b6 sna/dri: Fallback to a blit after a failed flip
...rather than force the exchange.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-15 09:28:04 +00:00
Chris Wilson 2c71a8e08a sna/dri: Honour TripleBuffer Option
In case anyone ever wants to disable the default.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-15 09:27:07 +00:00
Chris Wilson 6593ad3fec sna/dri: Store and check size of front/back bo attached to a DRI2 drawable
So that we can prevent feeding back a stale bo when the DRI2 client
tries to swap an old buffer.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57212
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-14 23:48:00 +00:00
Chris Wilson 9df9585cb0 sna: Reduce fence watermarks
Further restrict the amount of fenced bo we try to fit into the batch to
make it easier for the kernel to accommodate the request.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-14 15:37:56 +00:00
Chris Wilson 0d3ba44e44 sna/gen2+: Experiment with not forcing migration to GPU after CPU rasterisation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-14 13:48:05 +00:00
Chris Wilson d867fd01cb sna/gen3: Don't combine primitives if beginning a ca 2-pass
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-14 13:19:04 +00:00
Chris Wilson 3ca503dac2 sna/gen3: Remove stray setting of vertex_start
It is always done at the beginning of vertex emission.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-14 13:19:04 +00:00
Chris Wilson 7f76f100e8 sna/gen2: Reorder reuse_source() to avoid NULL dereference for solids
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-13 23:12:42 +00:00
Chris Wilson 044a54c233 sna/gen2: Initialise channel->is_affine for solid
In case we hit a path were we avoid reusing the source for the mask and
leave is_affine unset for a solid mask.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-13 23:05:30 +00:00
Chris Wilson 29afd0dc8e sna/gen2: Assertions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-13 23:00:13 +00:00
Chris Wilson 4d2abe1e3d sna/gen3: Remove incorrect optimisation of an opaque source for CA
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-13 22:09:37 +00:00
Chris Wilson d428dbf7ad sna/gen2: Program solid mask using the DIFFUSE component
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-13 15:26:39 +00:00
Chris Wilson 9e7311516d sna/gen2: Align surface sizes to an even tile
Makes this 855gm much happier.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-13 15:26:39 +00:00
Chris Wilson e646047a56 sna: Fix up BLT overwrite detection to use target_handle
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-13 14:23:54 +00:00
Chris Wilson 4f96439e39 sna: Fix typo for 830/845 gen
Must remember, its octal not decimal.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-13 13:15:52 +00:00
Chris Wilson f631a56bcb sna: Only flush the batch after an actual relocation
As we may write preparatory instructions into the batch before checking
for a flush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-13 00:55:45 +00:00
Chris Wilson 74bbf20e6e sna: Improve the initialisation failure path for pinned batches
Simplify the later checks by always populating the lists with a single,
albeit unpinned, bo in the case we fail to create pinned batches.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-12 21:56:22 +00:00
Chris Wilson 52c8c9218c sna: Fix the error path in kgem_init_pinned_batches() to use the right iter
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-12 21:19:02 +00:00
Chris Wilson c7f7dd61fd sna: Pin some batches to avoid CS incoherence on 830/845
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=26345
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-12 20:49:46 +00:00
Chris Wilson b154d0dc40 sna/gen2: STIPPLE requires an argument
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-12 18:35:31 +00:00
Chris Wilson 9001263b32 sna/gen3+: Use nearest for unscaled videos
If the output is unscaled, then we do not require pixel interpolation
(and planar formats are exactly subsampled).

References: https://bugs.freedesktop.org/show_bug.cgi?id=58185
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-12 11:59:01 +00:00
Chris Wilson 2dbe7d91a7 sna/gen4: Use the single-threaded SF w/a for spans as well
Fixes the flickering seen in the fishtank demo, for example.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-12 09:50:34 +00:00
Chris Wilson 2502218a93 sna/dri: Fix handling of current_msc > target_msc
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-11 17:47:09 +00:00
Chris Wilson 39d6c65f43 sna/dri: Query current msc before use
Might be worth caching the last-known-value so we can skip the query for
an old swap request.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-11 15:30:54 +00:00
Chris Wilson 162e9a2bfc sna/dri: Disable name exchanges for SwapBuffers
The DRI2 protocol is inherently racy. Fortuituously, this can be swept
under the carpet by forcing the serialisation between the DRI2 clients
by using a blit for the SwapBuffers.

References: https://bugs.freedesktop.org/show_bug.cgi?id=58005
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-10 23:16:42 +00:00
Chris Wilson 0c2287c735 sna/dri: Only special case 'divisor && msc-passed' for immediate flipping
As Jesse pointed out, it is legal for the client to request that the
flip be some frame in the future even with no divisor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-10 23:07:38 +00:00
Jesse Barnes 2ab29a1688 dri2: don't schedule a flip prematurely at ScheduleSwap time
If divisor is 0 but the current MSC is behind the target, we shouldn't
schedule a flip (which will occur at the next vblank) or we'll end up
displaying it early and returning the wrong timestamp.

Preserve the optimization though by allowing us to schedule a flip if
both the divisor is 0 and the current MSC is equal to or ahead of the
target; this avoids a round trip through the kernel.

Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2012-12-10 14:55:32 -08:00
Chris Wilson 986e13a56a sna: Try installing a fallback config on VT enter in case full desiredMode fails
This can happen naturally for 3-pipe config on Ivybridge or if the
outputs are rearranged whilst we slept. Instead of failing to change the
display on the VT, install at least a fb on the CompatOutput so that
hopefully the DE can take over, or give some control to the user.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-10 20:04:25 +00:00
Chris Wilson 8c3b82f207 sna: Avoid reusing the same 'busy' bit for two different meanings.
Oops, I thought the 'busy' bit was now used and apparently forgot it is
used to control the periodic flushing...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-10 16:20:52 +00:00
Chris Wilson d1b479a340 sna: Compromise and only flush a split batch if writing to scanout
A compromise between not flushing quick enough and flushing too often,
hopefully.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-10 11:16:04 +00:00
Chris Wilson 3e9120d73c sna: Immediately flush a split batch
If we submit a batch early (for example if the GPU is idle), then submit
whatever else the client drew immediately upon completion of its
blockhandler. This is required to prevent flashing due to visible delay
between the clear at the start of the cycle and then the overdraw later.

References: https://bugs.freedesktop.org/show_bug.cgi?id=51718
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-10 11:05:16 +00:00
Chris Wilson aa8c5d8201 sna/sprite: Add a DBG to report whether the kernel supports sprites
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-09 12:44:23 +00:00
Chris Wilson 25c0d440de sna: Move source to CPU prior to referencing for inplace trapezoids
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56825
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-09 12:41:41 +00:00
Chris Wilson 3e82fcc8d2 sna/gen4+: Refine test for preferring GPU spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-09 12:37:43 +00:00
Chris Wilson c8f622726a sna: Replace remaining kgem_is_idle() with kgem_ring_is_idle()
Further experimentation...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-09 10:33:32 +00:00
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 cef11795f6 sna: Convert the ring from BLT/3D to the internal index for kgem_ring_is_idle()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-07 17:40:37 +00:00
Chris Wilson 52405b2aed sna: Only inspect the target ring for busyness
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-07 17:24:42 +00:00
Chris Wilson 4b7bbb2a23 sna: Only flush before adding fresh surfaces to the batch
Previously, before every operation we would look to see if the GPU was
idle and we were running under a DRI compositor. If the GPU was idle, we
would flush the batch in the hope that we reduce the cost of the context
switch and copy from the compositor (by completing the work earlier).
However, we would complete the work far too earlier and as a result
would need to flush the batch before every single operation resulting in
extra overhead and reduced performance. For example, the gtkperf
circles benchmark under gnome-shell/compiz would be 2x slower on
Ivybridge.

Reported-by: Michael Larabel <michael@phoronix.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-07 16:43:32 +00:00
Chris Wilson 65a8c23ca1 sna: Only flush at the low apeture watermark if idle
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-07 14:56:18 +00:00
Chris Wilson 4bfc5e90f5 sna: Mark proxies as dirty on first relocation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-07 11:39:14 +00:00
Chris Wilson 1d2fa5731b Remove the default log message
Breaks compilation with xorg-1.13

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-06 22:15:09 +00:00
Chris Wilson 7f4d4afa62 Fix compilation of UMS probe following 13f47008ec
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-06 17:08:15 +00:00
Chris Wilson d733f7d1f1 sna/gen4+: Add common glyph-to-dst emitters
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-06 16:55:00 +00:00
Chris Wilson 13f47008ec Refactor the common probe methods for scrn construction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-06 14:56:10 +00:00