summaryrefslogtreecommitdiff
path: root/src/sna/gen3_render.c
AgeCommit message (Collapse)Author
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-01-24sna/gen3+: Allow for spill when aligning verticesChris Wilson
We need to flush the batch if we run out of space aligning our vertex buffer - but the test must anticipate the space required for the new alignment. Reported-by: Arkadiusz Miskiewicz 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-05sna: Compilation fixes for squeezeChris Wilson
Older version of glibc and valgrind require a slight massage. 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-11-02sna: Eliminate the redundancy between is_mappable/can_mapChris 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-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-10-09sna/gen3+: Flush vertex buffer after computing resizeChris Wilson
Upon aligning the buffer, we may enlarge the vbo to accomodate the vertex alignment and push the current index past the end of the buffer. Move the space check from before the alignment computation to afterwards. Reported-by: Jiri Slaby <jirislaby@gmail.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=47597 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-30sna/gen3: Tidy up fallback handling from fill-boxesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-25sna/gen[35]: Remove dead code for choosing between BLT/render compositeChris Wilson
For these gen, we always want to use BLT where possible - even if it incurs a context switch. 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-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-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/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-06-14sna/gen3+: Remove redundant clearing of clear hint in video playbackChris Wilson
The clear hint is correctly updated when performing the move-to-gpu and so it is being superfluously repeated by the callers. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-13sna/gen2+: Promote a conditional dirty into an assertionChris Wilson
If the target bo is not bound when we start to emit the composite state for the operation, we are screwed. 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-03-12sna/gen3: Tweak code generation for gen3_emit_composite_primitive_constant__sse2Chris Wilson
References: https://bugs.freedesktop.org/show_bug.cgi?id=62198 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-12sna/gen3: Tweak code generation for ↵Chris Wilson
gen3_emit_composite_primitive_identity_gradient__sse2 References: https://bugs.freedesktop.org/show_bug.cgi?id=62198 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-12sna/gen3: Reduce another use of transformsChris Wilson
Prefer the slightly cheaper _sna_get_transformed_scaled(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-12sna: Mark redirect proxies with a unique idChris Wilson
This helps gen3 in particular as it uses the unique_id field of a bo to detect changes in render target. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-04sna/gen3: Always prefer BLT for copiesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-04sna/gen3: Perform alpha-fixup upon copy sourcesChris Wilson
This is required for copying from depth-15 surfaces onto other depths. Reported-by: Reinis Danne Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-03sna/gen3: Correct typo in assertionChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-03sna/gen3: Add some debug around rendercopies of the fbconChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-28sna/video: Correct scaling of source offsetsChris Wilson
When applying pan and zoom to a mismatched video, it would inevitably miscompute the origin and scale factors. Reported-by: Matti Hamalainen <ccr@tnsp.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61610 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26sna/gen3: Expand the number of SSE2 routines for basic composite opsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26sna: Conditionally compile sse2 routinesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26sna/gen3: Allow conditional use of SSE2Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-26sna: Reverse inverted assertionsChris Wilson
Oops, the assertions that we had sufficient free space was inverted. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-25sna/gen3+: Restart vertex space checks after lock contentionChris Wilson
If we end up contending for the vertex lock, we need to double check there is sufficient vertex space left for us. Bugzill: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1124576 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-25sna/gen3+: Assert that nbox is not 0Chris Wilson
Various assertions to track down a potential programming error. References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1124576 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-24sna/gen3: Factor out the per-vertex divide for gradientsChris 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-31sna/gen3+: Flush vertex threads before touching global stateChris Wilson
We need to be careful not just when finishing the current vbo to synchronize with the sharing threads, but also before we emit the batch state that no other thread will try and do the same. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-29sna/gen3+: Fix a DBG for composite_boxes()Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-27sna: Replace the forced vertex finish with just a waitChris Wilson
When completing a batch mid-operation, we need to wait upon the other threads to complete their writes so that memory is coherent before submitting the work to the GPU. This was achieved by forcing the finish, but all that from that is the wait, which makes the handling of threads much explicit and removes the unnecessary vbo refresh. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-27sna: Enable threaded rasterisation for non-antialiased geometryChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-27sna: Begin sketching out a threaded rasteriser for spansChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-20sna/gen3+: Remove bogus assertion that the vbo in included before finishChris Wilson
If we are carrying over a nearly full vbo from one batch to the next, we may indeed finish it prior to writing any new primitives and so the assert is truly bogus. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>