Commit Graph

6209 Commits

Author SHA1 Message Date
Chris Wilson e474abea7c sna: Promote pinned-batches to run-time detection
Now that the feature has been committed upstream, we can rely on the
runtime detection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-17 15:38:04 +00:00
Chris Wilson 4d7e3a9123 uxa: Fix copy'n'paste of false not FALSE
Bugzilla; https://bugs.freedesktop.org/show_bug.cgi?id=58406
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-17 12:34:05 +00:00
Chris Wilson 7a4d1136bd sna/video: Pass along the video source offset
Fortunately nobody had yet noticed that all videos were assumed to play
with a matching src/dst origin.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-17 12:02:41 +00:00
Chris Wilson dfe9d18f9f sna: Limit the default upload buffer size to half the cpu cache
This seems to help with small slow caches.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-17 12:02:40 +00:00
Chris Wilson 5b0572503e sna: Enable support for opting out of the kernel CS workaround
Keeping a set of pinned batches in userspace is considerably faster as
we can avoid the blit overhead. However, combining the two approaches
yields even greater performance, as fast as without either w/a, and yet
stable.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-16 23:04:55 +00:00
Chris Wilson 805f78addf sna: Try to reuse pinned batches by inspecting the kernel busy status
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-16 22:13:21 +00:00
Chris Wilson f1aec67681 sna: Precompute the base set of batch-flags
This is to make it easier to extend in future.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-16 17:37:32 +00:00
Chris Wilson c7ac12003b sna: Only flush at the low fence wm if idle
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-16 15:28:45 +00:00
Chris Wilson 4580bbeac0 intel: Support debugging through AccelMethod
Ease debugging by allowing all acceleration or render acceleration to be
disabled through AccelMethod:

Option "AccelMethod" "off" -> disable all acceleration
Option "AccelMethod" "blt" -> disable render acceleration (only use BLT)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-16 15:22:58 +00:00
Chris Wilson 58770b7d64 man: Describe Option "AccelMethod"
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-16 15:22:58 +00:00
Chris Wilson 83609af368 sna: Tweak the idle SHM CopyArea path to also replace a busy GPU bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-16 10:53:26 +00:00
Chris Wilson 6490585f65 sna: Do not force use of the GPU for a copy from a SHM pixmap
As we will undoubtably flush and sync upon the SHM request very shortly
afterwards, we only want to use the GPU for the SHM upload iff it is
currently busy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-16 10:02:43 +00:00
Chris Wilson 3a08f09187 sna/gen6+: Tweak prefer-blt-bo
Split the decision between where it is imperative to use the BLT to
avoid TLB misses and the second case where it is merely preferential to
witch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-16 10:02:43 +00:00
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