Whilst the outputs are hidden, if we want to disable a CRTC, we want to
manipulate the hidden counter as opposed to current front_active
counter.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When computing the delay for the fake flip, compensate for any time
elapsed since the last frame in order to hit the desired vblank more
accurately. A side-effect of this is that we may now compute 0 delay
timers which require special handling.
Testcase: present-test/accuracy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Allow a request to swap on the next frame to be considered by the
immediate handling code by refactoring the target msc computation.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we swap between Clients, or even Windows, then we may have a flip
still pending completion in hardware but no longer tracked in order to
release the freed state. In this scenario, queue the flip via a vblank
event.
Testcase: dri2-race with non-immediate flips
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In order to have outstanding WaitMSC when the Client quits or the Window
is destroyed, we need to use the xcb version so as not to immediately
block on the play.
And also print keepalive dots to console as test progresses.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When the xserver is fixed and we no longer block for ever inside the
test, we can see that the test itself falsely reports failure!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
During flip failure recovery, we try to queue a second flip in order to
generate the flip completion event. If that fails, we need to abort the
flip entirely.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The kernel caps the number of vblanks per client to 128. There are
already reports from the wild that Present clients are running foul of
that limit, so supplement it with a timer fallback.
Testcase: present-test with future flips
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The executive decision has been made to render DRI2 inoperable with
render-nodes, so keep on passing the master device path to clients.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When converting from a Pixmap into a Solid, we need to remember to
convert from the stored pixel format into the a8r8g8b8 used by the solid
fill.
This was exposed by
commit aef2f99d05
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Feb 3 21:31:16 2015 +0000
sna: Convert CompositeRectangles ADD white to SRC white
but is a regression from
commit 31a4c7bc13 [2.99.912]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Apr 4 10:46:48 2014 +0100
sna/gen2+: Replace composite sources with solids where possible
Reported-by: andrew@atomspring.com
Reported-by: Matti Hämäläinen <ccr@tnsp.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89030
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we apply the mask clipping first, we can be sure that the samples are
all from an untransformed mask and so we can check the is-clear? hint.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
During incremental clipping of the trapezoids, we can assign the end
BoxPtr to begin, and so we should be careful not to dereference that
pointer (as it points passed the end of the clip boxes).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The end BoxPtr actually points to one past the end of the clip boxes, so
in order to inspect whether the line is after the clip region, we want
to look at the last box, i.e. the box before. We also only want to
ignore the clip if we do not intersect at all, otherwise we need to find
the start of the clip row.
Reported-by: Matti Hämäläinen <ccr@tnsp.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In order to handle PRIME offscreen Windows nicely, tie their
presentation into the Primary CRTC (if available).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If possible, we want the restoration of the Screen Pixmap to be fast,
and so we want to preferably use the immediate asynchronous flip.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Present checks for a flip-compatible Pixmap prior to deciding whether to
queue the flip after a pending flip, and at that point we do not want to
reject a potential flip due to outstanding flips. That is only of
restriction only applies when we request the kernel to perform the flip,
so more the check to the corresponding position.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Using the same member as both an override and a cache in different
modes leads unsurprisingly to confusion.
Fixes regression from
commit 3cfde9f043
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Jan 13 13:50:08 2015 +0000
sna: Only instantiate the frontbuffer on the GPU if used
Reported-by: Chris Bainbridge <chris.bainbridge@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89007
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Within a span, we have the advantage of knowing that we only need to
intersect one box with the clip region, and that box has monotonically
increasing y. This avoid having to compute RegionIntersect for every
span element which was very slow (e.g. libreoffice).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
For reads, we can use the existing clone -- except if the migration is
required to return a unique GPU handle to the pixmap.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As we cannot propagate the failure for unflipping back to the caller, we
must ensure that the CRTCs are correctly reset if the attempt to flip
back to normality fails.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This captures a bug in transitioning from gdm to gnome-shell where the
present_unflip copy back onto the Screen Pixmap fails.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We always try to make sure the scanout is initialised before use, but if
the GPU is wedged we need to fallback to use the CPU to do the clears.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Rather than synchronously wait in the unflip for the pageflips to complete
by forcing the modeset, try to queue the unflip to happen after the pending
flip completes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>