Age | Commit message (Collapse) | Author |
|
Sprinkle fall through comments where needed.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
|
gcc doesn't like extra stuff in the fall through comments.
Replace them with the standard form.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
|
If we change scanout status (i.e. whether or not this flip chain may be
presented directly on the CRTC), throwaway the previous back buffer
cache as those buffers may not be suitable for presentation.
Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=111197
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If the backbuffer is stale (i.e. the client didn't call DRI2GetBuffers
before swapping) the front/back bo may not be distinct. Move the
assertion for a valid swap after the handling of a stale swap so that
the assertions are more robust for a client error.
References: https://bugs.freedesktop.org/show_bug.cgi?id=111197
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Check for a stale backbuffer (the client didn't call DRI2GetBuffers
between DRI2SwapBuffers) before asserting so that we should be
more resilient with asserts enabled for client errors.
References: https://bugs.freedesktop.org/show_bug.cgi?id=111197
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Since forever we have been passing region=NULL when doing a windowed
swapbuffer on vblank, and using that to mark the entire pixmap as being
damaged. For an uncomposited window, this is incorrect as it points to a
clipped region of the ScreenPixmap and so we were marking the entire
ScreenPixmap as being flushed, but only having operated on the windowed
region. Instead pass along the clip extents if region is unset.
References: https://bugs.freedesktop.org/show_bug.cgi?id=105720
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Just flag the DRI2 flush to occur on the next callback flush, as per
normal, instead of manually emitting the batch.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
commit 74c1e45ed579 ("sna/dri2: Look for potential flip targets when
recreating backbuffers") cached the decision on whether to create the
new back buffer as a scanout target believing that we would always get
notified when the DRI2 drawable size changed. However, this is only true
inside a composited environment where we see a change in the Window's
pixmap. In a bare environment, we either need to chain into the
screen->ResizeWindow or check every time whether we think a new
backbuffer should be pre-allocated for use on the scanout.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
RandR allows the Primary output to belong to a slave GPU, i.e. with the
condition that screen->primaryOutput->screen != screen. When we fallback
to using the PrimaryOutput, we therefore have to check that the output
belong to us before treating it as a sna_output.
Reported-by: Peter Wu <peter@lekensteyn.nl>
Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100382
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we do flip to restore the bo after the current Window is destroyed,
we should not request that we send an event back to the client.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When the pending flip is queued, we update all the Windows to use the
next bo as their rendering target. However, that bo is not yet the
scanout until the future flip is performed. If the current fullscreen
Window is destroyed, we still must allow that flip to proceed or else
the old bo is left on the scanout.
And yes, this is indeed a fix to one of the debug patches that intended
to detect the error causing #93844. Irony.
Fixes: 7817949314a2 ("sna/dri2: Avoiding marking a pending-signal on a dead Drawable")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93844
Reported-by: Diego Viola <diego.viola@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We should be using the kernel's exec-id and not our own index.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
As we only ensure the flush before damage is sent, we also need to flush
any CPU shadows before the reply to GetBuffers.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
After doing the copy, we need to be sure that it is submitted to
hardware before the reply is sent to the client.
Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Fixes: 1f6dfc9df678 ("sna: Only flush GPU bo for a damage event")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When filling out the set of buffers for the DRI2GetBuffers request,
ensure that any pending rendering to them is flushed to hardware.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Occasionally TearFree likes to flushing pending event to try and avoid a
stall or a reallocation of a buffer. When it does so, we must avoid
processing vblanks as they may cause an update to the frontbuffer
re-entering the TearFree handler. Instead of deferring the obvious
recursions until the next vblank, buffer the events temporarily whilst
we wait inside TearFree.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When the client calls DRI2GetBuffers it expects the buffer to be
coherent, that is all X rendering to it flushed to hardware for it to be
able to read back.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Tracking SHM flushes precludes some of the optimisations we can make in
future for tracking DRI flushes, so split the two paths.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We currently hack TearFree/DRI2/swcursor to avoid recursion from inside
the SwapBuffers to handle the swcursor. This has the issue of a trailing
cursor on the boundary of the DRI2 drawable, but prevents the explosion
from swapping TearFree buffers from within the TearFree handler (i.e.
recursion). This only has to apply to the damage processing before the
swap.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
References: https://bugs.freedesktop.org/show_bug.cgi?id=96695
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If the pixmap on a drawable changes between swap events, just queue a
normal vblank event rather than chaining up.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Whilst waiting for the previous blit to complete, if we fail to queue
the vblank to wake up on the next frame, block before replying the blit
is complete.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If the client sends an out-of-date swap request, first make sure that we
don't cause an error by chasing a NULL CRTC and secondly force them to
wait for a whole vblank before the next swap.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The pending back buffer is only the pending copy, the actual info->back
stores the client's view of the current back buffer which may be more
recent than the pending copy. So store the current back buffer, swap in
the pending to do the normal swap, then free the resultant back (which
may have been exchanged with the front), before restoring the client's
current back buffer.
References: https://bugs.freedesktop.org/show_bug.cgi?id=95200
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If the kernel can't accept our tiling requirements, don't fret until we
actually need that fence! If we do, then we either stop tiling with the
buffer or we use another.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
After releasing the list, we need to mark it as freed.
Oversight from commit a11cbb6954f08edd0d8fb5eeca1debb289fdb9af
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Mar 15 21:11:48 2016 +0000
sna/dri2: Cancel all pending events when the window is resized
which reused the code for destroying the window (where priv->chain will
not be accessed again afterwards).
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When a Window is resized, a new Pixmap is attached to the Window and the
DRI2 buffers invalidated. However, the client may have requested a swap
before it is notified of the resize and so we have to discard the stale
swap. In doing so, we do not want to start a swap chain as it references
the wrong frontbuffer and causes dire confusion when we start swapping
for real.
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c131
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Kill the events early for simplicity.
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c138
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Ensure that we don't try and double-free the decoupled vblank event by
checking whether it is still pending first.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When we do a partial flip (one CRTC of many) we install a fake
frontbuffer for the window. This needs to be included in the
active-scanout tracking like a normal frontbuffer to avoid being
recycled too early.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If the root window's pixmap is changed (e.g. to resizing the
framebuffer) then an outstanding flip becomes invalid. The invalid flip
is marked as having a stale front, and that triggers an assertion if the
user then tries to schedule flip before the pending flip event is
processed.
References: https://bugs.freedesktop.org/show_bug.cgi?id=9425
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we fail to queue a flip for a CRTC, we attempt to restore the
original mode. However, if the failure is on a second CRTC, the queued
flip on the first will still complete causing us to process the event
twice.
References: https://bugs.freedesktop.org/show_bug.cgi?id=94250
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Silence a valgrind warning, though it should have no runtime impace.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If the Drawable is gone, we cannot send it a frame-complete signal, and
in particular we cannot continue the pending flip-chain.
References: https://bugs.freedesktop.org/show_bug.cgi?id=93844
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Before sending the frame swap complete signal after a FLIP, make sure
the client didn't die in the meantime.
Reported-by: Diego Viola <diego.viola@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=93844
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The main motivation is try and isolate from an upcoming API change in
busy-ioctl, but is also based on the observation that we now only care
about write-synchronisation.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Since we need the drawable to call DRI2SwapComplete/DRI2WakeClient, if
the window is destroyed that becomes inoperable (as we are called late
in the chain). Let's hope the client isn't blocked.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When we do the exchange for the next swap, we should emit any pending
completion signal for the previous buffer.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
From the previous commit, we have to check for NULL before the
dereference.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Fixes regression from
commit 8d9e496670f48b4eec64dfe1bcedb49793cf3073
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Jul 22 11:14:01 2015 +0100
sna/dri2: Take over the placeholder vblank
After noting the fence was complete, we would clear it. But I forgot
that we actually held a reference on to it, and so we would leak the 64k
batch, and starve the system of available memory in about 18 minutes of
SwapBuffers.
Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92911
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Simply sedding the name over to the new variable was insufficient as it
is now the logical opposite. Fixes
commit 64dbcdd4de1fe1941196265d054272d7d93e5d59
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Nov 10 09:56:07 2015 +0000
sna/dri2: Add a specific recursion indicator for TearFree/DRI2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Avoid conflating the DRI3/Present flag for controlling TearFree by
adding a separate flag to indicate when we are waiting inside the
TearFree shadow handler to avoid recursion in DRI2.
Reported-by: Andreas Reis <andreas.reis@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92873
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
With the introduction of a new SwapEvent that may trigger a copy, we
need to add another check for recursion from a TearFree flip event.
References: https://bugs.freedesktop.org/show_bug.cgi?id=92751#c14
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|