Commit Graph

6069 Commits

Author SHA1 Message Date
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
Chris Wilson 28bda6707d sna: Prevent use-after-free during partial move-to-gpu
As we reuse the input parameter 'box' to hold the array of boxes that
need to be migrated, we need to be careful that we do not later confuse
it with the original input parameter. Otherwise,

==1315== Invalid read of size 2
==1315==    at 0x928B091: box_inplace (sna.h:506)
==1315==    by 0x9292278: sna_pixmap_move_area_to_gpu (sna_accel.c:2554)
==1315==    by 0x9292C14: sna_drawable_use_bo (sna_accel.c:2774)
==1315==    by 0x9356C01: gen7_composite_set_target (gen7_render.c:2448)
==1315==    by 0x9357AA2: gen7_render_composite (gen7_render.c:2800)
==1315==    by 0x92DB12E: glyphs_to_dst (sna_glyphs.c:552)
==1315==    by 0x92DEA8D: sna_glyphs (sna_glyphs.c:1664)
==1315==    by 0x4F920E: damageGlyphs (in /tmp/Xorg)
==1315==    by 0x4F2FF6: ProcRenderCompositeGlyphs (in /tmp/Xorg)
==1315==    by 0x437260: Dispatch (in /tmp/Xorg)
==1315==    by 0x426466: main (in /tmp/Xorg)
==1315==  Address 0xd637054 is 20 bytes inside a block of size 208,464 free'd
==1315==    at 0x4C2A2FC: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==1315==    by 0x92CCFCD: __sna_damage_destroy (sna_damage.c:1469)
==1315==    by 0x928AD74: sna_damage_destroy (sna_damage.h:284)
==1315==    by 0x9291CB2: sna_pixmap_move_area_to_gpu (sna_accel.c:2470)
==1315==    by 0x9292C14: sna_drawable_use_bo (sna_accel.c:2774)
==1315==    by 0x9356C01: gen7_composite_set_target (gen7_render.c:2448)
==1315==    by 0x9357AA2: gen7_render_composite (gen7_render.c:2800)
==1315==    by 0x92DB12E: glyphs_to_dst (sna_glyphs.c:552)
==1315==    by 0x92DEA8D: sna_glyphs (sna_glyphs.c:1664)
==1315==    by 0x4F920E: damageGlyphs (in /tmp/Xorg)
==1315==    by 0x4F2FF6: ProcRenderCompositeGlyphs (in /tmp/Xorg)
==1315==    by 0x437260: Dispatch (in /tmp/Xorg)

Reported-by: Matti Ruohonen <kiesus@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56591
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-05 22:30:29 +00:00
Chris Wilson e62b0cbf95 sna: Add a small delay during startup if another master is still active
There exists a race with plymouthd that can cause the drm device to
reject us as the rightful master, and so cause X to fail to load. Try
waiting for a couple of seconds for whatever it was to close before
giving in.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-02 15:56:05 +00:00
Chris Wilson e1a63de899 sna/gen4+: Prefer GPU spans if the destination is active
Trying to avoid using the inplace scanline rasteriser for large shapes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-02 13:14:58 +00:00
Chris Wilson 72bcd8f85c sna: Try to reduce ping-pong migration for intermixed render/legacy code paths
References: https://bugs.freedesktop.org/show_bug.cgi?id=56591
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 09:30:18 +00:00
Chris Wilson 4e363906a5 sna: Set a valid box when checking for GPU bo for BLT composite ops
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-10-31 23:00:31 +00:00
Chris Wilson b924831e44 sna: Preserve mode if flushing before a scanline wait
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-10-31 22:55:56 +00:00
Chris Wilson 678f958680 sna: assert that the source is not the GTT mapping when uploading
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-31 11:26:18 +00:00
Chris Wilson 783b8048a6 sna: Prefer to use the GPU for uploads if continuing on the GPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-31 11:16:09 +00:00
Chris Wilson 74c912880c sna: Fix a typo in a DBG
Reported-by: Matti Ruohonen <kiesus@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-31 11:12:16 +00:00
Chris Wilson f48a821aa7 sna: Add a few DBG tracepoints to screen init/fini
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-31 10:53:47 +00:00
Chris Wilson bf81d552c4 sna: Clamp the drawable box to prevent int16 overflow
And assert that the box is valid when migrating.

References: https://bugs.freedesktop.org/show_bug.cgi?id=56591
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-31 08:50:44 +00:00
Chris Wilson 31eb704b2a sna: Ensure that the trap is clipped if it ends within the boundary pixel
Reported-and-tested-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56395
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-26 14:22:25 +01:00
Chris Wilson ef431b2d35 uxa: Drain the DRM event queue before server regeneration
Adam Jackson notes that what appeared to be my paranoid ramblings in SNA
actually served a purpose - it prevents a server crash following
server regen if an indirect client happened to be running at the time
(e.g. LIBGL_INDIRECT_ALWAYS=1 glxgears).

Reported-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-25 10:15:39 +01:00
Chris Wilson efb8ff1649 sna: Add missing ValidatePicture() for flattening alphamaps
Reported-by: Armands Liepins <armandsl@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56367
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-24 22:56:20 +01:00
Chris Wilson 1a489142c8 sna: Disable RandR hotplug events if Xinerama is enabled
Since RandR itself is disabled if Xinerama is enabled, for example with
ZaphodHeads, calling RRGetInfo() upon a hotplug event generates an
assertion.

Reported-by: Stephen Liang <inteldriver@angrywalls.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55260
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-24 00:01:24 +01:00
Chris Wilson d87c2756db sna: Beware 16-bit overflow when computing sample areas
Reported-by: Ognian Tenchev <drJeckyll@Jeckyll.net>
References: https://bugs.freedesktop.org/show_bug.cgi?id=56324
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-23 15:52:48 +01:00
Chris Wilson c7f48684cd sna: Only disallow hw sprite scaling on Haswell
Earlier chips (Ironlake, Sandybridge and Ivybridge) have integrated
sprite scalers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-23 15:17:56 +01:00
Chris Wilson 5c3ea9cf69 sna: Update DRI buffer if attached to the framebuffer for TearFree flips
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-22 22:35:17 +01:00
Chris Wilson 4dfc83359d sna: Tidy udev install/remove and add a couple of lines of DBG
References: https://bugs.freedesktop.org/show_bug.cgi?id=55260
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-22 14:56:01 +01:00
Chris Wilson 4d9687d49c sna: Refactor the common code to enable a timer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-22 13:42:30 +01:00
Chris Wilson fb72978887 sna: Only query the system time if we are processing timers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-21 14:36:48 +01:00
Chris Wilson c0d6a75f02 sna: Use the FLUSH_TIMER as the only wakeup timer source
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-21 14:32:14 +01:00
Chris Wilson 7bc829c39a sna: Remove the unused inactive eviction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-21 14:25:00 +01:00
Chris Wilson 9fa6e4aa2d intel: Sanity check that the platform probes points to a i915.ko GEM device
References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1069031
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-21 12:48:06 +01:00
Chris Wilson f6eed98fcf sna: Mark the to-be-damaged region first, then Process afterwards
Damage is processed in two phases, with the actual Damage being appended
before the operation is performed so that a copy can be made before
modification (e.g. software cursors).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-21 10:46:14 +01:00
Chris Wilson 60e4e009f9 sna: Move the source region to the CPU for a self-copy fallback CopyArea
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-20 17:59:45 +01:00
Chris Wilson 7ff8b1ba54 2.20.12 release
How embarrassing! My fault for rushing :(

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-20 16:23:26 +01:00
Chris Wilson 695b2ce2d3 uxa: Fixup drm_intel_bo_disable_reuse() typo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-20 16:19:21 +01:00
Chris Wilson 2083e253b3 2.20.11 release
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-20 16:07:11 +01:00
Chris Wilson fc0ba65f5e uxa: Disable bo reuse after binding to a scanout
On gen6+, bo are expected to be LLC by default. However, as using the bo
for the scanout causes it to be moved into the uncached domain, this
assumption is then false and we should release the bo back to the system
rather than spread the uncached buffers around. The most common
allocator of scanouts is for pageflipping which are already non-reusable
due to the DRI2 export, so there should actually be little impact.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-20 15:37:19 +01:00
Chris Wilson f4c32af48b sna: Clear the damage along with the BO when forcing the stall for inplace BLT
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56180
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-19 16:29:19 +01:00
Chris Wilson 299232bdb6 sna: Reorder final checks for using the BO and setting the damage pointer
When we return NULL from sna_drawable_use_bo(), the expectation is that
the damage pointer is also NULL. However, one SHM path leaked.

References: https://bugs.freedesktop.org/show_bug.cgi?id=56180
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-19 15:02:00 +01:00
Chris Wilson 257abfdabe sna/gen4: Presume we need a flush upon state change similar to gen5+
References: https://bugs.freedesktop.org/show_bug.cgi?id=55627
References: https://bugs.freedesktop.org/show_bug.cgi?id=55500
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-18 12:44:04 +01:00