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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.]
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>
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>
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>
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>
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>