Age | Commit message (Collapse) | Author |
|
Some time past, we switched to a seperate boolean to mark when the
shadow is no longer accessible due to recursion - but I missed an
important check inside the vblank handler.
Reported-by: Joe Peterson <joe@wildlava.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92751#c5
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
In order to catch transitions between SwapInterval 0 and 1 in the middle
of a flip sequence, we need to reset our swap_limit every time.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Once again I tried to add an event to a pixmap, but only Windows carry
the CRTC tracking information. Stop it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Even though the kernel reports and error and we skip the queuing, we
have information to avoid the roundtrip through the kernel.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
On a headless or hosted system, we do not have any CRTC on which to
report or queue the vblank. Reporting a BadDrawable is evil (as clients
never expect the error) but is better than crashing the Xserver.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Along the blit swap path, we expect the buffer to not be scanout
compatible and not have the same pitch as the front buffer. The reuse
logic failed to take this into account!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Otherwise we raise assertions about trying to attach events to an
illegal Window.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
As the window may be reparented during its swap lifetime, we may be able
to recreate the backbuffer ready for flipping next swap.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Since the DRI2BufferPtr destruction may be delayed, by the time we do
free it, the state may no longer be accurate. (At this level at least,
there is a later assertion to the same regard just as we think we are
releasing the buffer.)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
With the rigamorale of assertions, using the vblank is no longer
trivial.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This so that we permanently exclude the active front buffer from the set
of triple buffer replacements.
References: https://bugs.freedesktop.org/show_bug.cgi?id=91658
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Down one particular patch (overlapping render copies) the
scratch.pScreen is dereferenced (to create a temporary Pixmap). Ensure
that we populate it before hand.
References: https://bugs.freedesktop.org/show_bug.cgi?id=91658
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The local was only used in debug builds, so remove it to squash the
compiler warning.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
To ease tracking of the next swap, stash it on the event (which is then
reused) rather than the back buffer (which changes frequently).
In addition, add debug flags and assertions to track event stages (such
as making sure we do not decouple/free an event that we have sent a
signal back to the client).
References: https://bugs.freedesktop.org/show_bug.cgi?id=91658
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Third time lucky at getting the pending copy swap with the real back
correct?
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
References: https://bugs.freedesktop.org/show_bug.cgi?id=91658
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we don't control the vblank for the window, we cannot use the vblank
signal as it ends up being queued as well.
References: https://bugs.freedesktop.org/show_bug.cgi?id=91658
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
A side effect of commit 4cea8037984c3d5e171be22710384f66660ca4c6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sat Aug 8 22:10:20 2015 +0100
sna/dri2: Restore caching of fullscreen triple buffers
was that we discovered that we had been inserting the buffer into the
cache list multiple times.
Reported-by: Dan Doel <dan.doel@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=91658#c5
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If the DRI2 copy ends up on the CPU, then we will not have a GPU
request for the operation.
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If a client dies with a pending flip, we have to complete it so that the
scanout matches the frontbuffer again. This requires one last flip
following the client disapparance.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Letting GL clients run amok when offscreen (or when hidden) has
unexpected UX behaviour. Instead we can elect to throttle them to the
nearest CRTC and keep the desktop running smoothly.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When the client misses a swap, we consider it idle and unlikely to swap
again for a while. We try to take advantage of that and remove the old
back buffers. But it is likely to swap again and so having some of that
cache around would be advantageous.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Rather than just discarding the old buffer, we want to add it to the swap
cache and so hand it back to the client in the near future.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We use the fence as a backchannel to commuicated the tiling mode to the
DRI2 client, so in such cases we cannot tolerate a failure to set the
tiling mode.
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c114
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we are doing synchronous but immediate swaps, we may notice that we
have a vblank placeholder from the last swap. If so, we can replace it
with the swap we need to perform on the next vblank.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When emitting the keepalive, it helps to actually request the signal
from the kernel.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
After the Window resizes, we should never hand back a buffer of the old
size or else we end up rendering garbage - with the possibilty of GPU
hangs or memory corruption.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91036
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
It's possible if the Window is redirected whilst the client render for
its backbuffer to no longer overlap with the visible Window. In this
case, we attempt to copy an empty region, but it debugging is enabled
this throws an assert.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91120
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
sna_dri2_xchg() is also called on the flip path to do an immediate swap
of a hidden buffer, in which case can_xchg() returns false as it
believes that the swap requires a flip.
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c109
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When we record the next scanout for display after the following vblank,
note the size of the allocation as well as its name and bo et al.
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c105
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Apply s/cacheing/caching/ because I am alone in my belief of how to
spell cacheing correctly :)
Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Looks like amalgamating the per-CRTC xchg with the blit caused a few
regressions with TearFree single monitor flipping.
References: https://bugs.freedesktop.org/show_bug.cgi?id=91066
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
One assert(active_scanout) was firing when feed in an old flip bo, which
in hindsight was quite expected.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we cannot cache the current backbuffer, due to either it not fitting
or because a reference to it still exists, delete the cache entry we
were holding for it - or else we slowly leak the cache list and
gradually get slower and slower walking along the growing chain.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We can fail to submit the batch if the GPU is wedged (or the driver
upset), in which case the bo will be NULL and we should not blindly
dereference it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Since there were two paths performing similar tasks for swapping a
windowed buffer, they would get easily confused and queue themselves in
conflict with each other as they behaved slightly differently wrt to rapid
swaps. Almagamate the two paths such that the behaviour is the same -
with the complication being in tracking the spare active buffer.
Fixes (some at least!) flickering from
commit 72d208a7f2f0e8f2d93483e535154f34a8a26d81
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Mar 5 12:26:15 2015 +0000
sna/dri2: Perform swap elision on windows for swap-interval==0
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Fixes copy'n'paste error in
commit d46c793663d2b1b5ffb923500111b7affa8402b6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Jun 12 13:50:35 2015 +0100
sna/dri2: Remove the active_scanout flag when deleting the event
Reported-by: Andreas Reis <andreas.reis@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90968#c8
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If there is already a pending operation on the drawable, the swap is
queued. It is queued with SWAP_THROTTLE which classes with the
vblank_mode=0 chaining, so the choice is to either review all other uses
of SWAP_THROTTLE and duplicate the chain swap handling, or to choose when
use to the alternate copy or back buffer. This patch opts for the
latter.
Fixes regression from
commit dcb4d323ca19f86fbe0230378ac9035161a70f9e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Jun 11 13:54:49 2015 +0100
sna/dri2: Mark the pending backbuffer copy as active
Reported-by: Christoph Haag <haagch@frickel.club>
Reported-by: Andreas Reis <andreas.reis@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90968
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Keep the swap cache around for 100ms, so only if the app drops below
10fps do we start having to recreate buffers on the fly.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
As the backend may submit the batch as it completes the copy, we need to
look at what request the dst_bo is in rather than assuming it is the
next_request.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we cancel the event, make sure we remove active_scanout marker.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Although we are ordered wrt to the client, there is no point allowing
the client to continue submitting rendering and eventually blocking
whilst we are still waiting for the previous frame to be shown.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Not only is the pixmap->flush flag shared, but so is the lower level
gpu_bo->flush flag, so further to
commit 19d1e4ee19a93905d8d2496f856a18eb07bc23d6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Jun 11 13:43:10 2015 +0100
sna/dri2: Be wary of interactions with DRI3 and sna_pixmap->flush
we need to be more careful when asserting the state of gpu_bo->flush
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We still only keep it alive whilst the event chain is in progress, but
moving the cache onto the window allows us to reuse it easily for triple
buffer window swaps as well as full screen flips.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
In order to perform swap elision for windows, we defer the blit until
the next vblank and then do whatever was the last buffer to be presented
by the client. Whilst that copy is pending, in the same manner as a
pending flip, we cannot hand that buffer back to the client for use (or
else they will render over top of it before we copy from it, or even
worse we copy from it in the middle of rendering).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|