summaryrefslogtreecommitdiff
path: root/src/sna/sna_accel.c
AgeCommit message (Collapse)Author
2014-06-23sna: Allow scratch pixmap to allocate linear GPU boChris Wilson
When allocating a scratch pixmap, we do so in the expectation that rendering on the GPU is always preferrable, so even allocate a small linear bo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-23sna: Promote to full GPU bo after forced migration away from CPU boChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-23sna: Prefer rendering on the CPU to avoid damage migrationChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-23sna: Force creation of GPU bo for drawing if need beChris Wilson
Now that we are more eager to transfer to the GPU bo if we expect rendering to the CPU bo to be either slow or risk potential corruption, we can find ourselves in a recursive loop when we also decide not to create the GPU bo. Prevent that by explicitly creating the GPU bo if desired. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-23sna: Allow the CPU bo to be created if GPU rendering is forcedChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-23sna: Prefer to render over damage into the GPU boChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-23sna: Do not set CAN_CREATE_GPU flag for untiled allocationsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-23sna: Rename IGNORE_CPU to IGNORE_DAMAGE to better reflect its purposeChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-21sna: Discard write hint from a couple more move-to-gpuChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-20sna: Avoid blending with the render engine on snoopable boChris Wilson
This seems slightly weird, as there is nothing to indicate that this would generate incorrect results only for snoopable bo. But no many of flushes make my pnv box happy, so adjust the placement logic to move the blending operation away from the snoopable target. This is sensible for reasons of avoiding snoops from the render pipeline anyway. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80253 Reported-and-tested-by: Matti Hämäläinen <ccr@tnsp.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-20sna: Be more flexible in converting random subsamples to 8x8 tilesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-20sna: Mark up const boxes to keep the compiler happyChris Wilson
Pass around const to suppress a few compiler warnings. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-20sna: Feed more operations into the 8x8 BLT tilerChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-20sna: Mark upload from SHM segment as read-onlyChris Wilson
As this may be mapped by the Xserver using a read-only SHM segment, we are forced to treat it always as read-only. And this being X, that it is using a SHM segment is opaque to the driver. Fantastic middlelayer. This was incorrectly removed in commit e680e54eab6ffa72e5e1eb6cc0e3fe4b235b06a1 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Jun 11 10:48:26 2014 +0100 sna: Ignore setting read-only for temporary userptr maps Also let's not forget the ShmPutImage -> CopyArea path. Reported-by: Christoph Haag <haagch.christoph@googlemail.com> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78411 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19sna: Mark upload from SHM segment as read-onlyChris Wilson
As this may be mapped by the Xserver using a read-only SHM segment, we are forced to treat it always as read-only. And this being X, that it is using a SHM segment is opaque to the driver. Fantastic middlelayer. This was incorrectly removed in commit e680e54eab6ffa72e5e1eb6cc0e3fe4b235b06a1 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Jun 11 10:48:26 2014 +0100 sna: Ignore setting read-only for temporary userptr maps Reported-by: Christoph Haag <haagch.christoph@googlemail.com> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78411 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19sna: Missed fixing y tile offset in last commitChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19sna: Use the right pattern origin for tiled 8x8 extractionChris Wilson
References: https://bugs.freedesktop.org/show_bug.cgi?id=80033 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19sna: Fix up small extents for 8x8 tile constructionChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19sna: Wrap pointer access for 8x8 tile constructionChris Wilson
The kernel can quite happily send a SIGBUS whenever we read from an bo (due to oom), so catch it and handle it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19sna: Always readback shadow damage after replacing the bufferChris Wilson
Instead track what we explicitly want to discard for the next operation, so that we don't have to copy back the whole buffer if we have to replace the shadow and intend to overwrite it all. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18sna: Fix modulus for partial conversion of tiles to 8x8 patternsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18sna: Delete the silly typoChris Wilson
Not checking DAMAGE_IS_ALL() correctly leads to an assertion failure. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18sna: Do not treat both src/dst having no clones as being the sameChris Wilson
Fixes regression from commit 62aaf2ff4f8597067cf387865707baa00ed9a123 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Jun 18 18:41:15 2014 +0100 sna: Skip redundant copies when already cloned Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18sna: Skip redundant copies when already clonedChris Wilson
References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18sna: Use nxm tiled blits for small regions of large tilesChris Wilson
If the region we are blitting is either narrow or short, we may be able to construct a tiling pattern out of a large pixmap. In the process, spot a regression due to commit 542aeca6e67fc64f9133ca3e27ac8eca28af6d25 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Tue Jun 17 12:26:30 2014 +0100 sna: Tweak creation 8x8 tiled patterns which copied too much from the source line. References: https://bugs.freedesktop.org/show_bug.cgi?id=79888 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-18sna: Simplify sna_pixmap_get_sourceChris Wilson
kgem_bo_upload_image was open-coded, so replace it with a call to the common function Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17sna: Set the correct mapping type after calling mmap__asyncChris Wilson
References: https://bugs.freedesktop.org/show_bug.cgi?id=80001 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17sna: Fix computing source bo for BLT operationsChris Wilson
If we migrate the pixmap to the GPU, use the GPU bo. This may fix an issue where we might end up using the CPU bo in a rare circumstance. References: https://bugs.freedesktop.org/show_bug.cgi?id=80033 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17sna: Align some function parametersChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17sna: Cache small pixmaps rather than forcing a large fallback for BLT operationsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17sna: Relax PREFER_GPU so that we don't needless create small GPU boChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17sna: Tweak creation 8x8 tiled patternsChris Wilson
Avoid reading back from a GTT mmapping. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17sna: Add a few missing checks for all-damagedChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-17sna: Discard GPU damage for the magic upload proxyChris Wilson
The magic upload proxy is initially considered damaged in both the GPU and CPU. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16sna: Clear our private hints about front rendering exported boChris Wilson
Unlike GLXWindows, GLXPixmaps are rendered directly into, without a staging copy. Therefore we must treat those carefully when exported and clear our hints everytime control passes back to the Client. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79999 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-14sna: Fix assertions for discarding upload cachesChris Wilson
The upload caches are special, along with having a bo->proxy, they also claim to be completely damaged on both the GPU and CPU. Allow that to pass through when discarding the proxy. Reported-by: Nick Bowler <nbowler@draconx.ca> Bugzilla; https://bugs.freedesktop.org/show_bug.cgi?id=79992 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13sna: Use the right is-clipped hintChris Wilson
The region here has yet to be clipped, and so the only valid is-clipped hint is from the flags computed from the PolyRect extents. Make sure we use those when determining whether it is valid to discard damage. Fixes regression from commit ad0390068832ad4727371902fe41a85a53de1894 [2.99.903] Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Tue Sep 24 10:00:03 2013 +0100 sna: Separate out copy preferrence from operating in place decision Reported-by: Nick Bowler <nbowler@draconx.ca> Tested-by: Nick Bowler <nbowler@draconx.ca> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79992 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13sna: Only discard the CPU bo if we have a GPU bo to transfer the damage toChris Wilson
References: https://bugs.freedesktop.org/show_bug.cgi?id=79992 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13sna: Reorder ignore_cpu_damage() to avoid assertsChris Wilson
Tricksy asserts making sure that the correct arguments are passed around! Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-12sna: Try to use CPU uploads before BLT uploadsChris Wilson
As the BLT upload implies a sync (and a likely GPU boost), only do so if we cannot do an immediate upload with the CPU, either directly to backing memory or through the GTT. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-12sna: Refactor USE_INPLACE debug macroChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Remove bogus assertionChris Wilson
The sna_pixmap is cleared afterwards, it does not need to be clear on free. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Fix direction flags for memmoveChris Wilson
Under a compositor, the current deltas may invert the sense of the copy direction, causing scrolling corruption. Simplify handling those flags by making them invariant for the function. Reported-by: Bruno Prémont <bonbons@linux-vserver.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79843 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Use the pixmap header creation routineChris Wilson
A few more places could use the common pixmap creator, just remember to handle the SHMPixmap complication! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Remove debugging hunkChris Wilson
Stray hunk in self-copy boxes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Update damage pointer after the implicit reductionChris Wilson
sna_damage_contains_box() routine implicitly reduces the damage before performing its check. This may alter and even destroy the damage entry, so pass in the handle so that it can be updated correctly. References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Tweak self-copy boxes to hit the GPU more oftenChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Ignore setting read-only for temporary userptr mapsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Prefer to operate inplace on the GPU rather than stall on the CPUChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Discard TearFree damage before checking for an overwriting uploadChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>