Commit Graph

5479 Commits

Author SHA1 Message Date
Chris Wilson 5a45cbacb7 uxa: Confirm the pipe is alive before flipping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 13:31:27 +01:00
Chris Wilson edc5b7f741 uxa/dri: Confirm Drawable is still attached to an active pipe before flipping
If we schedule a flip to happen on a far distant vblank, it is possible
for us to disable the pipes with a modeset, whilst maintaining the fb
size, or with a DPMS command. If the pipe is disabled and we still try
to flip, then we trigger an EINVAL error from the kernel.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 13:27:20 +01:00
Chris Wilson eb66737854 sna: Typo in DBG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-26 15:10:30 +01:00
Chris Wilson 557ad78d02 Kill mibstore pretend backwards compatibility
Adam Jackson was kind enough to point out that mibstore had been a no-op
since xorg-1.4 and the earliest we claim to support is xorg-1.6.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-26 15:02:17 +01:00
Chris Wilson 367f57faf2 sna/video: Force integer promotion to avoid u16 overflow for frame size
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-26 14:37:06 +01:00
Chris Wilson 34772cb0e7 sna/dri: Handle pending flips when drawable disappears.
The async case needs special handling as the current front buffer may be
pending a flip onto the scanout which needs to be completed even if the
Drawable is destroyed.

Fixes regression from commit ad877abdc7
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Jul 7 17:48:52 2012 +0100

    sna/dri: Attach the chain of frame events to the Window, not pixmap

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-26 12:09:39 +01:00
Chris Wilson addfa653cf uxa: Prevent attempting to call intel_mode_fini() before PreInit runs
In the Ubuntu xserver it is apparently possible for the Screen to be
deleted prior to being fully initialised. Make sure we don't crash in
that situation!

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55346
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-26 08:59:18 +01:00
Chris Wilson b880d8e0a9 sna/gen5: Add WA reference
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-25 16:59:20 +01:00
Chris Wilson 74f930fd80 sna: Make sure the batch is flushed before setting DPMS
Just in case on the off-chance that the kernel modifies the pipe and we
had a pipe-dependent operation in the batch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-25 15:41:51 +01:00
Chris Wilson 0a00c3765c sna: Accommodate changes to the Damage extension not unwrapping the GC
commit 4dc2a76740d921c824a4d8193f39dd373475f02a
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu Sep 20 17:57:00 2012 -0400

    miext/damage: Only wrap into the GC ops chain if there's a listener (v3)

leaves the GC->funcs still pointing to the damage layer as it calls into
the driver functions, so we need to be careful to restore the correct
function table after we manipulate the GC for fallbacks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-25 13:54:05 +01:00
Chris Wilson 8f5a6d107b Add miInitializeBackingStore() to compat-api.h
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-25 13:38:00 +01:00
Chris Wilson dee133a722 sna: Remove unused reference to mibstore.h, removed in future Xorg
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-25 13:22:40 +01:00
Chris Wilson f0dbfc20aa sna/dri: Fixup a DBG statement not to print gibberish
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-25 13:22:21 +01:00
Chris Wilson c600806837 sna: Check against op->dst.bo rather than priv->cpu_bo for composite upload
In this case, we may also be handling an unattached pixmap, so avoid the
deferences of the sna_pixmap unless we are sure it will exist.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-23 21:44:56 +01:00
Chris Wilson 5ed840881c sna: Check that the CPU bo exists before declaring it is busy along upload
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55251
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-23 20:31:19 +01:00
Chris Wilson a858afc66c Silence a couple of potential compiler warnings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-23 13:49:40 +01:00
Chris Wilson 9326acc291 Allow compilation of a separate i810 driver
Allow --enable-ums-only as a counter-option to --enable-kms-only in case
the distribution wishes to enable a non-root KMS driver but also offer
a separate UMS driver for i81x.

On the second pass, use "--enable-ums-only --disable-uxa --disable-sna"
to get the trimmed down unaccelerated i810 support.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-23 13:41:55 +01:00
Chris Wilson 0afb7efe8c sna: Avoid overflows when translating the box16 extents during a copy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-23 09:41:59 +01:00
Chris Wilson 0fc6e5820e sna: Add missing protection against int16 overflow when copying
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-23 09:32:49 +01:00
Chris Wilson c2ca1c5abc Reorder INTEL_XVMC define so that we pick up Option "XvMC"
Otherwise it will remain disabled.

Reported-by: Giacomo Comes <comes@naic.edu>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-23 08:56:50 +01:00
Chris Wilson 92dbedc613 sna: Force the stall before trying to upload into a busy CPU bo
Under the circumstances where we can not instead stream the write into
the GPU bo, we need to use the busy CPU bo.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54978
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-22 08:58:30 +01:00
Chris Wilson 3e1be265cf sna: Force an inplace upload if already wedged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-21 17:37:58 +01:00
Chris Wilson b8967aff38 sna: Do not query for the NULL edid property
If the EDID blob id is set to 0, that means that it does not exist and
so we can safely skip it.

References: https://bugs.freedesktop.org/show_bug.cgi?id=55193
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-21 12:17:07 +01:00
Chris Wilson 0be1d96471 sna: Use inplace X tiling for LLC uploads
Based on a suggestion by Chad Versace (taken from a patch for mesa).

This allows for a faster upload of pixel data through a ShmImage, or for
complete replacement of a GPU bo.

Using a modified version of x11perf to upload to a pixmap rather than
scanout on an IVB i7-3720qm:

Before:
40000000 trep @   0.0007 msec (1410000.0/sec): ShmPutImage 10x10 square
 4000000 trep @   0.0110 msec (  90700.0/sec): ShmPutImage 100x100 square
  160000 trep @   0.1689 msec (   5920.0/sec): ShmPutImage 500x500 square

After:
40000000 trep @   0.0007 msec (1450000.0/sec): ShmPutImage 10x10 square
 6000000 trep @   0.0061 msec ( 164000.0/sec): ShmPutImage 100x100 square
  400000 trep @   0.1126 msec (   8880.0/sec): ShmPutImage 500x500 square

However, the real takeaway from this is that the overheads for
ShmPutImage are substantial, only hitting around 70% expected efficiency,
and overshadowed by PutImage, which for reference is

60000000 trep @   0.0006 msec (1800000.0/sec): PutImage 10x10 square

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-21 11:56:16 +01:00
Chris Wilson d853064e7e sna/gen3+: Trim the target extents to the CompositeClip
When computing the active region with of a composite operation with
unknown extents we try to simply use the whole Drawable. However, this
needs to be clipped otherwise it may trigger assertion failure with an
offscreen pixmap.

References: https://bugs.freedesktop.org/show_bug.cgi?id=55164
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-20 22:43:26 +01:00
Chris Wilson 853beff430 sna/dri:Add some DBG and assertions to validate names passed back to clients
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-19 08:35:28 +01:00
Chris Wilson 8c1e60a154 sna: Add some asserts useful for tracking an xserver drawing bug
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-18 15:01:52 +01:00
Chris Wilson cd23ac69ff sna/gen7: Add some ring switching sanity checks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-18 13:38:47 +01:00
Chris Wilson 22c84d02ad sna: Remove special casing of drawing depth=1 glyphs
It turns out that they were not so special after all, and the "fast
path" was missing the important handling such as validating the GC. As a
result we ended up trying to render the glyphs through a planemask of 0
and similar garbage resulting in corruption. An example given by Kaus
Dittrich was the use of rotated glyphs in gnuplot.

Reported-by: Klaus Dittrich
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-18 13:38:47 +01:00
Chris Wilson 71fa350325 sna: Check that we do not keep a GPU bo around after flushing a ShmPixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-18 13:38:47 +01:00
Chris Wilson 395d738b50 sna: Improve handling of probe failure during initialisation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-15 21:18:14 +01:00
Chris Wilson fe78904a45 Add basic support for ValleyView
Bind to the ValleyView SDV for verifying the render routines.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-14 21:51:36 +01:00
Chris Wilson d995705fb0 sna: Only discard CPU damage if we completely overwrite its extents
If we are performing a clipped copy, then we must be careful not to
completely discard the CPU damage as it may not be entirely replaced.

Reported-by: Roman Jarosz <kedgedev@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54937
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-14 19:32:06 +01:00
Chris Wilson deacab87e4 sna/dri: flip->next_front.bo is owned by the DRI drawable not by the flip
Be careful not to delete the reference we presume we hold as it is
borrowed from the DRI drawable.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-14 17:01:13 +01:00
Chris Wilson 5369408d59 sna/dri: And the hunt for the use-after-free continues...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-14 16:12:00 +01:00
Chris Wilson 8e9d642034 sna: Fix typo for sna_render_picture_flatten()
Pass it the correct value for the pixmap height, and not its 'y'
coordinate!

Reported-by: Eugene Rosenzweig <ugn@outlook.com>
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=434860
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-14 14:06:38 +01:00
Chris Wilson 6ee9969f0e sna/dri: Update AsyncSwap for recent changes in tracking DRI drawables
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-14 13:04:50 +01:00
Chris Wilson d2dbb99138 sna/dri: Add a bunch of assertions for hunting a use-after-free
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-14 13:04:14 +01:00
Chris Wilson d875609147 sna/dri: Version bump for prototypical AsyncSwap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-14 12:17:28 +01:00
Chris Wilson 0fc3d020f3 Skip adding unknown special modes
In light of the discussion on how to add stereo modes it was revealed
that we would happily add modes with unknown and unhandled strange
flags. Adam Jackson mentioned that he has plans to fix that with some
upcoming work, but as a first step we can simply eradicate them whilst
pondering how to support the stereoscopic vision of the future.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-14 10:00:45 +01:00
Chris Wilson 35d81d97b3 sna/gen7: Defensively program default GT values
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 22:47:32 +01:00
Chris Wilson 3fbdedbf9d sna: Fix analysis of source extents for BLT composite
After we have computed the source offset vector for the transformed
source bo, we need to use that with respect to the destination rectangle
to verify that the source sample is wholly within bounds.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 22:10:08 +01:00
Chris Wilson 6c7f998f7b sna: Fix BLT composite offset
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54868
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 20:41:23 +01:00
Chris Wilson 2575cd0d23 sna: Avoid corrupting the CPU bo when compositing fallback data through BLT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 20:08:37 +01:00
Chris Wilson 5781de2e5a sna/gen3: Tidy NO_COMPOSITE debugging
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 19:53:29 +01:00
Chris Wilson dd1432b2c0 sna: Do not attempt to change tiling if wedged
The caller will just have to live with the current tiling, which should
be fine in most cases, in other cases the gpu is wedged...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 19:47:29 +01:00
Chris Wilson 8c7dd2219f sna: Prefer to use indirect uploads for very small updates
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 17:14:23 +01:00
Chris Wilson d87a56ed17 sna: Teach sna_replace__xor() how to tile large uploads
This path is hit using eog+cairo-1.10 and a large image, e.g.
http://marsrovers.jpl.nasa.gov/gallery/press/opportunity/20120705a/PIA15689_Greeley_Pan_wDeck_L257F.jpg

Reported-by: Michael Laß <bevan@bi-co.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54808
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 09:57:30 +01:00
Chris Wilson 58a96f0f68 sna: Also remove bogus assertion from sna_replace__xor()
Like the assertion in sna_replace() this is now incorrect due to the
automatic flagging of large bo with flush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-12 23:53:44 +01:00
Chris Wilson 6069e78238 sna: Keep a very small, short-lived cache of large buffers
As we now regularly retire and so discard the temporary large buffers,
we find them in short supply and ourselves wasting lots of time creating
and destroying the transient buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-12 16:24:25 +01:00