Commit Graph

8849 Commits

Author SHA1 Message Date
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
Chris Wilson 88e84320a3 sna/dri2: Flush triple buffer swap on [un]redirection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-24 15:50:25 +00:00
Chris Wilson 12af8a575d sna: udev integration depends on fstat and sys/stat.h
src/sna/sna_driver.c: In function 'sna_handle_uevents':
src/sna/sna_driver.c:759:2: error: implicit declaration of function 'fstat' [-Werror=implicit-function-declaration]

Also take the opportunity to include udev support in the configure
summary.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-24 15:30:56 +00:00
Chris Wilson 872a296850 sna: Discard addition of drawable offset if 0
Missing trim of "add 0" from

commit 0b7a6666f8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jan 5 14:00:44 2015 +0000

    sna: Partially unroll conversion of rectangles to boxes for fills

not all redundant +(dx,dy) were dropped.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-24 09:07:04 +00:00
Chris Wilson fef0f3dc0c sna: Add missing 'break' from last patch
Converting from

switch(value)
{
case 1: return 1;
...
default: return -1;
}

you must remember to insert the breaks!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-21 17:08:06 +00:00
Chris Wilson b6d4f49176 sna: Cache the output status and modes for 15s
As the output configuration rarely changes, and is normally accompanied
by a hotplug event, we can cache the last probe for a small number of
seconds. If a hotplug event does fire, in the worst case by the 30s
output polling thread, then we reset the cache and force the probe. This
should improve application (and desktop) startup times as they often
seem to do many full xrandr probes (rather than query current status).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-21 16:50:50 +00:00
Chris Wilson 09b0ab9b43 uxa/dri: Drop dependency on stdbool
Copying the bool is_level() without including stdbool.h causes it to not
compile on some machines. Just convert back to the old faithful Bool.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-18 19:16:29 +00:00
Chris Wilson 996736af71 sna: Rename 'sna_output_panel_edid' to 'sna_output_add_default_modes'
The criteria for adding the modes is not associated with panels and
edids, so the name is quite misleading. We add any missing default modes
if we have a panel fitter and the output itself has not declared them
(via its EDID).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-18 16:13:33 +00:00
Chris Wilson 50f911b19f sna/present: Fixup a few DBG
event_id is now an array - but the misprint was hidden on 64bit systems,
the warning only apparent because of the pointer mismatch on 32bit
systems.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-18 14:19:52 +00:00
Chris Wilson e293991f40 sna: Reuse the old cursor on the current CRTC
We only want to prevent sharing of physical handles across CRTC (on old
kernels). If we already have one assigned to a CRTC we know that it is
unshared and can keep using it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-18 10:01:02 +00:00
Chris Wilson 127aae5a72 tools/intel-virtual-output: Check for DRI3 more carefully
Using xcb, we cannot simply call xcb_dri3_query_version() without it
terminating the connection if DRI3 is not enabled on the target display.
Oops.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89172
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-16 21:48:41 +00:00
Chris Wilson 53c435c6cd sna/present: Only share vblanks on the same CRTC
Remember vblanks are private to a CRTC, the same MSC on another CRTC may
fire at completely different times...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-16 16:01:48 +00:00
Chris Wilson 10e40489e2 sna/present: Try exchanging the Pixmap with a scanout-ready bo
Try to avoid more clflushing on the current Pixmap if we have a
scanout-ready bo in the cache. We also note that since we unflip before
any other drawing takes place, we do not need to mark the flipped Pixmap
as being pinned to the scanout.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-16 16:01:48 +00:00
Chris Wilson 1877c8f508 test/present: Compact flip queue checks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-16 12:00:20 +00:00
Chris Wilson 1c16a91aaf sna: Skip an async flip request to the same bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-16 12:00:20 +00:00
Chris Wilson 93b94b96c6 sna/present: Append duplicates onto queued vblanks
If we have multiple events for the same vblank, append the notification
to an existing vblank. This is particularly useful as we it ensures that
we then report notifications in the same order as queued.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-16 12:00:20 +00:00
Chris Wilson b9eeb9dd84 test/present: Tighten MSC modulus computation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-16 09:45:17 +00:00
Chris Wilson 3382bd78d9 test/present: Test notifier accuracy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-15 19:21:01 +00:00
Chris Wilson 5fc2628e80 sna: Use shadow_enabled to prevent TearFree recursion
At times, we want to clear pending flips from inside TearFree, and thus
need to disable recursion. Currently we dance with shadow_damage, but
now we can just migrate over to using the shadow_enabled flag.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-15 19:21:01 +00:00
Chris Wilson 3fc942b374 sna/present: Avoid tricks with the TearFree flag
Modifying the flag may cause havoc if we need to modeset whilst Present
is in control as the CRTC will be setup without reference to TearFree, but
then when Present unflips, we restore the stale configuration. So let's
have a separate flag just to disable TearFree flips when a Present flip
chain is active.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-15 09:50:38 +00:00
Chris Wilson 74553bf4d2 sna/present: Integrate into TearFree, take 2
Following on from the previous attempt is the realisation that we can
simply disable TearFree during a Present flip queue, and re-enable
TearFree upon unflip.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-14 22:43:14 +00:00
Chris Wilson c30af937f8 sna/present: Disable hardware async flips with TearFree
These two don't mix, so remove the claim that we do support async flips
when TearFree is enabled.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-14 22:43:13 +00:00
Chris Wilson 9a311f9da6 sna: Throw away the TearFree damage if it grows too big
The Damage layer is slow, so reduce the amount of work it has to do by
explicitly throwing away any information other than the bbox.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-13 16:41:52 +00:00
Chris Wilson adaf0a2c61 sna/present: Hook into TearFree
For the duration of the Present flip chain, replace our frontbuffer with
the Client's Pixmap. Before any attempt to draw into the real
frontbuffer, Present will unflip back to the TearFree front+shadow.
However, it does give the Client direct access to the scanout through
their Pixmap (effectively disabling TearFree on behalf of the Client).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-13 16:41:52 +00:00
Chris Wilson 42ebe2ef96 uxa: Remove the filtering of bogus Present MSC values
If the intention was to filter the return values from the kernel, the
filtering would have been applied to the kernel values and not to the
incoming values from Present. This filtering introduces crazy integer
promotion and truncation bugs all because Present feeds garbage into its
vblank requests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-13 08:10:24 +00:00
Chris Wilson 35ab0afd04 test/present: Automatically disable DPMS
DPMS plays havoc with Present timings, make sure the screen doesn't turn
off.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-12 21:10:25 +00:00
Chris Wilson 9eb0ab15b1 test/present: Look for MSC wraparound
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-12 17:10:13 +00:00
Chris Wilson 254f2f2f4b test/present: Check a simple double-buffer sequence
Just check that we can do a present roundtrip in time to submit a new
frame on the next vblank.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-12 17:10:13 +00:00
Chris Wilson 92f74186b0 test/present: Include test for timing accuracy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-12 17:10:13 +00:00
Chris Wilson 9d4df75edb test/present: Check modulus computation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-12 14:47:30 +00:00