summaryrefslogtreecommitdiff
path: root/src/sna/gen2_render.c
AgeCommit message (Collapse)Author
2016-07-14sna/gen2/video: Implement textured video supportVille Syrjälä
Add textured video support for gen2. The hardware can only deal with packed YUV formats, so only those will be exposed. Modelled after the gen3 textured video code. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-07-14sna/gen2: Don't pass sna_composite_op to gen2_emit_target()Ville Syrjälä
Instead of passing sna_composite_op to gen2_emit_target(), pass all the parameters (bo,width,height,format) directly. This makes it possible to use gen2_emit_target() when we don't have an sna_composite_op. This matches how gen3_emit_target() works. 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-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>
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-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-23sna: Rename IGNORE_CPU to IGNORE_DAMAGE to better reflect its purposeChris Wilson
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-10sna/gen2: Fix CA/a8 blend factorsChris Wilson
This is a revert of commit 142f8461944b294dbc3fb0a7bf607bccf0bccc1f [2.99.911] Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Mar 10 15:20:16 2014 +0000 sna/gen2: Tidy blend factor selection for the source as that broke glyph rendering in firefox for instance. Reported-by: Carl Eitsger <4607vrfcr84spd21f08@weg-werf-email.de> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77201 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-03-10sna/gen2: Fix build after last minute patch editingChris Wilson
Whoops, the selective editing of the patch left a trailing '{' and breaking the build. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-10sna/gen2: Tidy blend factor selection for the sourceChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-10sna/gen2: Fix alpha blending with 8bit destination surfacesChris Wilson
On gen2 (like gen3), 8-bit destination surfaces are read into the Green channel (and written to from the Green channel). Therefore the expected alpha blending must instead be converted to colour blending. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75818 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-12-10sna/gen2,3: Replace stale bo replacement with simple assertsChris Wilson
The surface creation routines should ensure that the minimum pitch alignments are met. However, when rendering to a CPU bo, the pitch is not under our control so we need to be more careful. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-03sna/gen2,3: Unmap the old GPU bo when replacing due to render target constaintsChris 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>
2013-10-30sna: Check for wedged after submittingChris Wilson
If we submit prior to an operation, check that we didn't just wedge the GPU. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-25sna: Fix overallocation of fences for BLT commands (gen2/3)Chris Wilson
Fixes a regression introduced in commit 4d2840919fd00e4ae0bf1957f66009f55a01eb7b Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Thu Sep 26 15:30:58 2013 +0100 sna: In desperation, query the actual available aperture space 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-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-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-07-02sna/gen2: Fix alpha replication in the copy pipelineChris Wilson
When copying into an a8 surface we need to replicate the result into the green channel. It helps to tell the GPU from where to source the value to be replicated. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-02sna: Assorted DBGChris Wilson
This DBG was useful for narrowing down the issue in the next patch... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-28sna/gen2+: Consider precision in render operation placementChris Wilson
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66297 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-28sna: Make the backend identifier more informativeChris Wilson
This is useful, for example, with the multiple gen7 variants. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26sna/gen2: Add SSE2 fast paths for vertex emissionChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-08sna/gen4: Split the have_render flag in separate prefer_gpu hintsChris Wilson
The idea is to implement more fine-grained checks as we may want different heuristics for desktops with GT1s than for mobile GT2s, etc. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-02sna/gen4+: Specialise linear vertex emissionChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-02sna/gen2+: Precompute the affine transformation scale factorsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-02sna: Fast path inplace addition of solid trapezoidsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-01sna/gen2: Always try to use the BLT pipeline firstChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-01sna/gen2: Tidy a pair of vertex emittersChris Wilson
Switch to the new inline scaled transforms. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-27sna/gen2,3: Remove gen-specific vertex_offsetChris Wilson
Remove the duplication of vertex_offset in favour of the common vertex_offset. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-17sna: Refine check for an unset context switchChris Wilson
So it appears that we end up performing a context switch on an empty batch, but already has a mode. This is caught later, too late, by assertions. However, we can change the guards slightly to prevent those assertions without altering the code too greatly. And I can then think how to detect where we are setting a mode on the batch but doing no work - which is likely masking a bigger bug. Reported-by: Jiri Slaby <jirislaby@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47597 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-14sna/gen2+: Experiment with not forcing migration to GPU after CPU rasterisationChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-13sna/gen2: Reorder reuse_source() to avoid NULL dereference for solidsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-13sna/gen2: Initialise channel->is_affine for solidChris Wilson
In case we hit a path were we avoid reusing the source for the mask and leave is_affine unset for a solid mask. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-13sna/gen2: AssertionsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-13sna/gen2: Program solid mask using the DIFFUSE componentChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-12sna/gen2: STIPPLE requires an argumentChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-09sna: Replace remaining kgem_is_idle() with kgem_ring_is_idle()Chris Wilson
Further experimentation... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-08sna: Flush upon change of target if GPU is idleChris Wilson
The aim is to improve GPU concurrency by keeping it busy. The possible complication is that we incur more overhead due to small batches. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-30Convert generation counter to octalChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-25sna: Exploit the alpha-fixup of the BLT for texture format conversionsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>