Commit Graph

6102 Commits

Author SHA1 Message Date
Chris Wilson 0696ea4bd6 sna: Add the missing assertion for !proxy
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-21 17:25:33 +00:00
Chris Wilson ee72375ecd sna: Do not migrate uninitialised pixmaps
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-11-21 17:08:53 +00:00
Chris Wilson 44dad49014 sna: Do not dispose of a shadow pixmap
Fixes regression from 2249e9edc3

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-11-21 16:22:35 +00:00
Chris Wilson 9c627a0524 sna: Remove the kgem_bo_is_mappable refcnt assertion from freed paths
A few callers of kgem_bo_is_mappable operate on freed bo, and so need to
avoid the assert(bo->refcnt).

References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-21 16:04:24 +00:00
Chris Wilson c0c48c7a5a sna: Add a few refcnt assertions
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-21 14:51:59 +00:00
Chris Wilson 0884777c33 sna: Fix bogus assertion from 03fb9ded43
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-21 14:31:44 +00:00
Chris Wilson 2249e9edc3 sna: Dispose of local copy for render sources
If we transfer the pixmap to the GPU to use as a render source, presume
that we will not need to then touch the local copy (at least for a
while) and so return that memory to the system.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-21 13:05:36 +00:00
Chris Wilson 736bb0f705 sna: Tighten a couple of assertions for damage with use_bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-21 12:16:46 +00:00
Chris Wilson 03fb9ded43 sna: Assert that we do not create a proxy with existent GPU damage
References: http://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-20 21:36:50 +00:00
Chris Wilson 9ab1d1f94e sna/dri: Queue a vblank-continuation after flip-completion
If a vblank request was delayed due to a pending flip, we need to make
sure that we then queue it after that flip or else progress ceases.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56423
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57156
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-20 18:42:58 +00:00
Chris Wilson 7a7a76b359 sna/dri: Avoid a NULL dereference inside a DBG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-20 16:05:32 +00:00
Eric Anholt fa5c573455 uxa: Refactor early-exit paths of uxa_try_driver_composite().
Saves 200b of code at -O2.
2012-11-20 11:39:47 +00:00
Eric Anholt edefb64d2b uxa: Work around uninitialized-value warning.
The compiler isn't noticing that localDst only diverges from pDst when
the _copy variables have also been set.
2012-11-20 11:39:47 +00:00
Eric Anholt 18b2e2a827 uxa: Add printf attribute to intel_debug_fallback().
Shuts up a bunch of warnings with xorg's shared warning flags, and
should give us more informative warnings in our code.
2012-11-20 11:39:47 +00:00
Eric Anholt 2d1e267e66 uxa/dri: Factor out the repeated swap fallback code. 2012-11-20 11:39:46 +00:00
Eric Anholt cd2f373da7 configure.ac: Fix bad syntax for test calls 2012-11-20 11:39:44 +00:00
Chris Wilson b8c01d9bd7 sna/dri: Add an assert that the cached DRI2 buffer is pinned for DRI
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-20 11:35:31 +00:00
Chris Wilson 84b1a02fa9 sna/dri: Avoid setting off-delay after a failed flip (use-after-free)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-19 13:41:28 +00:00
Chris Wilson b4dd1103a5 sna/gen6+: Tweak prefer-blt to offset latency when in rc6
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-18 12:51:32 +00:00
Chris Wilson 0cb8544dc1 Remove useless indirection of intel_chipsets
Once upon a time this was used to hide a compiler warning about a
pointer mismatch, now the compiler still warns about the cast, making
the indirect moot.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-18 12:50:44 +00:00
Chris Wilson 8509e474f5 sna/dri: Clear the last-used-cpu flag when performing CopyRegion
Keeps the internal bookkeeping intact after the small bypass.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-16 23:02:44 +00:00
Chris Wilson 866ed4a26c sna/dri: Add a couple of more asserts to track injection of a rogue bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-15 15:13:14 +00:00
Chris Wilson d2897cb013 sna/gen4,5: Fix the opacity shader to use the right vertex attribute
Reported-by: Edward Sheldrake <ejsheldrake@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57054
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-13 12:43:44 +00:00
Chris Wilson 440eaa0497 sna/gen4: Tidy emission of opacity vertex attribute
Just make it more consistent between the various emitters

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-13 12:43:42 +00:00
Chris Wilson b6d2bb9615 sna/gen4: Do not prefer inplace non-rectilinear spans
As gen4 requires the per-rectangle vertex flush, emitting spans on the
GPU is inefficient and so we prefer to composite the mask instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-13 11:08:37 +00:00
Chris Wilson ae293609c7 sna/gen4: Always initialise redirect
Do not assume the caller cleared the composite-op structure for us.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-13 11:08:37 +00:00
Chris Wilson 2954f15e2b sna: Specialise the decision for inplace xor uploads
Fixes a regression from

commit 0be1d96471
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Sep 11 21:48:24 2012 +0100

    sna: Use inplace X tiling for LLC uploads

which introduced the ability to swizzle into CPU maps, but also
convinced the xorg path to the same - which for large images blows up.

Reported-by: Michael Laß <bevan@bi-co.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57031
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-13 09:46:19 +00:00
Chris Wilson 66eb0adffa sna/dri: Apply the can_blit() check for CopyRegion
CopyRegion() also needs to check for stale bo in case the pixmap
dimensions have changed size and so may cause out-of-bounds read/writes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-12 14:45:56 +00:00
Chris Wilson b27ecf3059 sna/dri: Prevent scheduling a swap on stale buffers
If the screen has been reconfigured and the DRI client tries to swap the
old buffers (having not processed the invalidate event and retrieved the
current names), quietly drop the request. If we try to obey the request,
we will end up attaching a back buffer that is the wrong size to the
scanout...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-12 14:25:55 +00:00
Chris Wilson 34aa1e3b27 sna: Compile against ancient libdrm
We need to trim the sprite video overlays if the prototypes are not
known.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-12 11:22:53 +00:00
Chris Wilson 8f1afde57d 2.20.13 release
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-11 16:16:20 +00:00
Chris Wilson b16219a19f sna: Filter out the full-damage marker when undoing redirection
==25902== Invalid read of size 4
==25902==    at 0x4980E13: _list_del (intel_list.h:218)
==25902==    by 0x4980EAB: list_del (intel_list.h:240)
==25902==    by 0x4981F4B: free_list (sna_damage.c:403)
==25902==    by 0x4985131: __sna_damage_destroy (sna_damage.c:1467)
==25902==    by 0x49A5276: sna_render_composite_redirect_done (sna_render.c:1921)
==25902==    by 0x49C68FC: gen2_render_composite_done (gen2_render.c:1136)
==25902==    by 0x497F90F: sna_composite (sna_composite.c:567)
==25902==    by 0x4994725: glyphs_via_mask (sna_glyphs.c:1139)
==25902==    by 0x4995FB7: sna_glyphs (sna_glyphs.c:1688)
==25902==    by 0x8150EB4: ??? (in /usr/bin/Xorg)
==25902==    by 0x813CA38: CompositeGlyphs (in /usr/bin/Xorg)
==25902==    by 0x8146DE1: ??? (in /usr/bin/Xorg)
==25902==  Address 0x7c079ac2 is not stack'd, malloc'd or (recently) free'd

Reported-by: bonbons67@internet.lu
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56785
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-11 11:05:35 +00:00
Chris Wilson 69acbb77e8 sna: Fix printing of uninitialied value in DBG
==25902== Use of uninitialised value of size 4
==25902==    at 0x423098E: _itoa_word (_itoa.c:196)
==25902==    by 0x4233F7F: vfprintf (vfprintf.c:1602)
==25902==    by 0x42FAFAD: __vsnprintf_chk (vsnprintf_chk.c:65)
==25902==    by 0x81DBE8E: Xvscnprintf (in /usr/bin/Xorg)
==25902==    by 0x81DC8FB: LogVMessageVerb (in /usr/bin/Xorg)
==25902==    by 0x81DCA62: LogVWrite (in /usr/bin/Xorg)
==25902==    by 0x81DCA9B: VErrorF (in /usr/bin/Xorg)
==25902==    by 0x81DC333: ErrorF (in /usr/bin/Xorg)
==25902==    by 0x49B2FA8: trapezoid_span_inplace__x8r8g8b8 (sna_trapezoids.c:5069)
==25902==    by 0x49B3407: trapezoid_span_inplace (sna_trapezoids.c:5166)
==25902==    by 0x49B4C96: sna_composite_trapezoids (sna_trapezoids.c:5619)

Reported-by: bonbons67@internet.lu
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56785
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-11 10:49:59 +00:00
Chris Wilson 66e4c8ff40 sna: Flush pending rendering before enabling an output
This is to prevent falling in the trap of the rendering being delayed
until the next client renders some new content.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-11 09:40:09 +00:00
Chris Wilson 94dd0b9ee9 sna/gen2: Fix use of uninitialised redirection
==29553== Invalid read of size 4
==29553==    at 0x4980E1B: _list_del (intel_list.h:218)
==29553==    by 0x4980EB3: list_del (intel_list.h:240)
==29553==    by 0x4981F53: free_list (sna_damage.c:403)
==29553==    by 0x4985139: __sna_damage_destroy (sna_damage.c:1467)
==29553==    by 0x49A527E: sna_render_composite_redirect_done (sna_render.c:1921)
==29553==    by 0x49C6904: gen2_render_composite_done (gen2_render.c:1136)
==29553==    by 0x497F917: sna_composite (sna_composite.c:567)
==29553==    by 0x8150C41: ??? (in /usr/bin/Xorg)
==29553==    by 0x8142F13: CompositePicture (in /usr/bin/Xorg)
==29553==    by 0x8145F58: ??? (in /usr/bin/Xorg)
==29553==    by 0x81436F2: ??? (in /usr/bin/Xorg)
==29553==    by 0x807965C: ??? (in /usr/bin/Xorg)
==29553==  Address 0x9407e188 is not stack'd, malloc'd or (recently) free'd

Reported-by: bonbons67@internet.lu
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56785
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-10 16:55:20 +00:00
Chris Wilson 0f1c30818c sna: Fix use of uninitialised value in DBG
==29553== Use of uninitialised value of size 4
==29553==    at 0x4230964: _itoa_word (_itoa.c:195)
==29553==    by 0x4233F7F: vfprintf (vfprintf.c:1602)
==29553==    by 0x42FAFAD: __vsnprintf_chk (vsnprintf_chk.c:65)
==29553==    by 0x81DBE8E: Xvscnprintf (in /usr/bin/Xorg)
==29553==    by 0x81DC8FB: LogVMessageVerb (in /usr/bin/Xorg)
==29553==    by 0x81DCA62: LogVWrite (in /usr/bin/Xorg)
==29553==    by 0x81DCA9B: VErrorF (in /usr/bin/Xorg)
==29553==    by 0x81DC333: ErrorF (in /usr/bin/Xorg)
==29553==    by 0x49434F0: kgem_create_buffer (kgem.c:4887)
==29553==    by 0x4943B09: kgem_create_buffer_2d (kgem.c:4969)
==29553==    by 0x4943E19: kgem_upload_source_image (kgem.c:5021)
==29553==    by 0x49A0567: upload (sna_render.c:505)
==29553==

Reported-by: bonbons67@internet.lu
References: https://bugs.freedesktop.org/show_bug.cgi?id=56785
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-10 16:52:09 +00:00
Chris Wilson cc2b13c9c0 sna: Specify read/write domains for no-relocation fastpath
On review (read triggering BUGs), we do need to supply the domain tracking
of the buffers that is being replaced from the relocation path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-10 13:02:49 +00:00
Chris Wilson 0c4a2bcc3d sna: Allow snooped buffers to be retained (and reused) between batches
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-10 12:37:33 +00:00
Chris Wilson f5d79b202d sna/gen2: Add a modicum of fallback DBG
References: https://bugs.freedesktop.org/show_bug.cgi?id=56785
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-10 10:30:04 +00:00
Chris Wilson 2732763313 sna/gen4: Only 965gm suffers the !snoop restriction
So fixup the bogus assertion for g4x

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-09 17:08:01 +00:00
Chris Wilson 8d3b5ea135 xvmc: Use DRMINTEL_LIBS instead of hardcoding -ldrm_intel
Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-09 15:31:03 +00:00
Chris Wilson f040b97b01 sna: Mark no-reloc write buffers
If we bypass the relocation processing, we also then bypass the
pending-write analysis, so we need to supply those to the kernel
ourselves (to maintain gpu-cpu coherency).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-09 08:59:26 +00:00
Chris Wilson 85ba7e9626 sna: Experiment with using reloc.handle as an index into the execbuffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-08 17:06:29 +00:00
Chris Wilson 93d8dddbb9 sna: Set the known offset for the batch as well
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-08 09:41:21 +00:00
Chris Wilson 120fa0ef8d sna: Support a fast no relocation changed path
x11perf -copywinwin10 on gm45 with c2d L9400:
  before: 553,000 op/s
  after:  565,000 op/s

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-08 08:58:58 +00:00
Chris Wilson b7d2fcf47a Remove reliance on hard-coded DRI name
This provides for using the existing DDX with future DRI drivers which
may break from the traditional names - but only with the help of the
user/packager. This scheme needs to be replaced with a robust mechanism
for driver loading if AIGLX and co are to be kept.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-08 08:58:22 +00:00
Chris Wilson cefce9c815 sna: Abandon kernels that do not support execbuffer2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-07 09:17:57 +00:00
Chris Wilson b2245838c1 sna/gen4: opacity spans requires the per-rectangle flush w/a
Note that this is worsened, but not caused, by:

commit e1a63de899
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Nov 2 09:10:32 2012 +0000

    sna/gen4+: Prefer GPU spans if the destination is active

References: https://bugs.freedesktop.org/show_bug.cgi?id=55500
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-06 16:41:13 +00:00
Chris Wilson a0540ebff0 sna/gen4: Remove a couple of old, now redundant, w/a flushes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-06 16:00:42 +00:00
Chris Wilson aaaa6c3564 sna/gen4: Flush after pipelined pointer updates (inverted logic!)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-06 14:34:51 +00:00