In commit 961139f587
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri May 30 09:45:15 2014 +0100
sna: Use manual detiling for downloads
the code for deciding when to use the GPU was refactored into a new
function that also performed the transfer, but failed to notice the
early return.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The other half of the commit that accidentally got included with
commit bb49222a51
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Jun 2 08:25:52 2014 +0100
sna: Add DBG hints for using inplace CPU mmappings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Make sure we can compile against the pre-release tarballs at the expense
of an innocuous compile warning if compiled against xserver.git
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This refactors the drm interrupt handling logic quite a bit, both to
allow for either DRI2 or Present handlers, but also to eliminate
passing pointers through the kernel. Passing pointers left the kernel
holding the only reference to some internal X server data structures.
After a server reset, the X server would end up using stale pointers
stored in those structures. Using simple integers makes it possible to
empty the queue of pending interrupt data and then ignore the stale
kernel data.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
The kernel sometimes reports bogus MSC values, especially when
suspending and resuming the machine. Deal with this by tracking an
offset to ensure that the MSC seen by applications increases
monotonically, and at a reasonable pace.
Also, provide a full 64 bits of MSC value by noticing wrapping and
tracking the high 32-bits of MSC separately.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Conflicts:
src/uxa/intel_dri.c
Only force the even-tile-row alignment if we have an old GPU with an old
kernel that doesn't perform conservative alignment for us (as required).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This is a simple little test to create a pixmap from a local bo, copy it
to a normal pixmap, then read it back by importing it into anther local
bo. It tests the fundamental mechanisms of opening a DRI3 render device,
importing into pixmaps, exporting into /buffers and a read-barrier.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If a flip fails, attempt to restore the previous working configuration
(using a modeset) then disable further flipping.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
OML_sync_control mandates that MSC must be monotonic, so if the kernel
reports that they go backwards, lie.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the flip is already completed before we finish the previous flip, the
drawable has been replaced already and we can unchain the flip queue.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We use the GT level to decide how favourable it is to use the GPU in
various circumstances, now set it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>