We rely on the reference pipe to drive the event wake up. If we issue a
deferred flip, there is a chance that the user could rearrange the
screen on another crtc whilst otherwise preserving the screen geometry.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
While fixing up UXA for MST I eventually fell over this bug.
Signed-off-by: Dave Airlie <airlied@redhat.com>
[ickle: replace constant with macro to track pipe-dependent code]
When the RandR shadow buffer is enabled we set the sna_crtc->transform
flag. We set the crtc->transform_in_use only when coordinate transforms
are required - i.e. we may enable the shadow buffer if a CRTC is out of
bounds, but otherwise has no transformation. That confused the asserts.
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Many loops only want to walk the real CRTCs, so update the loop bounds
to be explicit and assert that they are the real ones.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This saves us from trying to optimise for an operation that cannot
happen as we cannot replace the destination buffer.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We stash the pending flip mode into the closure, but failed to copy that
over to the right field when continuing with a chain of flips. The
impact was that we would fail to issue the required SwapComplete to
unblock the clients.
Fixes regression from
commit 96ce362ba4
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue May 13 09:46:45 2014 +0100
sna/dri2: Do not rate-limit vblank=0 swaps
Reported-by: francisbrwn
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
By using move-area-to-gpu and specifying that we overwrite the target
area, we can optimize away any needless damage migration.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This is fortunately a no-op, as it gets initialized to zero already
(that is the pixmap is writeable). However, we may as well do the right
thing...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Copied from kernel commit 7d87a7f709650bde4d7d63117f25ee1c095da5dd
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date: Wed Apr 9 18:19:04 2014 +0300
srm/i915/chv: Add Cherryview PCI IDs
and also includes non-functional changes from
commit fd3c269f8ff940cc0fbb3b7f7e84c0572f6f759a
Author: Zhao Yakui <yakui.zhao@intel.com>
Date: Thu Apr 17 10:37:35 2014 +0800
drm/i915: Split the BDW device definition to prepare for dual BSD rings on BDW GT3
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Avoid busy-spinning waiting for the cache to expire after a failure. Try
to free up any overdue expiration, then if we still fail, we free the
entire cache. Currently, it would spin over the expiration until all
items were overdue and then freed.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
OML_sync_control:
If there are multiple outstanding swaps for the same window, at most
one such swap can be satisfied per increment of MSC. The order of
satisfying outstanding swaps of a window must be the order they were
issued.
The only challenge is to keep both this behaviour and vblank_mode=0
benchmarking.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we complete a flip after resizing and recreating the TearFree shadow,
we may process the flip completion events whilst the output is only
partially reconfigured.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We have to open-code kgem_bo_is_busy() in order to avoid prematurely
retiring the rq->bo. The unfortunate outcome here is that the bo may be
recycled for a new batch before it is finally released from the request.
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
GetDrawableMSC is specified as returning the frame counter and timestamp
of the last flip event associated with the drawable, not the current
hardware timestamp.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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 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>