If we need to handle a FillRectangles request that is larger than the 3D
pipeline can handle, we need to split that operation up into smaller
chunks. This is achieved by redirecting the rendering through a view of
the surface (offset so that coordinates are within range), or else we
have to fallback to creating temporary surfaces.
If we fail to do so, we should hit an assertion that the render target
fits within the 3D pipeline inside gen4_emit_drawing_rectangle()
Reported-by: Zdenek Kabelac <zdenek.kabelac@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 the /sys/device/backlight never turned up we face an issue with
disambiguating the backlight on multi-GPU devices. Both intel_backlight
and nv_backlight are presented are raw interfaces, and on modern systems
the ACPI interface is defunct, so we need a way to distinguish them. So,
we fallback to our priority table of known interfaces and rank them
accordingly, first by class (platform, native, raw) and then by priority.
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 72d208a7f2
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>
If we fail to turn off an output via DPMS, disable the entire CRTC in
order to blank the output and save the screeen/power.
Reported-by: Lukas Hejtmanek <xhejtman@fi.muni.cz>
References: https://bugs.freedesktop.org/show_bug.cgi?id=90179
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Fixes copy'n'paste error in
commit d46c793663
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 dcb4d323ca
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>
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>
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 19d1e4ee19
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>
When the trapezoid is rendering to a surface larger than the 3D pipe can
handle, we split it into tiles. However, the code to do so insisted on
passing along the wrong pointer and consequently crashed.
Based on the patch by Carl Michal.
Reported-by: Carl Michal <michal@physics.ubc.ca>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90940
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>
Since both DRI2 and DRI3 manipulate the sna_pixmap->flush flag, we have
to relaxation assertions that it is wholly owned by DRI2.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We know Present is sending garbage msc into the wait_vblank, so just
warn about the error so that we do not prevent usage of --enable-debug
due to somebody else's bug.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
For PRIME bo, we need to use uncached render targets so that any writes
are flushed out to main memory where they can be immediately read by a
PCI device. For simplicity, we just request that PRIME bo be also
SCANOUTs as that ensures that they will be created with the right
attributes for coherent main memory.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As the slave may use the ProcessPending damage callback to do its own
copying, we need to flush before.
Reported-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the source is only being exported for reading, we can skip adding it
to the flush list only to perform a no-op.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In the case of an exported pixmap, e.g. with DRI3, it is possible for
the client to render into the pixmap whilst we are unaware. To serialise
the xserver and the client, we flush all operations on exported pixmaps
before talking to the client. In the case of COW however, we did not
flush the copy-on-write when transferring control to the client, and
thereby we could capture the modified contents.
Bugzilla: https://bugs.kde.org/show_bug.cgi?id=340202
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90836
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
commit d1bf75f155
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Jun 1 08:56:43 2015 +0000
sna: Compilation fixes for stable distros
caused an apparent regression by using the wrong ring for detecting
whether we could program the BCS tiling registers.
Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
commit d1bf75f155
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Jun 1 08:56:43 2015 +0000
sna: Compilation fixes for stable distros
set the flag incorrectly - only future Xorg will do the damage
application itself.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When using a fixed mode, e.g. a Display without RandR support like
Xnest, we have to remember to hook up the connection during
recofiguration of VIRTUAL outputs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we find that the kernel has more active CRTC than we successfully
enable, something is amiss and more importantly we are leaving an
existing active CRTC blank. As a failsafe, if we detect this, fallback
to doing a full probe for the initial configuration.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we have no fence, we then try to discard the tiling. However, the
change_tiling routine assumes that it is only called when a change is
actually required. Make it so for dri2.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As a consequence of using GPU swizzling without telling the kernel is
that we must disable GTT access -- especially if we already have a
linear mmapping.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
On gen4+, we no longer need to setup a fence for tiled operations and so
can program the GPU irrespective of the kernel tiled settings. However,
this means that we then cannot access the object through a GTT mmapping
(as we have no fence to do detiling) and nor can we use a WC mmap as the
swizzle is unknown.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We have to ignore the return value of the pitch for untiled 2D surfaces
(since the kernel clears the tiling stride parameter).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>