kgem.c: In function '_kgem_submit':
kgem.c:3243:12: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
write(fd, kgem->batch, batch_end*sizeof(uint32_t));
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The path of last resort is meant to reuse the first scanout bo if they
all busy (since it will be the oldest). It chased a dangling pointer
instead.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we can CPU mmap the GPU bo, prefer to do so for migration to the CPU
as this saves an extra serialisation step.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Fix up all the warnings about implicit enum conversions. The
container_of() macro remains defunct.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When scaling the output, we re-render onto the scanout using a call to
Composite, for which we create temporary Pictures. In most cases, the
mismatching depth/format goes unnoticed, but along one particular
fallback path, we use those to create a new Picture but the mismatching
format results in a segfault.
Reported-by: Matti Hämäläinen <ccr@tnsp.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79320
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Scaling the output feed in an invalid picture->format/depth combination
which causes the fallback downsampling function to explode. Whilst this
is a bug in the higher layer, we can handle the error anyway.
References: https://bugs.freedesktop.org/show_bug.cgi?id=79320
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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]