Commit Graph

8757 Commits

Author SHA1 Message Date
Chris Wilson 6ba3bd9dfd sna: Use local defines for compilation on older distributions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-04 12:12:13 +00:00
Chris Wilson c6dd23ce11 sna: Always mark the virtual outputs as disconnected until used
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-04 11:13:19 +00:00
Chris Wilson 5fad8d8527 sna: Mark initial output status as unknown
References: https://bugs.freedesktop.org/show_bug.cgi?id=88960
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-04 11:07:19 +00:00
Chris Wilson d7bcb7bcbf sna/trapezoids: Amalgamate adjacent lines
If we have two scanlines with identical extents and coverage, we can
amalgamate them into a set of multi-row boxes. For simplicity, we only
compare with the last box (assuming that the majority of such cases are
"rounded-rectangles" where we have a large vertical area with no
variation and can coalesce into a single box). This operates as a second
pass to the scanline converter itself coalescing pure-vertical regions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-04 10:44:33 +00:00
Chris Wilson db629a3834 Allow runtime selection between DRI levels
Rather than imposing a maximum DRI level at compile time by compiling
out unwanted protocol handlers, default to limiting it at runtime so
that we can switch between any level.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-04 09:55:54 +00:00
Chris Wilson aef2f99d05 sna: Convert CompositeRectangles ADD white to SRC white
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-03 21:31:16 +00:00
Chris Wilson 3855a728e5 sna: Always restore the scanout on DPMS on
As we may exchange the frontbuffer whilst the outputs are hidden (DPMS
off), when we turn them back on, unless we force the CRTCs to be
updated, we may end up simply showing a stale scanout buffer not the
current frontbuffer. If the two are same, it will just be a kernel
no-op.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88826
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-03 20:26:41 +00:00
Chris Wilson 70cb682662 uxa/dri2: Recreate the triple buffer across a mode change
If the mode changes whilst we have a pending flip, we may reinstall the
previous scanout buffer as our next back buffer despite it no longer
matching.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-02 10:03:33 +00:00
Chris Wilson 6d2754b190 Unify Option "DRI" parsing
Allow Option "DRI" "[23]" to also work with UXA.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-31 21:46:09 +00:00
Chris Wilson dac01d0839 sna: Mark the bo as clean after the kernel reports it idle
After querying for an idle bo and retiring the associated requests, we
must be careful not to confuse ourselves with exported bo becoming busy
again.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c83
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-31 10:55:44 +00:00
Chris Wilson 5edab91b1e intel: Try to load one AccelMethod if the .conf doesn't match
If you mistype or make the wrong selection in the AccelMethod override,
you can end up with a non-booting system, so lets always try to start
something!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-31 01:30:09 +00:00
Chris Wilson 6db906ea81 uxa/dri2: Reimplement triple buffer support
Since xorg-server-1.12.0, Xorg has supported adjusting the client swap
limits allowing us the implemention of triple buffered flipping with
accurate event timestamps. Given that the current implemention has an
issue tracking the right GEM name across composite unredirection, it is
an approximate juncture to tackle both bugs.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=742911#c1
Testcase: dri2-race + gnome-shell
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-31 01:27:49 +00:00
Chris Wilson 102a091f5a sna/dri2: Rearrange asserts for greater coverage
Always check that the reused DRI2Buffer matches the associated name, and
not just for back buffers of a window.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-31 00:21:29 +00:00
Chris Wilson e427bb4e41 test/dri2-race: Race against CloseDisplay and also test WaitMSC
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-30 14:49:02 +00:00
Chris Wilson d909c46074 uxa: Fix error handling for failed pageflips
Lots of issues found when trying dri2-race, mostly resulting from
queueing too many flips at one - which itself is buggy. However, we
crashed whilst trying to recover from the kernel reporting the error.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-30 13:24:42 +00:00
Chris Wilson c2f30a539c uxa/dri2: Make vblank/flip handlers static
These are no longer called directly from outside intel_dri.c and so we
can make them static.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-30 13:12:20 +00:00
Chris Wilson fa5a8c61d1 uxa/dri2: Reset swap_info->type after a failed flip submission
As we set the type prior to attempting to queue a flip, we need to then
reset the type if that attempt fails and we need to fall back to a
vblank handler.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-30 13:10:55 +00:00
Chris Wilson c0610c76b7 sna/dri2: Smooth out delivery of triple buffer SwapCompletions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-29 23:56:06 +00:00
Chris Wilson dc51886c0c sna/dri2: Fix use of stale flip_pending after removing window
Testcase: dri2-race
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-29 23:55:19 +00:00
Chris Wilson 1030705cdc sna/dri2: Fix interoperation between keepalive and fake-triple-buffering
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-29 23:11:49 +00:00
Chris Wilson 58fe408978 sna/dri2: Keep the per-drawable swap cache alive for 50ms
The purpose is to keep the recent history of buffers for a DRI client
for tracking the relevant age.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-29 16:40:15 +00:00
Chris Wilson 2e7ae76038 test/dri2: Use xcb for more accurate timing of SwapBuffers
To do SwapBuffers correctly requires a Swap/Get buffers combination, and
this is easiest using xcb rather than xlib.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-28 11:46:43 +00:00
Chris Wilson 6f6190abcf sna: Clear the per-crtc shadow buffer if they are clipped
Before we present a buffer on the CRTC, we try to make sure it is
initialised with the current contents. However, if it is larger than the
screen then not all the buffer may be initialised and so we need to
clear it first.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-28 11:24:09 +00:00
Chris Wilson 4bbd102367 sna/dri2: Check for comparable back/front pitches more carefully
Suppose for a moment that we don't have a DRI2Buffer associated with the
Drawable just yet... This could happen after a Composite redirect as the
front buffer may created (and so associated with the new Pixmap) after
the back buffer is recreated.

Reported-by: Tomas Pruzina <pruzinat@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88814
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-27 12:01:12 +00:00
Chris Wilson b8d52b0edd sna: Log maximum number of CPU threads
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-26 21:40:20 +00:00
Chris Wilson d2b7d78064 sna/dri2: Use existing busy state if semaphores are disabled
Undo d16ac1f30b (sna/dri2: Prefer to use normal selection criteria for
CopyRegion on small GT) to keep on the current ring as the external bo
if semaphores are disabled.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-26 21:31:44 +00:00
Chris Wilson 64e9c79017 legacy/i810: Expand mask to match unsigned long
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-26 13:18:56 +00:00
Chris Wilson 33f7d5e428 sna: Expand mask to match uintptr_t
Let's make sure we mask all the uintptr_t bits.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-26 13:10:21 +00:00
Patrick Welche 53e825d6cf configure.ac: pwd doesn't take an argument
bash built-in doesn't give an error, but real pwd does, and the
argument is unnecessary.

Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
2015-01-26 12:47:03 +00:00
Patrick Welche 75fcda8058 uxa: fix XVMC = no build
Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
2015-01-26 12:46:43 +00:00
Patrick Welche ac90648ec7 backlight.c: test for features
Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
2015-01-26 12:46:07 +00:00
Chris Wilson 913afaf249 sna: Tweak treatment of DPMS mode to be consistent at all layers
References: https://bugs.freedesktop.org/show_bug.cgi?id=88794
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-26 09:42:11 +00:00
Chris Wilson 6c8d98436a sna/gen6+: Tweak engine placement when considering src/dst combinations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-25 14:09:07 +00:00
Chris Wilson ed19b16008 sna: Assert that the shadow buffer has a compatible pitch to the front
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-23 11:08:37 +00:00
Chris Wilson b388172076 sna: GETPROPBLOB only works with exact length matches
If the blob is smaller than the space we offer for the read, it skips
the read. So make sure we repeat the read in this case as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-23 10:54:57 +00:00
Chris Wilson 619d165eed sna: Add a fallback DBG for the git version
In case the version numbering is disabled, like on Arch, include it
anyway in the full debug log.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-23 08:42:56 +00:00
Chris Wilson 684e921a54 sna/dri2: Only preserve back buffers with the same pitch
We can only pageflip if we don't change the pitch, otherwise we
simulate the pageflip with modeset. The idea is that once we have
exchanged the buffers, we will quickly settle down to a steady state
scenario where each buffer has the same pitch. We can encourage this
further by only keeping those buffers around that do have the same pitch
as the current front.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-22 21:03:24 +00:00
Chris Wilson 3cb0672586 sna: Reorganise assertions when retiring idle bo
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c83
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-22 21:03:24 +00:00
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