Commit Graph

5050 Commits

Author SHA1 Message Date
Chris Wilson 450592f989 sna: Cache the framebuffer id
Also fixup a weakness of only tracking scanout with a single bit, as we
used to clear it forcibly after every flip.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-06 12:51:23 +01:00
Chris Wilson 29d035279b sna/dri: pageflip unref debugging
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-04 09:34:36 +01:00
Chris Wilson 079b491ced sna: Ensure drawables are clipped against the pixmap before migration
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-03 23:52:17 +01:00
Chris Wilson 1a5f8599b1 sna: Compile fix for fresh assertion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-03 23:21:48 +01:00
Chris Wilson 61cac5c265 sna: Maintain a reference to the chain of proxies
Rather than attempt to flatten the chain to the last link, we may need
to hold a reference to the intermediate links in case of batch buffer
submission.

Fixes http://tnsp.org/~ccr/intel-gfx/test.html

Reported-by: Matti Hamalainen <ccr@tnsp.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-03 22:40:52 +01:00
Chris Wilson dea5d429f7 sna: Remove extraneous SCANOUT flags
These are now fixed by obeying a minimum alignment restriction.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-03 22:37:09 +01:00
Chris Wilson 19fd24a4db sna: Fix offset for combining damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-03 22:37:09 +01:00
Chris Wilson 1376c81dbf sna: Debug option to force particular upload/download paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-03 22:37:08 +01:00
Chris Wilson f0d464d6b1 sna/dri: Balance flush counting
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-03 22:28:43 +01:00
Chris Wilson d47e98dd64 sna: Minor glyph fallback fixes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-03 14:48:27 +01:00
Chris Wilson a1f08b8850 sna: Don't discard GPU buffer if we only want to read back for the operation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-03 14:48:27 +01:00
Chris Wilson fcccc5528b sna: Improve handling of inplace IO for large transfers
If the transfer is large enough to obliterate the caches, then it is
preferrable to do it inplace rather than upload a proxy texture and
queue a blit. This helps prevent an inconsistency where one layer
believes the operation should be done inplace only for the IO layer to
perform an indirect upload.

Testing show no significant impact upon the cairo-traces, but it does
prevent x11perf -shmput from exploding.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-03 14:48:27 +01:00
Chris Wilson 53568e8e49 sna/gen7: Fix debug printing of primitives
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-03 14:48:26 +01:00
Chris Wilson 01c26a44fd sna: Avoid reducing damage for synchronisation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-03 14:48:26 +01:00
Chris Wilson f4c34e9ab3 sna: Bring back the minimum alignment for G33
The underlying cause is still not fixed. It should be possible to use
the much laxer alignment for single-stream linear. Still no idea how I
fail to convince the GPU to drop the depth buffer.

Reported-by: Matti Hamalainen <ccr@tnsp.org>
References: https://bugs.freedesktop.org/show_bug.cgi?id=49391
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-02 19:21:20 +01:00
Chris Wilson 10b4a9bb5f sna: Always try to operate inplace if we an LLC gpu bo 2012-05-02 19:20:46 +01:00
Chris Wilson dd80fb00bf sna: Fallback for glyphs too large for XY_TEXT_IMMEDIATE
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-02 11:31:58 +01:00
Chris Wilson 7e09babb3e sna: Only attempt to reuse exported scanout buffers
Yet more mesa w/a.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-01 12:37:45 +01:00
Chris Wilson b4b32e7a01 sna: Fast-path unclipped glyphs
Avoid the redundant computation of the glyph intersection with the
drawable bounding box.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-01 11:15:00 +01:00
Chris Wilson ffdf9aca12 legacy/i810: hwmc additionally depends upon building DRI
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 21:59:52 +01:00
Chris Wilson 444da84c47 configure: Version bump for 2.19.0 release 2012-04-29 21:49:04 +01:00
Chris Wilson a206a1eee1 sna: Tune relocation array size
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-28 14:19:48 +01:00
Chris Wilson 4f1908c651 sna: PolyPoint only uses the gc->fgPixel
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-28 14:19:48 +01:00
Chris Wilson 8453034c7d sna/gen6: Allow ring switching at the start of a batch
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-28 14:19:48 +01:00
Chris Wilson 93ad779389 sna: Tweak semaphores-enabled heuristic
The kernel module now defaults to -1, confusing the test.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-28 14:19:48 +01:00
Chris Wilson 986dbdda3b sna: Tweak placement choice for high-overhead operations
Some operations cost more to setup than to transfer data back and forth!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-28 14:19:48 +01:00
Chris Wilson daac9a1d03 sna: Micro-optimise common case of checking a single fenced bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-28 14:19:47 +01:00
Chris Wilson 5967d76ca0 sna: Fixup broken assertion
It is valid for the cpu_bo to be NULL, as we may be choosing to free the
large shadow pixel buffer instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-25 17:15:37 +01:00
Chris Wilson 860d3859b5 sna/gen7: Add CS stall before changing WM binding table
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-25 16:14:35 +01:00
Chris Wilson c219283460 sna/gen7: Apply more recent improvements from SNB perf tuning
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-25 16:02:21 +01:00
Chris Wilson a3371613c9 sna: Do not automagically convert GTT mappings on untiled scanout to CPU
The likelihood of an untiled mapping of the scanout is slim, except for
gen3 with large desktops, and there it should never be in the CPU
domain...

The issue is that we may perform an operation "inplace", yet incoherent
with the display engine, and never flush the CPU cache, resulting in
render corruption. In theory at least!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-25 11:17:58 +01:00
Chris Wilson 1abd92cd01 sna: Clear the domain tracking after attaching the bo to scanout
This is basically to make sure we don't continue treating it as CPU
coherent.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-25 11:17:58 +01:00
Chris Wilson 8c58c840b1 sna/dri: Always clear the scanout when destroying dri2 buffers
As we may end up holding onto and releasing the Screen pixmap last, we
may also be responsible for flushing the last reference to the scanout.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-23 11:09:37 +01:00
Chris Wilson caf9144271 sna: Remove the assertions that the cached upload buffers are active
These were added to track down some corruption, but the assertions
themselves are incorrect, just very rare. The upload buffer may
genuinely be cached if we abort the render operation after uploading the
source data, leaving the proxy not coupled to any request.

References: https://bugs.freedesktop.org/show_bug.cgi?id=48400
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-20 17:15:37 +01:00
Chris Wilson aff3614efd sna: Always clear the mmapped domains when reusing partial upload buffers
As we need to make sure that we do invalidate the caches appropriately
on reuse. Mildly paranoid, but strictly required by the spec.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-20 13:21:40 +01:00
Chris Wilson cb6a3dc2ed sna: Discard proxy upload buffer if we choose to render to it
Even if we try to avoid treating an upload buffer as a real GPU target,
we may still choose to migrate the buffer to the GPU in order to keep
other buffers on the GPU. In that case, we do want to create a real GPU
bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 10:34:23 +01:00
Chris Wilson 4cf74d409c sna: Don't consider upload proxies as being on the GPU for render targets
The upload proxy is a fake buffer that we do not want to render to as
then the damage tracking become extremely confused and the buffer it
self is not optimised for persistent rendering. We assert that we do not
use it as a render target, and this patch adds the check so that we
avoid treating the proxy as a valid target when choosing the render
path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 09:12:18 +01:00
Chris Wilson fd81408b97 sna: Increase the render target alignment to 4 pixels on gen4+ as well
Repoerted-and-tested-by: Toralf Förster <toralf.foerster@gmx.de
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48865
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-18 12:08:05 +01:00
Chris Wilson 11599e52b8 sna/dri: Decouple the frame event info after attaching along error paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-17 20:08:14 +01:00
Chris Wilson b817200371 Don't issue a scanline wait while VT switched
Be paranoid and check that we own the VT before emitting a scanline
wait. If we attempt to wait on a fb/pipe that we do not own, we may
issue an illegal command and cause a lockup.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-17 17:56:05 +01:00
Chris Wilson af4a6e8cb5 sna: Don't assert exported buffers are not busy
As we do not fully control these buffers, we cannot truly say when they
are idle, we can only trust that the split between us and the compositor
doesn't lead to much corruption.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-16 20:57:03 +01:00
Chris Wilson a16616209b uxa: Fix leak of glyph mask for unhandled glyph composition
==1401== 7,344 bytes in 34 blocks are possibly lost in loss record 570 of 587
==1401==    at 0x4027034: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1401==    by 0x8BE5150: drm_intel_gem_bo_alloc_internal (intel_bufmgr_gem.c:689)
==1401==    by 0x899FC04: intel_uxa_create_pixmap (intel_uxa.c:1077)
==1401==    by 0x89C2C41: uxa_glyphs (uxa-glyphs.c:254)
==1401==    by 0x21F05E: damageGlyphs (damage.c:647)
==1401==    by 0x218E06: ProcRenderCompositeGlyphs (render.c:1434)
==1401==    by 0x15AA40: Dispatch (dispatch.c:439)
==1401==    by 0x1499E9: main (main.c:287)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-14 20:45:29 +01:00
Chris Wilson ae145c21e9 sna: Avoid leaking the plane resources when determining sprite planes
Fixes the tiny, one-off leak:

==1407== 8 bytes in 1 blocks are definitely lost in loss record 48 of 527
==1407==    at 0x402894D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1407==    by 0x8580BE8: drmMalloc (xf86drm.c:147)
==1407==    by 0x8583D54: drmAllocCpy (xf86drmMode.c:73)
==1407==    by 0x8585265: drmModeGetPlaneResources (xf86drmMode.c:955)
==1407==    by 0x8A1BCE9: sna_video_sprite_setup (sna_video_sprite.c:367)
==1407==    by 0x8A1A0A3: sna_video_init (sna_video.c:523)
==1407==    by 0x89FD4E0: sna_screen_init (sna_driver.c:935)
==1407==    by 0x15AD80: AddScreen (dispatch.c:3909)
==1407==    by 0x19A2DB: InitOutput (xf86Init.c:817)
==1407==    by 0x14981C: main (main.c:204)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-14 20:45:26 +01:00
Chris Wilson 69a7737abe sna: Align texture subsurfaces to 2x2 texture samples
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-14 13:07:06 +01:00
Chris Wilson 1d2a46e090 sna: Align redirect subsurfaces to 2x2 or 4x4 render spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-14 13:07:06 +01:00
Chris Wilson 1ce2b65d62 sna: Align render target sizes on gen2/3 to 4x4 render spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-14 13:07:06 +01:00
Chris Wilson 89f2b09b1e sna: Avoid using TILING_Y for large objects on gen2/3
References: https://bugs.freedesktop.org/show_bug.cgi?id=48636
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-13 16:37:43 +01:00
Chris Wilson eaadbce122 sna: Relax bogus assertion
The bo may be considered unmappable due to being bound to outside the
mappable region, which we are attempting to rectify through mapping into
the GTT domain.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-13 15:12:55 +01:00
Chris Wilson b478420740 sna: Limit the buffer reuse for mappable uploads to only those with mmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-13 15:07:13 +01:00
Chris Wilson 90e2740e7e sna: Remove the conflicting assertion during GTT map
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=48636
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-13 13:51:57 +01:00