Commit Graph

8719 Commits

Author SHA1 Message Date
Chris Wilson 653b8a4d83 sna: Declare outputs as hidden at start
Required for our internal bookkeeping of DPMS events.

Reported-by: Jiri Slaby <jirislaby:gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c79
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-22 16:49:38 +00:00
Chris Wilson d16ac1f30b sna/dri2: Prefer to use normal selection criteria for CopyRegion on small GT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-21 10:15:13 +00:00
Chris Wilson b0f90a4611 sna: Keep front_active consistent across DPMS events
When disabling outputs with DPMS, make sure we update front_active for
consistency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-21 10:15:13 +00:00
Chris Wilson 0f15bfb190 sna: Add missing include of DPMS constants
Fixes build with slightly older X servers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-20 10:40:34 +00:00
Chris Wilson 6da7993518 sna: Finish e6227daff1
Missed the git-add before pushing. :|

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-20 10:40:34 +00:00
Chris Wilson e6227daff1 sna: Add a loud DBG message when enabled
Having a reminder/alert when the debug tracing is enabled I find useful.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-20 10:25:53 +00:00
Adel Gadllah 986c6977c3 Set the vdpau driver to va_gl
This at least works when the wrapper is installed, there
is no i9xx vdpau driver. This should for example improve flash which
only supports vdpau. The expectation is that most software will use vaapi
in preference for -intel, for example kodi which supports both vdpau and
vaapi video acceleration methods. [A quick discussion with Peter
Frühberger clarified that kodi should indeed continue to work fine and
will not be confused if we expose an actual vdpau driver.]
2015-01-19 21:09:46 +00:00
Chris Wilson 77f9e30007 sna: Provide a few compiler hints
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-17 22:42:41 +00:00
Chris Wilson e351c36473 sna/gen6+: Prefer not to switch away from active RENDER pipeline
If we don't have a good reason to switch to BLT, don't jump engines
simply because the BLT is idle if our target bo is active on the RENDER
pipeline.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-17 22:34:33 +00:00
Chris Wilson a4fff89188 sna/dri2: Exchange flags when exchanging DRI2Buffers after SwapBuffers
Along with the name, pitch, bo, we should also preserve the flags.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-16 11:36:46 +00:00
Chris Wilson 6a6efd3517 sna/dri2: Track tracking of active-scanout for back buffer replacement
In the end it turned out to a small typo, s/scanout/active_scanout/ in
consideration of reusing the cache. Though there are a number of very
useful debug improvements along the way.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-16 08:35:46 +00:00
Chris Wilson bb279d5c65 sna/gen6+: Prefer using RENDER pipeline for uncached destinations on large GT
If the sampler can be cached, the RENDER pipeline can write to an
uncached destination surface faster than main memory bw would seem to
actually allow... Notably, performance does not drastically fall off
with small areas compared to BLT as it once did. However, using a solid
source (which is not yet implemented well in the RENDER pipeline) is
still much faster with the BLT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-15 10:35:13 +00:00
Chris Wilson 442a434646 sna/dri2: Add a DBG message for when Xorg triple buffering is available
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-15 09:09:15 +00:00
Chris Wilson e7ef57ce1f sna: Actually check for has_wc_mmap before use
The callers assumed that the callee was doing the check and vice versa.
The result was that no did and we ended up using an incoherent mapping
instead on old kernels.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88350
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-14 11:52:31 +00:00
Chris Wilson b7feeca073 sna: Wrap direct access to ScrnInfoPtr->pScreen
Admittedly ScrnInfoPtr->pScreen has nearly always existed, but for
completeness wrap it up in a compat macro.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-13 16:30:51 +00:00
Chris Wilson 3cfde9f043 sna: Only instantiate the frontbuffer on the GPU if used
If we are a PRIME slave, we never need to allocate any memory for the
frontbuffer, so skip the forced allocation during modesets.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-13 16:30:30 +00:00
Chris Wilson 1cffbd9a8e sna: Combine slave CRTC offsets with rotation
When applying both a slave offset and an output rotation, order is
important. To get the order right, we need to combine the two into a
single transformation.

Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-13 12:13:30 +00:00
Chris Wilson 2b1353689a sna: Add a small DBG message for when PRIME slave tracking is enabled
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-13 12:13:30 +00:00
Chris Wilson 1978b17cb0 sna: Throw away CRTC damage if the CRTC is outside the screen bounds
As the damage is entirely empty due to the screen clipping, we can save
a few electrons by not recording it. Ordinarily, we will then get the
damage event later when the screen is resized.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-13 12:12:53 +00:00
Chris Wilson ee79d18855 sna: Use correct octal value for gen3
Fixes regression in
commit 836f9e11d6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jan 9 19:55:41 2015 +0000

    sna: Disable detiling for gen2

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-11 13:49:34 +00:00
Chris Wilson ebdc4d1eeb sna: Add basic unswizzled manual detilers for gen2
gen2 uses a unique tile setup, and as far as we known, no swizzling.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-09 20:16:40 +00:00
Chris Wilson e143ce600a sna/dri2: Fix build with DRI2INFOREC version 5
Reported-by: Patrick Welche <prlw1@cam.ac.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88252
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-09 20:03:14 +00:00
Chris Wilson 836f9e11d6 sna: Disable detiling for gen2
gen2 use a different tile layout to all the other generations, and are
not supported by the existing routines. Disable for now.

References: https://bugs.freedesktop.org/show_bug.cgi?id=88112
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-09 19:55:41 +00:00
Chris Wilson 07096568e7 sna: Actually set the priv->mapped type for mmap(wc)
A glitch from the last patch forgot to set the priv->mapped flag
correctly after setting up a mmap(wc).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-09 17:58:24 +00:00
Chris Wilson 05ca3bc1cb sna: Wrap mmap accessors with sigtrap to catch oom SIGBUS
Accessing a mmap'ed pointer (especially our shmemfs backed bo) can throw
SIGBUS when out of memory, for which we use sigtrap for graceful
failure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-09 16:47:54 +00:00
Chris Wilson e0463036bb sna: Replace assert with conditional setting of sna_pixmap->mapped
The status of sna_pixmap->mapped was changed with the introduction of
mmap(wc), but the code was still asserting that the mmap could only be
cached.

References: https://bugs.freedesktop.org/show_bug.cgi?id=88112#c20
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-09 16:45:32 +00:00
Chris Wilson d49e6ad6ef sna: Add a couple of guards against using the GPU to write into snooped bo
Since gen2 cannot rendering into a snooped bo, we have to be careful
before trusting the CPU bo as a GPU target.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-09 14:28:25 +00:00
Chris Wilson 3d85fa8027 sna: Capitlize log message "display hotplut detection"
It looks out of place starting with a lower case letter when the
surrounding messages are sentence captilized.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-09 13:44:15 +00:00
Chris Wilson e53087e48b sna: Allow use of mmap(wc) for inplace GetImage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-08 16:44:28 +00:00
Chris Wilson bc59d3fc76 sna: Differentiate between disabling CRTC and turning off DPMS
xf86DisableUnusedFunctions() uses crtc->dpms(off) to disable unused
pipes. In this case, we do want to explicitly disable the CRTC to
release any shared state (e.g. PLLs and encoders). However, the user can
also request for the DPMS to be disabled, either via the DPMS extension
or the ScreenSaver. Here, we don't want to full disable the pipe as that
incurs extra latency (and risk of failure) when switching the display
back on. In order to distinguish the two cases, we can hook into the
user paths and skip disabling the CRTCs.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-08 11:37:49 +00:00
Chris Wilson 574ab948af sna: Add mmap(wc) handling to has_coherent_ptr assertion
Extend the debuging sanity checks to also cover WC mappings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 19:40:29 +00:00
Chris Wilson 9bbbcc2f42 sna/trapezoids: Fix typo in construction of polygon lines
Fixes regression from a missed replacement in:

commit 191c6b6ca7 [2.99.917]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Oct 5 09:05:20 2014 +0100

    sna/trapezoids: Improve sample locations for imprecise rasterisation

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 13:53:27 +00:00
Chris Wilson 7b7f71a7d5 sna/video: Reuse fallback colorkey filler from overlay for sprites
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 10:41:26 +00:00
Chris Wilson 362d455947 sna/video: Provide fallback support for filling the colorkey
If the GPU is wedged, we cannot use the blitter for filling the
colorkey, so provide an interface to write the value using the GTT
instead.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 09:58:37 +00:00
Chris Wilson 5d4b00032c sna: Copy mode.vrefresh between kernel and X
The value is typically used only for human readable output, though some
kernel modules do use it for preferred mode matching (notably not
i915.ko today). Let us not second guess the desired vrefresh if it is
known.

Suggested-by: "Jasper St. Pierre" <jstpierre@mecheye.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 16:50:55 +00:00
Chris Wilson ac40532680 sna: Allow scanouts to be directly accessed via the GTT even when wedged
We only want to prefer shadow access to ordinary pixmaps (to avoid
reading back via the GTT). However, since we must use the GTT for
scanouts, we may as well take advantage of direct writes even if the GPU
is wedged.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 14:26:00 +00:00
Chris Wilson fdb3a008e9 sna: Clip copy to CRTC shadow
If the user sets the CRTC position before resizing the framebuffer, we
end up with an out-of-bounds CRTC and install a shadow (as the current
framebuffer does not cover the CRTC). In this case, we copy the visible
region before displaying on the CRTC. However, this needs to be clipped
for self-consistency.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 14:11:40 +00:00
Chris Wilson 25581f63cf sna: Allow scanouts to force late attachment
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 13:37:10 +00:00
Chris Wilson 61ab528b16 sna: Disable GPU preferences when marking it as wedged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 13:37:10 +00:00
Chris Wilson cc9d7f6777 sna: Reject CPU blits that require format conversions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 13:37:10 +00:00
Chris Wilson e44e57d4cd sna/video: Do an early check for a wedged GPU before texturing
If we don't have a GPU available, we can not do the colour space
conversion and compositing with the GPU, so bail early.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 12:58:18 +00:00
Chris Wilson 986cb2335c sna: Enable mmap(wc) support by default
Now included in upstream kernels as of

commit 1816f92363036600f2387bb8273b1e5e1f5b304e
Author: Akash Goel <akash.goel@intel.com>
Date:   Fri Jan 2 16:29:30 2015 +0530

    drm/i915: Support creation of unbound wc user mappings for objects

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06 10:45:05 +00:00
Chris Wilson c4428532f6 sna: Don't force a batch flush at the start of a BLT fill op
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-05 13:46:33 +00:00
Chris Wilson 19a95be5e9 sna: Don't record old vblank events
When we read vblank events back from the fd, we have to be wary in case
they are older than the most recent vblank query. If they are stale, we
do not want to record them as being the last-known vblank event.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-31 11:55:24 +00:00
Chris Wilson 0d42b0ed25 sna/gen7: Limit threads on HSW GT1
For whatever reason, it seems that for HSW GT1 we cannot specify the
maximum value of the field and leave it to the hardware to clamp the
value to the maximum supported. The impact should be zero other than the
possibilty it workarounds an issue if the hardware doesn't apply the
limit.

References: https://bugs.freedesktop.org/show_bug.cgi?id=87564
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-24 15:20:55 +00:00
Chris Wilson baec802b21 2.99.917 snapshot 2014-12-21 14:41:12 +00:00
Chris Wilson 01ce7efe73 sna: Fix Drawable offsets prior to performing shadow discard
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-20 13:36:50 +00:00
Chris Wilson c27e6306e8 sna/dri2: Check for implicit flushing after updating a Pixmap buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-20 12:46:52 +00:00
Chris Wilson 5c16a4ec9b sna: Skip allocation of new TearFree buffer if not actually flipping
After showing the new front buffer, we have to avoid writing to the back
buffer whilst the flip is still pending (as it may still be being shown
by the display). To do this we check if there are any outstanding flips,
and reallocate if so. However, with a CRTC override, we may just be
flipping that one CRTC and not the current TearFree back buffer and in
that case we can avoid the reallocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-20 12:33:28 +00:00
Chris Wilson 9b3b591476 sna/dri2: Preserve the shadow CRTCs when copying to other areas
In the Composite setup, if we are doing a DRI2 copy onto the front
buffer, we are fully cognizant that the copy will not go onto the
unredirected Windows of another Client. So we can preserve the shadow
CRTC mapping for those Clients, and prevent ping-ponging between CRTC
modes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-19 20:08:44 +00:00