Clients are not yet ready for outputs that disappear at runtime, often
unexpectedly dieing with asynchronous BadOutput errors. A simple
workaround is to not remove any output just yet - but allow users to opt
in via xorg.conf, i.e.
Section "Device"
Option "DeleteUnusedDP12Displays" "true"
EndSection
The name chosen is to be consistent with the nvidia driver, which did
MST first and encountered all of these issues first, and has also been
adopted for -modesetting. If this is combined with persistent output
naming (i.e. based on DisplayPort branch topology), the number of
outputs presented to the user should be static.
Instead of removing the outputs, we have to mark them detached instead
to avoid throwing errors from the kernel.
Based on the patch for -modesetting by Dave Airlie.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If valgrind is running, keep it simple and avoid using unknown
instructions (causing valgrind to die with SIGILL).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
An addition to DRI2 that was overlooked at the time, was the support
added for having multiple outstanding swap requests in the core. The
importance of this is that we can then send the SwapComplete reply after
the pageflip is completed and not before as we currently do to fake
triple buffering - in clear violation of OML_sync_control.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When switching back to the VT, rerun the output discovery (if such an
event was pending) before we attempt to set the desired modes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we keep the separate discovery uevent, we need to run it first in the
cases where we get combined discovery+hotplug events.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We need to preserve possible_crtcs for the later check that we can use
the output with the particular ZaphodHead (which owns a CRTC).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In the future, we may see a setup where connectors are created without
being attached to a specific encoder, instead associated with multiple
generic encoders - such as DP MST sink devices. To handle this, we need
to recheck their active encoder at runtime after branch configuration
events (or possibly hotplug).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we remove a connector/output, we need to not advance the iterator or
else we skip over an output (as the array is reduces inside the loop).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the output was ignored, we would leak the allocations. However, we
can check the output name after the first GETCONNECTOR/GETENCODER
request before any allocations.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
From OML_sync_control:
"The graphics MSC value is incremented once for each screen refresh.
For a non-interlaced display, this means that the graphics MSC value
is incremented for each frame."
When the pipe is disabled, return the last known MSC such that the
reported value is always monotonic and consistent with the pipe when it
is active again. That also is consistent with OML_sync_control which
says that the MSC is a vertical refresh counter, and by implication does
not increase whilst the pipe is off.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the drawable is even partially on the PrimaryOutput, use that pipe
for determining synchronisation counters and synchronised updates.
OML_sync_control:
"For a multi-monitor system, the monitor used to
determine MSC is screen 0 of <display>."
The PrimaryOutput is the nearest approximation we have to "screen 0". We
also deviate in handling what hapens when that screen is off, which is
not mentioned at all in OML_sync_control.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Ideally, we want to assert that we have sufficient stashed cursors to
allocate for the unused CRTCS, so something like
assert(num_stash + num_active_cursors >= 0);
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
One of the side-effects of MST is that we need to support dynamic
attachment and removal of displays as the branch hierachy changes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In the near future we will be dealing with dynamic discovery of
connectors, and so we cannot assume that the mode resources will be
static for our lifetime. The first step is to not keep that struct
around, but pull out the useful information and discard it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The major change here is not do a full promotion if we are filling
through a clip region. The original intention was to catch doing the
initial clear of the background, but it was also triggering for drawing
rectangular outlines etc.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The BLT paths are only taken when we know we are overwriting the target
contents, and so we do not have to worry about reads along those paths.
However, in terms of migrating the damage for a pixmap, we have to be
careful in case we do not write to the full area of the composite
rectangle, in which case we have to treat it as a read to that area and
migrate the damage.
Regression from
commit a13781d19d [2.20.10]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sun Aug 19 09:45:12 2012 +0100
sna: Enable BLT composite functions to target CPU buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-by: Matti Hämäläinen
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we are overwriting part of the framebuffer, we know we do not need to
read that portion back from the scanout.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
A side-effect of the workaround for incoherent physical cursors is that
we never reused a cursor after disabling. As such moving the cursor off
the pipe and back on would eventually consume all the preallocated
structs leading to a segfault.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78002
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
commit 534a0e6433
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Apr 28 07:53:13 2014 +0100
sna: Factor in destination sizes for choosing intermediate tiling bo size
assumed that the target bo was being initialisation for the tiling
composite; it was not.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we cross the high water mark, first flush the batch, then check the
remaining pages to see if they fit into the aperture.
Reported-by: Bruno Prémont
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When tiling, factor in the destination usage of the aperture in case
that reduces the available aperture for the intermediate bo.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We need to avoid all allocations within the signal handlers, so
preallocate the cursor structs.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77975
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We need to avoid all allocations within the signal handlers, so
preallocate the transfer buffer.
References: https://bugs.freedesktop.org/show_bug.cgi?id=77975
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>