The API changed again in the RC, so update to keep the compiler quiet.
At the same time, protect against the ARGB_CURSOR struct changes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The scanout is a global property, track it as so. The primary benefit to
this is it strengthens our assertions that we never hand out an active
scanout for use as a back buffer.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we defer the reallocation of the backbuffer until the client requests
the set of current buffers (with GetBuffers), then we can often avoid
allocating the fresh backbuffer as the flip often retires before the
client is ready.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Currently upload buffers are automatically decoupled when the buffer is
retired. As retiring can happen during command setup after we have
selected which bo to render with, this can free the bo we plan to use.
Which is bad.
Instead of making the release of upload buffers automatic, we manually
check whether the buffer is idle before use as a source to consider
scrapping it and replacing it with a real GPU bo. This is likely to keep
upload buffers alive for longer (limiting reuse between Pixmaps but
making reuse of the buffer within a Pixmap more likely) which is both
good and bad. (Good - may improve the content cache, bad - may increase
the amount of memory used by upload buffers for arbitrary long periods.)
Reported-by: Matti Hämäläinen <ccr@tnsp.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79238
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Now that we do not preallocate the storage for the chain in the Window
devPrivates, we need to check for an allocation failure.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The code is more readable directly updating the private rather than
hiding the pointer chasing through the opaque lookups.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The target_msc supplied by the client is required to be monotonic. Since
the client does not know which CRTC the window is on, they do not
control from which pipe we derive the MSC, and so we need to adjust the
hardware values such that the client only ever sees a monotonic value.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we compute that we want to flip on the next frame, queue it
immediately rather than take a round trip through the kernel and risk
missing the vblank.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Now that we store the information for the swap completion on the CRTC,
we don't need to pass it around inside the frame event.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Rerun a detection cycle after claiming the virtual output so that it is
hidden again.
References: https://bugs.freedesktop.org/show_bug.cgi?id=78293
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Avoid casting down to 32bits at the begining of the calculation to only
then compare against the full 64bit values later.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we have a queue of events, we may set the msc from a recent vblank
query only to then process an older vblank event and declare the counter
wrapped.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Broke during code motion in
commit add84cd8a8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri May 2 13:21:02 2014 +0100
sna: Perform dynamic connector discovery
Reported-and-tested-by: Jay Little <jaylittle@jaylittle.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79015
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If some outputs go away we race with this call and apps
get X errors and fall over. Do what SNA does and don't
bother trying.
Signed-off-by: Dave Airlie <airlied@redhat.com>
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>