summaryrefslogtreecommitdiff
path: root/src/sna/gen6_render.c
AgeCommit message (Collapse)Author
2019-09-19sna: Replace fall through comments with standard formVille Syrjälä
gcc doesn't like extra stuff in the fall through comments. Replace them with the standard form. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-07-19sna: Rebalance prefer_blt to weight I915_TILING_Y higherChris Wilson
Mixing I915_TILING_Y and the blitter is painfully slow, so we need to take use of I915_TILING_Y into more prominent consideration and even force a ring switch in case it is being used. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-31sna/video: Add XV_COLORSPACE attribute for the textured Xv adaptorVille Syrjälä
Allow the client to select between BT.601 and BT.709 via the XV_COLORSPACE port attribute with the textured Xv adaptor as well. Since the BT.601 coefficients are currently hardcoded in the yuv->rgb shader, let's just add a mostly duplicated shader with hardcoded BT.709 coefficients instead. Not the most elegant solution but avoids having to touch any state setup etc. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-31Rename current yuv->rgb shader sources to exa_wm_yuv_rgb_bt601Ville Syrjälä
Our current yuv->rgb shaders follow the BT.601 conversion formula. Rename the shader sources to indicate that fact. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> 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>
2017-09-27sna/video: Add support for NV12 video in all gen4+ render pathsVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-06-21sna/gen2+: Do not force migration to GPU for very large objectsChris Wilson
If the target is larger than the maximum render size, allow us not to migrate to the GPU if it is entirely damaged on the CPU. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-11sna/video: Avoid dereferencing a masked pointerChris Wilson
First check for the damage-is-all special flag before adding to the damage. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-08sna/video: Move the composite offsets into the dstRegionChris Wilson
Move the application of the composite offset from the backends into the caller so that we correctly apply the offset to the dstRegion prior to calling move-to-gpu with that set of boxes. 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-04-22sna/gen6: Do not force a blt switch onto a Y-tiled surfaceChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-22sna/gen6+: Discourage use of the BLT with Y-tilingChris Wilson
Somewhere, somehow the first glyph character upload into the Y-tiled glyph cache is corrupt since commit 75d87762471e195dddd73056fc6a06e17db1c8b0 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Apr 17 10:29:28 2015 +0100 sna: Enable blitting with Y-tiled surfaces I have not spotted whether it is a missing magic bit or a bad GTT path, but ideally we don't want to switch to BLT along that path anyway (since we are in the middle of rendering with the other engine). Reported-by: Andy Furniss <adf.lists@gmail.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=90138 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-01sna/dri: Avoid using the BLT for DRI2CopyRegion if no semaphoresChris Wilson
We expect mesa nowadays to preferentially use the render pipeline for doing its clears and so want to avoid handing it back an active BLT bo if we don't have semaphores (as that would cause a sync). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-31sna/gen6+: Prefer the BLT for small self-copiesChris Wilson
Even on GT3, it is preferrential to use the blitter if the copy is small (due to the latency in execution). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-07sna/gen6+: Prefer the BLT for small copiesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-09sna: Convert pixel values into ARGB values for render operationsChris Wilson
When converting from a Pixmap into a Solid, we need to remember to convert from the stored pixel format into the a8r8g8b8 used by the solid fill. This was exposed by commit aef2f99d051dfa37717e5d6d6de9b548d706a520 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Tue Feb 3 21:31:16 2015 +0000 sna: Convert CompositeRectangles ADD white to SRC white but is a regression from commit 31a4c7bc13c5f4560482b450b9ee4788a58930cd [2.99.912] Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Apr 4 10:46:48 2014 +0100 sna/gen2+: Replace composite sources with solids where possible Reported-by: andrew@atomspring.com Reported-by: Matti Hämäläinen <ccr@tnsp.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89030 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-25sna/gen6+: Tweak engine placement when considering src/dst combinationsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-15sna/gen6+: Prefer using RENDER pipeline for uncached destinations on large GTChris Wilson
If the sampler can be cached, the RENDER pipeline can write to an uncached destination surface faster than main memory bw would seem to actually allow... Notably, performance does not drastically fall off with small areas compared to BLT as it once did. However, using a solid source (which is not yet implemented well in the RENDER pipeline) is still much faster with the BLT. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-31sna: Modicum of extra DBG for transformed redisplayChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-20sna/gen6: Apply gen7 flushingChris Wilson
Clemens Eisserer noticed that glyphs would randomly disapper whilst being rendered on his Sandybridge, a sign that the GPU is not flushing its internal state on pipeline changes. As a precaution, adopt the Ivybridge flush semantics (whilst preserving the required Sandybridge workarounds). Reported-and-tested-by: Clemens Eisserer <linuxhippy@gmail.com> Reported-and-tested-by: Ilia Mirkin <imirkin@alum.mit.edu> References: https://bugs.freedesktop.org/show_bug.cgi?id=85158 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-08intel: Store pointer to struct intel_deviceChris Wilson
Beware the barbarians at the gate, who invade and steal your ScrnInfoPtr and its Entity from underneath you. In some configurations, we lose access to the struct intel_device stored on the Entity after initialisation, causing havoc. Workaround this by storing the intel_device that we open in our driverPrivate. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-24sna/gen4+: Assert that the offset coordinate is within range if negativeChris Wilson
Invalid negative offsets could slip into the drawing rectangle without triggering the assertion - the assertion being that they were not greater than the maximum positive coordinate of the 3d engine. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-02sna: Leave more Pixmap breadcrumbs in DBGChris Wilson
Add the Pixmap id to various DBG messages to make it easier to track rendering. 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/gen6+: Tweak consideration of compositing on BLTChris 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-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-23sna/gen6+: Initialise src offset before useChris Wilson
Fixes regression from commit 30348efd57135edee41fccb87133c572b6473aa8 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Jun 23 11:14:25 2014 +0100 sna/gen6+: Avoid adjusting copy coordinates until commited to using them which assumed that the render state was being zeroed. Reported-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-23sna/gen6+: Avoid adjusting copy coordinates until commited to using themChris Wilson
If we need to fallback to the BLT unit, we need to pass it the original source/dest coordinates and not our transformed render coordinates. So keep the original values intact until we start emitting the render operation. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-23sna/gen6+: Encourage the compiler to inline a couple of key functionsChris 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-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-13sna/gen6+: Prefer the BLT for large overlapping copiesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna/gen6+: Overlapping bo by definition have compatible depthsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Silence compiler warnings for discarding const Region pointsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-16sna/video: Only migrate the destination windowChris Wilson
By using move-area-to-gpu and specifying that we overwrite the target area, we can optimize away any needless damage migration. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-15sna: Mark partial composite operations upfrontChris Wilson
Rather than guess in the backend when we are going to be called for multiple boxes, rely on the frontend declaring it correctly. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-04sna/gen2+: Beware the unattached ShmPixmapChris Wilson
When dereferences priv, make sure it exists first. ShmPixmaps for example, may not have one, nor do very small buffers. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-04sna/gen2+: Replace composite sources with solids where possibleChris Wilson
If the composite reads entirely from within a large pixmap which is a clear color, just replace the source with a solid. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14sna: Allow some leeway when deciding to discard common translationsChris Wilson
Under PictFilterNearest, we can ignore fractional translations (not all renderers discard those.) And if we are being approximate, we can loosen our tolerance as well. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-13sna: Nullify extra fill.opsChris Wilson
I forgot that the initial memset(&fill, 0, sizeof(fill)) was no longer performed and we rely on explicit initialisation during the setup, so add the missing fields. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76088 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-23sna/gen6+: Add missing DBG argumentChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-10sna/gen6: Restore stall dropped when not flushing insteadChris Wilson
commit 82e6d41c2f4f343bd1854d3d8ee4b624b5d68971 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Thu Oct 31 13:35:59 2013 +0000 sna/gen6: Tweak flush around CC state changes Replaced the pipeline stall with a flush - but only when the target was dirty. The missing stall however seems to be required as well. v2: Actually emit the stall for all CC state changes [Ilia Mirkin] Reported-by: Ilia Mirkin <imirkin@alum.mit.edu> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72375 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-01sna: Add some more DBG for choosing render targetsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-29sna/gen4+: Assert that the cached binding location is validChris Wilson
We can at least check that it is in the right region (i.e. not past where the current surface has been allocated from). References: https://bugs.freedesktop.org/show_bug.cgi?id=74176 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-29sna/gen6+: Encourage inplace uploads for CompositeChris Wilson
First try using the blt path for a potential inplace upload for a simple composite operation copying from a ShmPixmap. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-24sna/gen2+: Inspect composite flags to discard unneeded CPU damageChris Wilson
We can now check whether the Composite operation will require existing CPU damage and if not discard it. 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 up an assertion on an uninitialised variableChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-22sna: Tidy up fallback from render composite to blt compositeChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>