summaryrefslogtreecommitdiff
path: root/src/sna/sna_render.c
AgeCommit message (Collapse)Author
2019-09-19sna: Annotate more fall throughsVille Syrjälä
Sprinkle fall through comments where needed. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-04-04sna: Always sync before using mmap pointers in memcpy_copy_boxesChris Wilson
kgem_bo_map__(cpu|gtt) leaves the sync up to the caller, in particular so that the obtaining the pointer and controlling the cache domains are not conflated and can be separated. However, it does mean that the caller can not assume that obtaining the pointer updates the cache domains, as it does not. memcpy_copy_boxes fell into this trap. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-02-07sna: Switch from ifdef PICT_ to if XORG_VERSION_CURRENTChris Wilson
The PICT_ are enums and so never report true to ifdef PICT_a2r10g10b10 and instead we need to check the xserver version they were introduced. Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-08-02sna: Split SHM and DRI flush trackingChris Wilson
Tracking SHM flushes precludes some of the optimisations we can make in future for tracking DRI flushes, so split the two paths. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-08-02sna: Only flush GPU bo for a damage eventChris Wilson
Based on xf86-video-ati commit 9a1afbf61fbb2827c86bd86d295fa0848980d60b Author: Michel Dänzer <michel.daenzer@amd.com> Date: Mon Jul 11 12:22:09 2016 +0900 Use EventCallback to avoid flushing every time in the FlushCallback reports seeing an improvement in reducing flushes at the expense of checking every event for a DamageNotifyEvent. Since we also mix rendering with SHM buffers, we have a more diverse set of conditions under which to flush - but maybe we will see enough of a win for DRI to merit. So far seeing improvement of ~20% for series of small operations under the compositor without seeing any regressions, should benefit composited desktop users. The biggest danger here is missed flushes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-07sna: Add a special case for fast DRI2CopyRegion and NoAccelChris Wilson
Enable copying onto a scanout buffer using a WC mmap - so long as it is X-tiled and no swizzling. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-23sna: Limit generic convolution to smallish kernelsChris Wilson
Since the naive implementation uses an 8bit temporary, we can only support so many passes before the quantization artefacts become apparent. We have to be extra conservation in order to support multi-pass convolution algorithms (notable 2-pass separable Gaussian kernels). References: https://bugs.freedesktop.org/show_bug.cgi?id=95091 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-13sna: Make sure that cached upload proxies are marked as all-damagedChris Wilson
It should only be the case that we create the upload proxy in this case, but it ensures that the code remains self-consistent if we force the all-damage reduction. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-08-19sna/dri2: Initialise scratch.pScreen for copyingChris Wilson
Down one particular patch (overlapping render copies) the scratch.pScreen is dereferenced (to create a temporary Pixmap). Ensure that we populate it before hand. References: https://bugs.freedesktop.org/show_bug.cgi?id=91658 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-25sna: Initialise no-op callbacks earlyChris Wilson
In case of error, we try to free up memory before trying again. This involves callbacks into higher level code - but if we fail early, we will not have those hooks installed. Set no-ops stubs early to prevent untimely crashes. References: https://bugs.freedesktop.org/show_bug.cgi?id=90622#c1 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-18sna/glyphs: Improve handling of low bitdepth mask format conversionsChris Wilson
We shouldn't just discard the mask if the user requests that we render the glyphs through a low bitdepth mask - and in doing so we should also be careful not to improve the bitdepth of that mask (since we don't take into account the extra quantisation desired). Testcase: render-glyphs Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06sna: Disable GPU preferences when marking it as wedgedChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-06sna: Reject CPU blits that require format conversionsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-01sna: Clamp downsampling tile sizeChris Wilson
For very large scale factors, it is possible for the current calculation to underflow and try negative tile sizes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-16sna: Replace GPU render operations with CPU callbacks after wedgedChris Wilson
If we find the GPU is wedged, replace some of the lowlevel render operations with CPU equivalents to simplify some fallbacks that still need to operate on GPU bo (such as copying DRI buffers). References: https://bugs.freedesktop.org/show_bug.cgi?id=85058 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-07sna: Add pixmap id to DBG hints inside rende migrationChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-24sna: Tweak partial Picture extraction to prefer limiting to max 3D coordinatesChris Wilson
Where possible, keep the offset of the partial Picture within the 3D coordinate limit so that we can use the DrawRectangle offset to automatically adjust the coordinates. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-12sna: Avoid stalls when promoting to the GPU before an operationChris Wilson
In particular, the promotion of an active snooped bo into an uncached linear GPU bo was being performed on a busy buffer and forcing a stall. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-16sna/gen2+: Remove assertion on draw->type for fillsChris Wilson
I overlooked the tiling-fill path passing down a temporary DrawableRec into the fill_boxes callback - invalidating the assertion. Fixes regression from commit 43176b9bfafe389c4b9ed676f4e50e3b06f858c4 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Jun 30 21:01:11 2014 +0100 sna/dri2: Pass around the correct DrawableRec for sampling from the foriegn bo Reported-by: Jiri Slaby <jirislaby@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c62 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-02sna: Use the threaded compositor for picture conversionsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-30sna/dri2: Pass around the correct DrawableRec for sampling from the foriegn boChris Wilson
One day, we will move the width/height/bpp to the bo itself... Reported-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-25sna: Fix uninitialisable variableChris Wilson
sna_render.c: In function 'sna_render_picture_downsample': sna_render.c:822: warning: 'priv' may be used uninitialized in this function introduced in commit ded05e8abb248664124d2b86f77c27497a252c4e Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Jun 23 22:15:56 2014 +0100 sna: Allow scratch pixmap to allocate linear GPU bo Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-24sna: Fix the usual "x = y" typos in creating boxesChris Wilson
Fixes regression from commit 1d74b2e07d125ad95b9db6c9c032e90faf2bfa60 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Tue Jun 24 08:58:51 2014 +0100 sna: Decompose self-copy into overlapping/non-overlapping regions Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-24sna: Decompose self-copy into overlapping/non-overlapping regionsChris Wilson
We only need to stage the copy for the overlapping portion of the self-copy, for the rest we can do in a single pass. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-24sna/dri2: Add a dash more assertsChris Wilson
References: https://bugs.freedesktop.org/attachment.cgi?id=101618 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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-11sna: First copy to overlap temporary must be using GXcopyChris Wilson
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-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-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-28Silence CLang (almost)Chris Wilson
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>
2014-05-27sna: Handle bad picture format/depth mismatchesChris Wilson
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>
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-04-28sna: Factor in destination sizes for choosing intermediate tiling bo sizeChris Wilson
When tiling, factor in the destination usage of the aperture in case that reduces the available aperture for the intermediate bo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-22sna: Move sigtrap wrapping closer to threaded sw compositeChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-23sna: Avoid erroneous discarding operations for partial compositesChris Wilson
Composite operations were presumed to cover their entire width x height area. However, a few paths submit boxes that do not cover the clip region and so the optimisation made during prepare to discard completely overwritten data is incorrect (and leads to corruption - stale data is seen which the client expected to have been overdrawn). So along these more unusual paths, we must add a flag to prevent the overzealous discard. Notably, xfce4 triggers this as it uses a lot of unantialiased trapezoids in its theme drawing. References: https://bugs.freedesktop.org/show_bug.cgi?id=69528 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-28sna: Tidy a split conditional in an picture uploadChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-10sna: Pass usage hint down to render fill routinesChris Wilson
For the scanlines emitted for rendering Core drawing primitives, it is preferable to use the BLT engine, so pass those hints down. Reported-by: Jiri Slaby <jirislaby@gmail.com> 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-27sna: Fix regression in picture extractionChris Wilson
This is a little helper function, that just returns a bool, not the error code used by the render backends. Instead the caller tries an alternative method of extraction before giving up. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27sna: Catch SIGBUS to prevent X deathChris Wilson
We know that when we access either a CPU or GTT mmap we are vulernable to receiving a SIGBUS. In fact, we can catch these and abort the operation preventing X and all of its clients from randomly dieing. This helps for instance if you try and use a 1GiB frontbuffer on a 2GiB machine... For complete protection, we also need to catch signals for all GTT maps, such as VBO and staging buffers. (TBD) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27sna: Trigger fallback after intermediate pixmap allocation failureChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-18intel: Compile fixes for base install of SLED11.sp3Chris Wilson
Highlights of that distribution include xorg-xserver-1.6.5, kernel 3.0.76 and gcc-4.3. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-14sna: Rename sna_pixmap_get_bo()Chris Wilson
Mark how dangerous this function is by giving it a __ prefix. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-29sna: Suppress a few harmless warningsChris Wilson
Mostly of the only used in debugging path variety. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-19sna: Tidy a few DBG regarding cached uploadsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-13sna: Skip copying to the intermediate target if we will completely overwrite itChris Wilson
Occasionally when forced to use an intermediate destination surface, we know that we will completely overwrite the contents of the surface and so we can forgo the initial copy from the target. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-28sna: Markup when a gradient is opaqueChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-28sna: Compensate redirect drawing subrectangle inside an offset pixmapChris Wilson
Reported-by: Clemens Eisserer <linuxhippy@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66249 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>