Commit Graph

9028 Commits

Author SHA1 Message Date
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
Chris Wilson cb2269d130 sna/gen3: Disable fences associated with vertex buffers
Could gen3 actually be trying to read these through a fence?

References: https://bugs.freedesktop.org/show_bug.cgi?id=89334
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-02 09:13:59 +00:00
Chris Wilson f6ba71ac19 sna: Unrecurse clip box search
Unwind the trivial tail recursion from the clip box bisection and add a
couple of assertions on the inlined fast-paths.

References: https://bugs.freedesktop.org/show_bug.cgi?id=89295
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-01 16:20:26 +00:00
Chris Wilson 9fb8154629 sna/gen7+: Allow GT3 to overlapping copies via an intermediate
This benefits most when GT3 is coupled with eLLC and WT, but it is just
marginally a win over a BLT otherwise.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-27 17:01:18 +00:00
Chris Wilson 445423170d pciids: sync with kernel 0dc6f20b9
No new ids, just fixed descriptions.

Sync upto
kernel commit 0dc6f20b9803f09726bbb682649d35cda8ef5b5d
Author: Rodrigo Vivi <rodrigo.vivi@intel.com>
Date:   Wed Jan 21 11:46:32 2015 -0800

    drm/i915/bdw: PCI IDs ending in 0xb are ULT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-27 17:01:18 +00:00
Chris Wilson 53d804b134 sna: Avoid asserting that a foreign bo is idle
Once again we fall foul of a foreign bo that between consecutive calls
to the busy ioctl may be used by another client. Relax the assertion
that on the status of the bo being retired and double check afterwards.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c101
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-25 20:29:37 +00:00
Chris Wilson 369ceec0e4 uxa: udev integration depends on fstat and sys/stat.h
src/uxa/intel_driver.c: In function 'I830HandleUEvents':
src/uxa/intel_driver.c:738:14: error: storage size of 's' isn't known
src/uxa/intel_driver.c:746:2: error: implicit declaration of function 'fstat' [-Werror=implicit-function-declaration]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-25 19:00:32 +00:00
Chris Wilson ea09d830c8 sna/trapezoids: Restore lost xTrapezoidValid() checks
When fixing up the sample projection of the trapezoids, we lost the
safety check that the trapezoid was valid.

Fixes regression from
commit bca08dc415 [2.99.917]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Sep 29 19:30:03 2014 +0100

    sna/trapezoids: Fix loss of precision through projection onto sample grid

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c95
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-25 17:40:55 +00:00
Chris Wilson 2b978c71e4 tools/intel-virtual-output: Use xcb_dri3_id
xcb exports the extension structs for querying whether they exist and
sharing the results.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-25 14:29:03 +00:00
Chris Wilson 6bf6b4b750 sna: Check types on querying RAM
Turns out to be a false alarm as the machine I was looking at only had
4GiB. I thought I was looking at another one and started panicking about
where had all the memory gone...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-25 12:58:53 +00:00
Chris Wilson 41e559f57e sna: Update the active_scanout flags on async flips
In order to keep our sanity checks and buffers in order, we need to
remember to mark the new frontbuffer as the active scanout after an
asynchronous pageflip.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-25 09:01:25 +00:00
Chris Wilson 1ae0dc460d sna: Clamp aperture size to 32bits
Internally we only use 32bits for limiting the maximum object size
(both for CPU and GPU allocations) so to prevent overflow limit the
reported aperture size.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-24 22:58:51 +00:00
Chris Wilson 98245a5cff sna: Improve DBG messages for MST probing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-24 22:58:51 +00:00