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>
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>
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 4cea803798
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>
Similarly to the fix for reflection into rotation, make sure we only set
one Rotation bit afterwards.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When reducing a xy reflection to a 180 degree rotation, make sure
only one rotation bit is set. Also by rotating the bit left, we
can support cases where xy reflection happens with 90/270 degree
rotation.
Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
[ickle: Interleave comments]
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>
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>
Based on further study of behaviour under a compositing manager, always
prefer to upload directly into the flushed bo, with a couple of
exceptions.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the batch is being frequently flushed due to Damage+Composite
tracking, we cannot amalgamate the small copies into the destination and
so end up sending thousands and thousands of tiny batches with tiny
render copies hogging the GPU.
References: https://bugs.freedesktop.org/show_bug.cgi?id=91577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Since the switch to preallocating the batch buffer, the request owns its
reference to the rq->bo. However, dropping that reference was missed
during the cleanup.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
An unwanted subtle change in preference from
commit 8c465d0fbf
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Aug 7 10:15:42 2015 +0100
sna: Fallback after a bo allocation failure for the batch
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we fail to allocate the next bo to use for the next_request, we can
just fallback to the delayed allocation used by !llc.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Whilst we currently do not try and submit a failed batch buffer
allocation, we still treat it as a valid request. This explodes much
later when we inspect the NULL rq->bo.
References: https://bugs.freedesktop.org/show_bug.cgi?id=91577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the pageflip following the CRTC fixup fails, we can be left with the
flip-to bo being left as the CRTC scanout. If that is so, reset the
desired mode (and original scanout bo).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Different OS name the i915 KMS module differently, so make it convenient
for us to be able to feed in the right name, or even just try them all
and pick the first one that exists!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Broadwell expanded all the relocations and we needed to adjust our
command construction to match. I missed offsetting the XY_SRC_COPY_IMM
used for XCopyPlane resulting in garbage for small copies on Broadwell.
Reported-by: Omar Sandoval
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91499
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Read all available HOTPLUG uevents and batch them into a single topology
probe. Like waiting for a bus, when one hotplug uevent arrives expect a
few more.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
check_pixmap() can be called very early in the Window setup proceeding,
before a pixmap is even assigned to a Window. There we expect the Window
to be NULL, so be more careful in our check_pixmap.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91467#c16
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When juggling Present and TearFree, we have to hide the extra flips from
Present as it cannot account for them. Preferrably we want to schedule
the Present flip following completion of the TearFree flip, but for the
moment simply block and wait until TearFree completes before starting
Present.
Reported-by: Andreas Reis <andreas.reis@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91467
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>