In order to keep our sanity checks and buffers in order, we need to
remember to mark the new frontbuffer as the active scanout after an
asynchronous pageflip.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Internally we only use 32bits for limiting the maximum object size
(both for CPU and GPU allocations) so to prevent overflow limit the
reported aperture size.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_driver.c: In function 'sna_handle_uevents':
src/sna/sna_driver.c:759:2: error: implicit declaration of function 'fstat' [-Werror=implicit-function-declaration]
Also take the opportunity to include udev support in the configure
summary.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Missing trim of "add 0" from
commit 0b7a6666f8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Jan 5 14:00:44 2015 +0000
sna: Partially unroll conversion of rectangles to boxes for fills
not all redundant +(dx,dy) were dropped.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Converting from
switch(value)
{
case 1: return 1;
...
default: return -1;
}
you must remember to insert the breaks!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As the output configuration rarely changes, and is normally accompanied
by a hotplug event, we can cache the last probe for a small number of
seconds. If a hotplug event does fire, in the worst case by the 30s
output polling thread, then we reset the cache and force the probe. This
should improve application (and desktop) startup times as they often
seem to do many full xrandr probes (rather than query current status).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Copying the bool is_level() without including stdbool.h causes it to not
compile on some machines. Just convert back to the old faithful Bool.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The criteria for adding the modes is not associated with panels and
edids, so the name is quite misleading. We add any missing default modes
if we have a panel fitter and the output itself has not declared them
(via its EDID).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
event_id is now an array - but the misprint was hidden on 64bit systems,
the warning only apparent because of the pointer mismatch on 32bit
systems.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We only want to prevent sharing of physical handles across CRTC (on old
kernels). If we already have one assigned to a CRTC we know that it is
unshared and can keep using it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Using xcb, we cannot simply call xcb_dri3_query_version() without it
terminating the connection if DRI3 is not enabled on the target display.
Oops.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89172
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Remember vblanks are private to a CRTC, the same MSC on another CRTC may
fire at completely different times...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Try to avoid more clflushing on the current Pixmap if we have a
scanout-ready bo in the cache. We also note that since we unflip before
any other drawing takes place, we do not need to mark the flipped Pixmap
as being pinned to the scanout.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we have multiple events for the same vblank, append the notification
to an existing vblank. This is particularly useful as we it ensures that
we then report notifications in the same order as queued.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
At times, we want to clear pending flips from inside TearFree, and thus
need to disable recursion. Currently we dance with shadow_damage, but
now we can just migrate over to using the shadow_enabled flag.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Modifying the flag may cause havoc if we need to modeset whilst Present
is in control as the CRTC will be setup without reference to TearFree, but
then when Present unflips, we restore the stale configuration. So let's
have a separate flag just to disable TearFree flips when a Present flip
chain is active.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Following on from the previous attempt is the realisation that we can
simply disable TearFree during a Present flip queue, and re-enable
TearFree upon unflip.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
These two don't mix, so remove the claim that we do support async flips
when TearFree is enabled.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The Damage layer is slow, so reduce the amount of work it has to do by
explicitly throwing away any information other than the bbox.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
For the duration of the Present flip chain, replace our frontbuffer with
the Client's Pixmap. Before any attempt to draw into the real
frontbuffer, Present will unflip back to the TearFree front+shadow.
However, it does give the Client direct access to the scanout through
their Pixmap (effectively disabling TearFree on behalf of the Client).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the intention was to filter the return values from the kernel, the
filtering would have been applied to the kernel values and not to the
incoming values from Present. This filtering introduces crazy integer
promotion and truncation bugs all because Present feeds garbage into its
vblank requests.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>