summaryrefslogtreecommitdiff
path: root/src/sna/kgem.h
AgeCommit message (Collapse)Author
2014-10-31sna: Retire all requests when a bo is found to be not busyChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-29sna: Reuse the same fence until retiredChris Wilson
In order to reduce the number of breadcrumbs the kernel must emit to track our batches, reuse the last query until it has retired. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-21sna: Avoid pwriting large batchesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-08sna: Avoid u16 underflow when computing reserved batch spaceChris Wilson
If we filled the batch exactly, then subtract -1 for the reserved BATCH_BUFFER_END, it would underflow to a large value - convincing us that we had sufficient room to stuff many, many more commands in. However, all the callsites should be guarded by checking already that they had sufficient space to emit at least one operation... References: https://bugs.freedesktop.org/show_bug.cgi?id=77074 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14sna: Do not force creation of a linear GPU bo that we don't wantChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-02sna: Restrict fencing to only use the low 256MiBChris Wilson
Somce early machines have 512MiB apertures, but we can still only use the low 256MiB for fencing. Separate out the mappable restriction checks from the fencing in order to further constrain those devices. Reported-by: Matti Hämäläinen <ccr@tnsp.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-23sna: Disable rendering with the DRM device whilst away from VTChris Wilson
As root, X gets away with many things, including submitting commands to the DRM device whilst it is no longer authorised (i.e. when it has relinquished master to another client across a VT switch). In the non-root future, if we attempt to use the device whilst unauthorized the rendering will be lost and we will mark the device as unusable. So flush our render queue to the device around a VT switch. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-29sna: Tidy calling memcpy_from_tiledChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-23sna: Inject a batch flush before adding a fresh boChris Wilson
Fresh bo (those without a reservation already defined, ala presumed_offset) will cause the kernel to do a full relocation pass. So, if possible flush the already correct batch in the hope of trimming the amount of checking the kernel has to perform on this new batch. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18sna: Assert that we do not try to mmap a proxyChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13sna: Track the pageflip bo's busynessChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-06sna: Auto-retire upload proxiesChris Wilson
This was disabled in commit 9f4f855ba37966fb91d31e9081d03cf72affb154 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon May 26 07:06:18 2014 +0100 sna: Implicit release of upload buffers considered bad as retiring the buffers during the command setup could free one of the earlier bo used in the command. But discarding the snooped bo could still be advantageous. So restore the automatic discard of upload proxies, but make sure we only do between operations. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Matti Hämäläinen <ccr@tnsp.org>
2014-06-05sna/dri2: Enable immediate buffer exchangesChris Wilson
The primary benefit of this is avoid the extra blit when using a compositor and instead propagate the compositor flip on the frontbuffer to the scanout, or equivalently allows a fullscreen game to flip onto the scanout without intervention by TearFree. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-03sna: Allow replacements to cancel operations between both bo under a PixmapChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-02sna: Add support for DRI3Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-02sna: Add DBG hints for using inplace CPU mmappingsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-30sna: Do not allow imported buffers to be cachedChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-30sna: Unexport kgem_get_unique_id()Chris Wilson
This should always be set during bo creation Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-26sna: Implicit release of upload buffers considered badChris Wilson
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>
2014-05-14sna: Add some DBG to track rogue requestsChris Wilson
In particular allow the pointer cache to be disabled for valgrind. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-12sna: Only couple up a proxy->rq when inserting into the request->buffers listChris Wilson
Otherwise, we may never decouple it again afterwards leading to a dangling pointer dereference. Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1289923 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-04sna: Rearrange assertion to ease use of substitute cached boChris Wilson
Since we call kgem_bo_submit() along one path when synchronising a cached bo (which is known to be inactive) but still want to keep the assertion on the refcnt, simply rearrange the code to only assert on the active path. References: https://bugs.freedesktop.org/show_bug.cgi?id=73406 Reported-by: Matti Hamalainen <ccr@tnsp.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-01sna: Allow more inplace promotions of CPU to GPU boChris Wilson
If the CPU bo is wholly damaged, then it makes an ideal candidate for simply converting into the GPU bo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-17sna: Cull the DBG spew to stderrChris Wilson
Reduce the logging verbosity of DBG so that it only appears in the logfile by default - makes debugging much more pleasant. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-08sna: Simplify kgem_bo_can_map()Chris Wilson
Remove the attempt to trick us into mapping large bo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-02sna: Drop forced alignment to 64 on pre-gen4 devicesChris Wilson
Some linear GPU bo that we create must be naturally aligned, and the extra alignment imposed for pure paranoia is counter productive. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-27sna: Add a few more refcnt assertsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-06sna: Trim the overestimate of required aperture space for fence alignmentChris Wilson
We can optimistically only require that we waste the largest fence region in a batch, as all other fences will then be naturally aligned as well. So long as the kernel succeeds in defragmenting the aperture... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-05sna: Use an inplace exchange for large untiled BOChris Wilson
On older architectures, large BO have to be untiled and so we can reuse an existing CPU bo by adjusting its caching mode. References: https://bugs.freedesktop.org/show_bug.cgi?id=70924 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-04sna: Update DBG formats for larger BO offset integersChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-02sna: Eliminate the redundancy between is_mappable/can_mapChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-02Prepare for changes in the BLT unit on future generationsChris Wilson
Adapt the legacy BLT commands in preparation for future changes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-01sna: Guard the replace-with-xor fallback pathChris Wilson
Before attempting to map the destination for uploading into after a failure to use the BLT, we need to recheck that it is indeed mappable. References: https://bugs.freedesktop.org/show_bug.cgi?id=70924 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-01sna: Scale uses of aperture_mappable by PAGE_SIZEChris Wilson
After converting aperture_mappable to count in pages, there were a few residual users expecting a byte count. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71117 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-31sna: Tweak deletion of used buffersChris Wilson
Make sure we never unwind a used buffer. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-29sna: Try harder to complete writesChris Wilson
Expunge our caches if we fail to write into a bo (presuming that allocation failure is the likely fixable cause). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-21sna: Tweak opportunistic flushing to reduce power consumptionChris Wilson
When trying to conserve power, reduce the number of small batches we emit - trying to maximise GPU efficacy and minimise CPU overhead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-29sna: Apply the non-relaxed fencing partial paranoia everywhereChris Wilson
This is required to ensure that the tiled offsets are tile-row aligned. Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1232546 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-23sna: Track CPU/GTT maps independentlyChris Wilson
Now that we use CPU mmaps to read/write to tiled X surfaces, we find ourselves frequently switching between CPU and GTT mmaps and so wish to cache both. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-10sna: Disable use of Y-tiling for gen4Chris Wilson
This problematic GPU still seems to like to fallover when faced with Y-tiling. It was reserved only for use with glyphs, but even that occasionally runs into trouble, so disable all selection of Y-tiling for our own use. Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1222203 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-03sna: Add some more DBGChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-18sna/gen6+: Tweak semaphore avoidance for composite operationsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-14Correct misspelled cachingSedat Dilek
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
2013-08-09sna: Rewrite the can-mmap-cpu test to handle stolen unclaimed boChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-04sna: Mark the entire userptr proxy chain as flush/non-reusableChris Wilson
Fixes cache bookkeepping when mixing userptr uploads. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-02sna: Reserve relocation entries for the deferred VBOChris Wilson
Whilst we reserved exec entry slots for the deferred VBO, there were no relocation spaces reserved. So if we submitted a render command followed by a multitude of BLT copies, we could then overrun the relocation array when adding the deferred vbo to the batch. Reported-by: Danny <moondrake@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67504 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-31sna: Relax readback constraint for CPU mappings of scanoutsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-31sna: Fix interaction between WT mapping of scanouts and allocating from stolenChris Wilson
If we allocate the scanout from stolen, we cannot then access it via the CPU - so prevent the mapping in those cases. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-30sna: Allow CPU access to scanouts if WT cachedChris Wilson
On Iris, we may store the framebuffer in the eLLC/LLC and mark it as being Write-Through cached. This means that we can treat it as being cached for read accesses (either by the GPU or CPU), but must be careful to still not write directly to the scanout with the CPU (only the GPU writes are cached and coherent with the display). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-17sna: Include linear GTT maps when deciding whether a bo is mappableChris Wilson
If the linear bo is still in the CPU domain, we can map it through the CPU with no penalty, so treat it as mappable. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>