Commit Graph

5969 Commits

Author SHA1 Message Date
Chris Wilson 0ae6c2ccb0 sna: Actually upload the damage when replacing a busy CPU bo for PutImage
Reported-by: Roman Jarosz <kedgedev@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55508
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-02 11:44:16 +01:00
Chris Wilson 52b211cb15 sna: Tweak CPU damage partial upload paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-02 11:35:25 +01:00
Chris Wilson 1fc3fa699c sna: Avoid accumulating damage to the CPU if it is already damaged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-02 11:35:24 +01:00
Chris Wilson 8c2821d77c sna: Remember to call ValidatePicture() before using newly created Pictures
Reported-by: Marco De Michele <marco.demichele@taolab.it>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55527
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-02 11:32:47 +01:00
Chris Wilson 5120279886 uxa: Remove USE_GLAMOR check from unrealize glyph caches
In an interesting twist during teardown, the driver info structure is
freed long before the caches. However, the glyph cache teardown was
checking to see if glamor was enabled to see if it could skip the
teardown. In fact, since we won't have created the glyph caches in that
circumstances it was safe any way.

Reported-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-01 13:06:42 +01:00
Chris Wilson ba1dea5e37 sna/gen2: Clear STIPPLE setup before rendering with the 3D pipeline
One over-zealous removal too many.

Reported-by: Timo Kamph <timo@kamph.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55455
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-01 11:19:41 +01:00
Chris Wilson eec12faf82 sna/dri: Check back/front buffers of a pixmap for format change
Highly unlikely.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-30 18:39:36 +01:00
Chris Wilson 8e23251aad sna: Cache repeated use of the temporary CPU mapping for tiled_x uploads
Fixes ShmPutImage regression under gnome-shell

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-30 13:52:34 +01:00
Chris Wilson 1756cf4d8e sna/dri: Only chain to a triple buffer pageflip sequence
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-30 12:26:23 +01:00
Chris Wilson ba525463fb sna/dri: Improve handling of async/sync pageflip transition
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-30 10:44:05 +01:00
Chris Wilson 2eab5ef751 sna: Make sure the CPU bo is destroyed if we fail to mmap it during alloc
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-30 09:04:25 +01:00
Chris Wilson 45b351412b sna: set_cacheing returns a bool not an error-code
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-30 09:04:25 +01:00
Chris Wilson 33f6f75378 sna/dri: Swallow error from GetMSC
Just ignore the error return from WaitVBlank and make up a value for
last MSC/SBC similar to an unattached Drawable.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55395
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-29 16:42:28 +01:00
Chris Wilson a873f6d354 sna: Release the front buffer and drop DRM master early during shutdown
If we delay the dropping of DRM master we may complete a VT switch
before we are ready and so prevent a second X server from reacquiring
master, and dying.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55446
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-29 16:42:28 +01:00
Chris Wilson a192f8cbc2 2.20.9 release
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-29 10:51:59 +01:00
Chris Wilson 16860d448f uxa: Only destroy the bufmgr if it exists
Be wary in case the Screen is destroy before we initialise bufmgr.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-29 10:40:51 +01:00
Chris Wilson 13f7a9e267 sna: Restore LLC cache level after using a buffer for scanout (uncached)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-28 09:25:12 +01:00
Chris Wilson 8bfd31e9bb sna/dri: Improve handling of flipping with no outputs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 21:15:16 +01:00
Chris Wilson dddb6e4e63 sna: Attempt to restore the current mode if pipe is disabled on DPMS on
If we attempt to power up the pipe through a DPMS request, but it was
previously disabled due to an error, first try re-enabling.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 20:02:13 +01:00
Chris Wilson 88cfd23379 uxa: Update mode->fb_id after completing pageflips
As intel_crtc_on() depends upon the current value for determining if the
pipe is active, we can only change the value afterwards.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 16:16:39 +01:00
Chris Wilson 83990c649c Remove the last couple of references to mibstore
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 14:58:57 +01:00
Chris Wilson cb0b72c4fb uxa: Fixup the last couple of commits after realising I didn't have uxa enabled
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 14:53:46 +01:00
Chris Wilson feef53005b uxa: Do not attempt to pageflip whilst not master
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 14:40:58 +01:00
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