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 fail to disable the remote output during initialisation, copy the
current configuration in order to try and keep the bookkeeping in order.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In order to prevent a subsequent BadAccess when we try to use it as a
ShmPixmap, we need to mark the segment as writeable.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
References: https://bugs.freedesktop.org/show_bug.cgi?id=78293
Creating a ShmPixmap may cause an asynchronous BadAccess error, so wrap
the construction with XSync and check for an error before proceeding.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
References: https://bugs.freedesktop.org/show_bug.cgi?id=78293
Only mark an output as disabled if we do successfully disable it. This
will require a little more work to make sure that such errors are
cleanly propagated back to the host...
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>
We can update the priv->cpu flag more accurately by accounting for the
early exits for the INPLACE accessors.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
On older architectures, we can only do the inplace upload into a GPU bo
into a new unused bo (that is still in the GPU domain).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If an overlay video (using the sprite interface) is visible on multiple
outputs, we have to create and show a sprite for each.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77802
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>