Commit Graph

5015 Commits

Author SHA1 Message Date
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
Chris Wilson 9e6d55a8d6 sna: Don't use miSpan code for wide-spans by default, too expensive
Only use the fall-forward miSpans code when it prevents a readback.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-13 09:56:39 +01:00
Chris Wilson 9becfbbf89 sna: Draw dashed PolyLines twice, once for the fgPixel, once for the bgPixel
As the fast paths only setup state upfront, we were missing the state
changes required between dash-on/off. Take advantage of that each pixel
is only drawn once to batch the state changes and run the
miZeroDashLines twice.

A future task would be to use a custom line drawing routine...

Fixes regression from ec1267df74.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-13 09:43:07 +01:00
Chris Wilson e269ed5d4e sna: Restore CPU domain for vmapped buffers when reusing
For a vmapped upload buffer, we need to notify the kernel (and thereby
the GPU) to invalidate the sampler and flush its caches when we reuse an
idle buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-12 22:46:22 +01:00
Chris Wilson d29b8650c4 sna: Revert use of mmap64()
As this just causes mayhem on a 64-bit platform. Doomed if you, doomed
if you don't. :(

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-12 22:24:01 +01:00
Chris Wilson a78b1d71a3 sna: Declare AC_SYS_LARGEFILE for mmap64
In order to use the full 32-bits of mmap address space on small
platforms we need to use mmap64().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-12 15:37:25 +01:00
Chris Wilson 09deba927d sna: Check ioctl return from set-domain
Let's not assume it succeeds and so avoid altering our bookkeeping along
failure paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-10 20:59:36 +01:00
Chris Wilson 0b12f1d8e4 sna: Fix shadowed variable
sna_accel.c: In function 'sna_pixmap_move_area_to_gpu':
sna_accel.c:1751:12: warning: declaration of 'flags' shadows a parameter
[-Wshadow]
sna_accel.c:1731:72: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-10 15:23:54 +01:00
Chris Wilson 755a7107ae sna: Fix typo and use the right pointer for kgem_bo_destroy
Useless warnings in xorg headers ftl.

References: https://bugs.freedesktop.org/show_bug.cgi?id=48400
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-10 15:22:31 +01:00
Chris Wilson c8502e350c sna: Add missing alloc failure check for creating tile source
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-10 14:43:28 +01:00
Chris Wilson 9cc6f7ccc5 sna: Release the freed bo cache upon expire
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-10 12:07:12 +01:00
Chris Wilson 102d11906a sna: Check for an inactive partial buffer to reuse after retiring requests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-10 12:07:12 +01:00
Chris Wilson e2fb2421d8 sna: Release partial buffers during cache expiration
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-10 12:07:12 +01:00
Chris Wilson 333fdcad86 sna: Repeat expire whilst there remaining outstanding requests
Do not allow the cache expiration to finish if we are still running
requests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-10 12:07:12 +01:00
Chris Wilson 778232e3d2 sna: Only move the bo into the read domain for readback
And mark it as currently in no domain afterwards, so that if we reuse
it, it will be appropriately moved later.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-10 11:17:29 +01:00
Chris Wilson dd093eafb9 sna: Add assertions around proxy list handling
References: https://bugs.freedesktop.org/show_bug.cgi?id=48400
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-09 14:09:42 +01:00
Chris Wilson 7f0bede3e7 sna/traps: Use a temporary variable for the write pointer
To avoid accumulating the write offset for wide spans, we need to reset
the destination pointer between spans.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48332
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-09 10:48:08 +01:00
Chris Wilson 2e4da00e3e sna/traps: Assert that the inplace row is contained before writing
References: https://bugs.freedesktop.org/show_bug.cgi?id=48332
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-09 10:42:18 +01:00
Chris Wilson 0464e93a08 sna: Add some assertions for misuse of proxies
References: https://bugs.freedesktop.org/show_bug.cgi?id=48400
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-08 17:21:34 +01:00
Chris Wilson 479cb6ba71 sna: Compress adjoining spans during FillSpans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-08 14:25:49 +01:00
Chris Wilson c5c01c13ba sna: Remove the duplicated check for use-bo? in PolySegments
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-08 13:48:54 +01:00
Chris Wilson f5deea4f60 sna: Correct partial-write flag for PolySegments fallback
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-08 13:39:47 +01:00
Chris Wilson c3d7f4c1cf sna/gen3: Reset accumulated constants for each composite
In particular the glyph routines require the composite setup to
reinitialise state between glyph runs. This affects anything trying to
use glyphs without a mask with a gradient source, for example.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-08 13:20:13 +01:00
Chris Wilson 701473d204 sna: Release cached upload buffers when reusing a write buffer for readback
References: https://bugs.freedesktop.org/show_bug.cgi?id=48400
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-08 10:09:42 +01:00
Chris Wilson 1ecf17b250 sna/gradient: Compute the absolute delta between color stops
Otherwise we do not detect gradients that start from white!

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48407
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-07 10:02:23 +01:00
Chris Wilson 4356fae72d sna/video: Only wait upon the scanout pixmap
Caught by the addition of the assertion.

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>
2012-04-06 21:10:50 +01:00
Chris Wilson b790ba2ec9 sna: Correct the damage offset for redirected rendering
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48385
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-06 15:38:02 +01:00
Chris Wilson 0b81bafb80 sna/glyphs: Prefer a temporary upload mask for large glyph masks
If the required temporary mask is larger than the 3D pipeline can
handle, just render to a CPU buffer rather than redirect every glyph
composition.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-06 15:14:45 +01:00
Chris Wilson 42a84613e3 sna: Relase the upload cache when overwriting with PutImage
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48359
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-06 14:21:33 +01:00
Chris Wilson 999aa210ff sna: Use a sentinel value to prevent accessing beyond the end of the y_buckets
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-06 09:37:03 +01:00
Chris Wilson 1ae6328c57 sna: Remove redundant check from tor_inplace()
We only execute full-steps for vertical edges so we do not need the
second check.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-06 09:12:08 +01:00
Chris Wilson 51b9202d27 sna: Only engage the GPU detiler for multiple rows
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-04 11:13:27 +01:00
Chris Wilson 98ad4c3cd8 sna/gen3: Don't force use of the render pipeline just for vmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-03 19:47:15 +01:00
Chris Wilson 0915d414f5 sna/gen3: Fix pre-multiplication of mask value
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-03 19:04:29 +01:00
Chris Wilson 04851e4210 sna/gen3: Convert the clear-color from picture->format to a8r8g8b8
The shaders treat colours as an argb value, however the clear color is
stored in the pixmap's native format (a8, r5g6b5, x8r8g8b8 etc). So
before using the value of the clear color as a solid we need to convert
it into the a8r8g8b8 format.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48204
Reported-by: Paul Neumann <paul104x@yahoo.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47308
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-03 12:36:22 +01:00
Chris Wilson 87a672dafd sna: Apply CoordMode when computing point extents
Reported-by: Patrick Truebe <eko-priv@gmx.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48220
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-03 09:24:06 +01:00