Commit Graph

8908 Commits

Author SHA1 Message Date
Chris Wilson de61dae3bb sna: Implement missing 9^10^11 swizzle mode
As found on my gm45...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-03 11:11:09 +01:00
Chris Wilson 8d85793b08 configure: Replace hardcoded pkg-config --exists with PKG_CHECK_EXISTS
Suggested by Emil Velikov:

	Normally hard coding pkg-config is considered a bad idea. Please
 	try PKG_CHECK_EXISTS - it would work like a charm when
	cross-compiling.

	Cheers
	Emil

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-03 00:01:31 +01:00
Chris Wilson 459efa036e test/dri2: Reset swap-interval after testing async swapping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-02 22:50:54 +01:00
Chris Wilson 3c3f7d7df4 test/dri2: Check vblank waits
Make sure that waiting 60 times for a vblank, 60 msc pass

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-02 22:50:19 +01:00
Chris Wilson ef8f5236f2 sna/dri2: Fix multimonitor swap elision
We were not updating the window->crtc for the immediate swaps with the
result that after switching CRTCs, we were requesting a vblank on the
wrong pipe and triggering an error path (forcing the blit and negating
the elision).

Testcase: test/dri2-speed
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-02 17:19:32 +01:00
Chris Wilson 0814dc41c3 test/present-speed: Include a measure for fence signalling overhead
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-02 15:13:43 +01:00
Chris Wilson f63f739fec sna: Do not call an extra busy ioctl for scanout flushs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-02 08:55:19 +01:00
Chris Wilson e47eb0c5e5 sna: Don't unroll BLT points
The compiler is smarter than I am; unrolling hurts here.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-01 23:13:29 +01:00
Chris Wilson 7df58456b8 sna: Add DBG option to disable manual detiling
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-01 23:13:29 +01:00
Chris Wilson b56b63bf93 sna: Relax a y-tiling fb assertion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-01 23:13:29 +01:00
Chris Wilson f00599f971 sna/dri: Avoid using the BLT for DRI2CopyRegion if no semaphores
We expect mesa nowadays to preferentially use the render pipeline for
doing its clears and so want to avoid handing it back an active BLT bo
if we don't have semaphores (as that would cause a sync).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-01 23:13:29 +01:00
Chris Wilson 61d2baa430 configure: Make tools/PROGRAMS agnostic to tools presence
In order to make tools indivdiually selectable for compiling, we don't
want to override earlier tools - so use '+=' rather than a plain '='
when adding each tool to the set of PROGRAMS.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-01 15:55:11 +01:00
Chris Wilson cdac2b369a sna: Relax unclean rules to check busyness on all foreign pixmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-01 15:55:11 +01:00
Chris Wilson 35537ec4bf sna/present: flush is not required
present.flush is called on the Window after a copy from a Pixmap is
completed - which will be naturally flushed anyway. What the API should
be passing is the Pixmap, since we do want to flush the operations from
it before sending the idle event. C'est la vie.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-01 15:55:11 +01:00
Chris Wilson 2f047c6278 tools/dri3info: Query refresh rate on Primary monitor
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-01 12:55:44 +01:00
Chris Wilson 745c21fb1a sna: Fixup inverted logic for new bo
We only want to inspect the busy status of bo we have not yet added to
our execbuffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-01 00:34:00 +01:00
Chris Wilson 61f8dcdfa5 sna: Consider idleness of both rings if we need a semaphore
When emitting batches early for improved GPU/CPU concurrency, we only
want to do so if the target ring is not busy. However, if the batch
requires a semaphore, we also need to consider the other ring as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-31 23:09:43 +01:00
Chris Wilson 56f9d2c1d9 sna: Flush BLT operations to an idle GPU
We improve dispatch latency if after creating a command buffer we
immediately submit if the GPU is idle. This improves concurrency as we
continue to build the next command buffer as the GPU executes and helps
prevent needlessly using one engine for too long (i.e. sometimes we may
be able to execute the work much early and do the ring switch cheaply).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-31 23:09:43 +01:00
Chris Wilson 68632e1000 sna: Use more explicit retire-requests after syncing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-31 23:09:43 +01:00
Chris Wilson 8b358076f2 sna: Query the engine residency on foreign bo before use
Since knowing which ring the bo is currently active on is important when
considering the impact of semaphores on the next operation, be sure to
query it on foreign bo before we use them.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-31 23:09:38 +01:00
Chris Wilson ef24cb1b22 sna/gen6+: Prefer the BLT for small copies
Even on GT3, it is preferrential to use the blitter if the copy is small
(due to the latency in execution).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-31 22:44:21 +01:00
Chris Wilson 5a872056de sna/gen6+: Prefer the BLT for small self-copies
Even on GT3, it is preferrential to use the blitter if the copy is small
(due to the latency in execution).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-31 22:32:25 +01:00
Chris Wilson 1be5b71582 Add TILE property support (for MST tiled monitors)
Based on the patch for modesetting (and lots of work) by Dave Airlie

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-31 22:31:06 +01:00
Chris Wilson 8dc716e866 sna: Limit the last gasp execbuf try to ENOSPC
Disabling the outputs and trying again can only possibly help in the
case of fragmentation. In all other failures modes (typically GPU hang)
it just causes a slow flash of the display.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-29 13:17:34 +01:00
Chris Wilson c05c6abd08 sna: Mask the batch length
It's white lie that only is technically required for gen2, and works
around a massive performance hit on gen7.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-28 23:59:56 +00:00
Chris Wilson dbdcae9f8a sna: Refresh properties even if we skip the detection probe
Properties may refresh quickly, more often than the output status
changes. We want to query the properties without doing a forced probe,
so make sure we refresh the values if the user requests a property.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-25 20:44:01 +00:00
Chris Wilson 8f11f2bdcd Use AC_FUNC_ALLOC
The preferred all-inclusive method for finding alloca().

Reported-by: Richard Palo <richard@netbsd.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89762
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-25 14:20:43 +00:00
Chris Wilson aa40f99014 Use AC_HEADER_MAJOR to find how to include major()
We need to include <sys/mkdev.h> on Solaris.

Reported-by: Richard Palo <richard@netbsd.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89763
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-25 14:14:30 +00:00
Chris Wilson d85e68e2d3 sna: Add include <alloca.h> for compiling on Solaris
Reported-by: Richard Palo <richard@netbsd.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89762
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-25 13:16:56 +00:00
Chris Wilson d377fd3d11 sna: Detect Y-tiled scanout feature
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-24 21:05:58 +00:00
Chris Wilson 019402f8ca test: Test tiling across DRI3/Present
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-24 17:27:15 +00:00
Chris Wilson 44452825fb sna: Remove bogus assert(output->randr_output)
During shutdown, we may get backlight uevents after removing the
randr_output.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-20 14:40:09 +00:00
Chris Wilson 9e39bea9d3 tests: Add basic present benchmark
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-20 14:40:09 +00:00
Chris Wilson 7fe2b29486 sna: Protect against ABI breakage in recent versions of libdrm
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-19 23:14:17 +00:00
Chris Wilson bacaf7f18c sna: Use struct pixman_f_vector for compatibility with older pixman
Or else face compile failures:

blt.c: In function 'affine_blt':
blt.c:1403:3: error: unknown type name 'pixman_f_vector_t'
blt.c:1407:4: error: request for member 'v' in something not a structure or union
blt.c:1408:4: error: request for member 'v' in something not a structure or union
blt.c:1409:4: error: request for member 'v' in something not a structure or union
blt.c:1411:3: warning: passing argument 2 of 'pixman_f_transform_point_3d' from incompatible pointer type [enabled by default]
In file included from /usr/include/xorg/miscstruct.h:52:0,
                 from /usr/include/xorg/regionstr.h:52,
                 from /usr/include/xorg/region.h:50,
                 from /usr/include/xorg/window.h:51,
                 from /usr/include/xorg/input.h:55,
                 from /usr/include/xorg/xf86str.h:38,
                 from sna.h:43,
                 from blt.c:32:
/usr/include/pixman-1/pixman.h:247:15: note: expected 'struct pixman_f_vector *' but argument is of type 'int *'
blt.c:1413:7: error: request for member 'v' in something not a structure or union
blt.c:1415:7: error: request for member 'v' in something not a structure or union

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-17 09:48:43 +00:00
Chris Wilson 9d0d78230a sna: Skip inplace operation to a busy clear GPU bo
Since clearing is a relatively trivial operation, allow us to do the
clear to a CPU bo rather than block on the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-14 09:15:41 +00:00
Chris Wilson d8dd2b88a1 sna/gen6+: Demote BLT ring switching priority if semaphores are disabled
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-14 09:15:41 +00:00
Chris Wilson 66cb6c23d1 sna: Start demoting some assertions
A few assertions are there to catch less desirable behaviour rather than
outright errors. For these, just grab the backtrace and continue.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-13 15:53:19 +00:00
Chris Wilson 7863efebf5 sna/gen6+: Relax assertions in light of !semaphores
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-13 15:36:57 +00:00
Chris Wilson 359f12312e sna: Fix assertions for transformed cursors
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-13 15:36:57 +00:00
Chris Wilson c2381ac065 sna: Remove redundant RRGetInfo on hotplug discovery
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-13 15:36:57 +00:00
Chris Wilson 2f1fb20d89 sna: Explicitly compute whether the transform is affine for HW cursors
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-13 13:16:08 +00:00
Chris Wilson bc84ba6f97 sna: Fix computation of transformed cursor size
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-13 12:12:21 +00:00
Chris Wilson 557ffa3bac sna: Cross check that we only have an affine transformation for HW cursors
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-13 12:10:00 +00:00
Chris Wilson d867d48bb6 sna: Apply affine transformations to HW cursors
Until now we only applied pixel-exact rotations to the cursors. However,
this left the cursors ignoring scaling and so appearing incorrect on
outputs with transformations applied. An extra complications comes from
making sure that the scaling routine is signal safe.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-13 11:33:38 +00:00
Chris Wilson 56ebdb7d95 sna: Disable hw cursor when random transforms are applied
Ideally, we would iterate over each CRTC and check that the transformed
cursor is still valid for the HW plane and then remember to transform
the cursor before displaying. Disabling the HW cursor if a non-native
transform is the first step in correcting the display of said cursor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-12 14:27:59 +00:00
Chris Wilson 341654dc27 sna: Compute half resolution modes
Sitting here with a 3200x1600 panel but no 1600x900 intermediate mode,
and I am too lazy to add it by hand.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-12 13:50:39 +00:00
Chris Wilson 71318389be sna: Futureproof acceleration backend selection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-12 12:39:55 +00:00
Chris Wilson 15c307d70e sna: Force frontbuffer to CPU for randr fallback
When we are using the fallback method, we need to make sure the source
is on the CPU.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89053
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-10 08:56:08 +00:00
Chris Wilson 535b030c02 sna: Strengthen assertions that batches are idle before overwriting
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-09 16:33:06 +00:00