Commit Graph

8890 Commits

Author SHA1 Message Date
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
Chris Wilson f7c4bc7c5f sna/gen6+: Demote priority of COPY_LAST for copy boxes
Even if we expect to flush at the end of the operation, we still want to
consider semaphores before overriding the engine selection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-07 21:18:45 +00:00
Chris Wilson aefedd2baf sna/gen6+: Prefer the BLT for small copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-07 10:58:53 +00:00
Chris Wilson 8e8eac5097 tools/cursor: Inlcude stdlib for malloc declaration
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-06 09:11:11 +00:00
Chris Wilson 6522fedaa1 sna/dri2: Don't dereference a NULL drawable on client shutdown whilst flipping
A dropped if(!NULL) check from the previous patch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-05 14:18:07 +00:00
Chris Wilson 72d208a7f2 sna/dri2: Perform swap elision on windows for swap-interval==0
In order to be more like Windows and inflate benchmark results.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-05 14:04:50 +00:00
Chris Wilson 7ae299be60 sna: Remove the flush after waking up between clients
In the normal command processing stream, we will have lots of
opportunity to ask whether we should be batching requests together. If
we wakeup without doing any work, then we will check inside the block
handler whether the GPU is idle and flush then.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-05 08:55:04 +00:00
Chris Wilson db82617464 sna: Decouple RandR pointers early in CloseScreen
RR resources are freed before CloseScreen (as they are a ServerClient
resource), but on entering our CloseScreen callbacks we are left with a
set of stale pointers. Decouple those before proceeding so that we are
not tempted to dereference them.

Bugzilla: https://bugs.archlinux.org/task/43906
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-04 17:12:30 +00:00
Chris Wilson 88e615425b configure: Make sure that BUILD_TOOL_CURSOR is always defined
Building intel driver with --disable-tools fails with following

  configure: error: conditional "BUILD_TOOL_CURSOR" was never defined.

Reported-by: Tomas Pruzina <pruzinat@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89425
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-04 15:29:45 +00:00
Chris Wilson 413ca2b88f sna: Sync RROutputProperty values with the kernel
Currently we only set the RR value for the output property on creation,
but we update that value every time we query the connector. To sync our
value with RR, we need to change the output property value.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-04 13:46:14 +00:00
Chris Wilson 8d76f90e2c tools: Add simple tool to retrieve the current cursor from X
Slightly more funky would be to poke around in the CRTC, but that should
require master. As it stands this should help verify that what X is
supplying to the driver matches user expectations

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-04 11:20:50 +00:00
Chris Wilson 3e390ec411 sna/dri2: Remove limiting pending swaps on redirection changes
If we limit the swaps, then doing xrandr --output -off causes unity to
misrender. Not quite sure why, but the revert is easy.

Fixes regression from
commit 88e84320a3
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Feb 24 12:44:19 2015 +0000

    sna/dri2: Flush triple buffer swap on [un]redirection

but we still keep the async-swap fixes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89371#c14
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-03 13:01:25 +00:00
Chris Wilson 555f7f4f54 configure: Include the xorg-server version in the summary
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-03 12:47:24 +00:00
Chris Wilson a5978074db Convert from RRSetChanged() to RROutputChanged()
RRSetChanged() is much more recent than RROutputChanged(), and
RROutptChanged() allows for more finer grained updates. Switch to
RROutputChanged for compilation with xorg-server-1.14 and older.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-03 12:36:41 +00:00
Chris Wilson 78aaba45c9 sna/dri2: Pre-fill new backbuffers
When we enable buffer-age and Clients start taking advantage of that by
only submitting trimmed flips (SwapBuffersWithDamage) we don't want to
then lose that by randomly injecting new buffers into the mix (thereby
forcing the client to repaint the entire buffer and us to damage all
outputs). As new buffers are relatively rare, especially in a
steady-state game scenario, spend a few cycles to initialise the new
buffer with the current back buffer contents.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-03 11:52:49 +00:00
Chris Wilson 8c2e9c2adc sna/dri2: Disable backend application of damage
In the future, I anticipate moving the application of damage into the
core dri2 (so that clients can specify the damage region for flips).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-03 09:43:45 +00:00
Chris Wilson 254bbd6f83 sna: Detect absence of DRM_I915_GEM_PIN
Don't error out if the kernel no longer supports pinning (despite it's
usefulness it has been removed) and hope that the kernel just works now
on 830gm/845g.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-03 07:50:26 +00:00
Chris Wilson 2c698d9ed3 sna/dri2: Fix format comparison
If multiple Clients intermix DRI2GetBuffers and DRI2GetBuffersWithFormat
we can end up with format mismatches. Rectify this by checking the
bitsPerPixel of the buffer instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-02 22:28:05 +00:00
Chris Wilson b7e28618cd sna: Tweak find clip box asserts
Reordering the asserts to save one predicate!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-02 09:44:44 +00:00