Commit Graph

5585 Commits

Author SHA1 Message Date
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 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 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
Chris Wilson 8238c67298 sna: secure batches accepted upstream, so simply use runtime detection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-17 22:19:01 +01:00
Chris Wilson 540666a0a8 sna/overlay: Move bo out of GTT domain after binding to overlay plane
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-17 17:01:17 +01:00
Chris Wilson 891bae4aa9 sna: Use the secure batches to program scanline waits on gen6+
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-17 14:37:11 +01:00
Chris Wilson 41be80a8ca sna: Enable support for SECURE batch buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-17 14:02:15 +01:00
Chris Wilson ba6c82cd9d sna/dri: Defensively check for GTT mmap failure during fallback
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-17 14:00:39 +01:00
Chris Wilson 7927f9a351 sna/gen7: Filter BLEND flags for CA glyphs
Fixes regression from commit c51aaa731e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Oct 11 11:36:00 2012 +0100

    sna/gen7: Replace bogus state tracking assertion

The assumption being that we only used the encoded flags for determining
the composite state is false for the magic CA pass.

Reported-by: Oleksij Rempel <bug-track@fisher-privat.net>
Reported-by: Eyal Lotem <eyal.lotem@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56037
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-16 17:56:30 +01:00
Chris Wilson 2ad4aa1955 sna: Drop fake tiled CPU mapping
The only path where this is correct already handles it as the special
case that it is, everywhere else it just nonsense.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-16 11:59:28 +01:00
Chris Wilson 877e9c57c7 sna/overlay: Trim suggested BestSize to fit within the overlay constraints
As the maximum reported image sizes are for the source image, we should
be careful not to recommend the application use an output Window larger
than can be handled by the overlay hardware. So shrink it to fit, whilst
preserving the aspect ratio.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-12 17:57:28 +01:00
Paulo Zanoni 1ec41590c9 Fix possible_clones computation for shared encoders between outputs
Libdrm's possible_clones is a mask of encoders. Xorg's possible_clones
is a mask of outputs, so we just can't do the following:

  output->possible_clones = kencoder->possible_clones;

This is a problem on Haswell because, at least with the current
patches floating on the mailing list, there is more than one connector
per encoder.

This patch writes the code to properly translate libdrm's encoder mask
into Xorg's output mask.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-12 09:45:37 +01:00
Chris Wilson 0b92a5a306 sna: Correct a bogus assertion after inplace PutImage
If we are forced to use the GPU bo as the target because the CPU bo is
busy, the priv->cpu flag is likely to remain set, so we need to clear it
rather than fail the assertion that is false.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-11 12:16:03 +01:00
Chris Wilson c51aaa731e sna/gen7: Replace bogus state tracking assertion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-11 11:53:44 +01:00
Chris Wilson a56fa2fb4a sna: Rearrange switch to suppress a compiler warning in sna_copy_plane_blt()
Hide the impossible default case so that static analyzers are not
confused.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-11 10:55:34 +01:00
Chris Wilson 94a98d1c47 sna: Limit available space for gen2
Since pre-g33 chipsets impose massive alignment restrictions on objects
within the aperture we need to further restrict the amount of available
space to be sure we have sufficient room to accommodate the alignment.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-11 09:24:56 +01:00