Commit Graph

6682 Commits

Author SHA1 Message Date
Chris Wilson a0bb41d16f sna/video: The sprite framebuffer also encodes its format
So we need to check whether the cached framebuffer matches the requested
format, or else recreate.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-29 13:33:26 +01:00
Chris Wilson 0dd2038136 sna: Resize an existing framebuffer if possible
Sometimes we may have a compatible scanout cached, but of the wrong
size. Instead of throwing away the memory and creating a new scanout
from scratch, allow us to just resize the old scanout by destroying and
recreating its associated framebuffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-29 11:22:37 +01:00
Chris Wilson 902ce98df1 sna/video: Don't allow caching of yuv scanouts
We only want scanouts capable of being used for the front buffer in our
cache, so make sure that YUV formatted fb are destroyed upon release.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-29 11:22:37 +01:00
Chris Wilson 4a7587ca1c sna/video: Discard old video buffers when the frame size changes
Back in the good old days of the overlay, we only needed to care about
having a frame buffer large enough to hold the data. This changed with
the sprite interface which encodes the width x height into the
framebuffer and so we need to be careful when handing back a cached
buffer that it does indeed match the required dimensions.

Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-29 11:21:41 +01:00
Chris Wilson 2c67e9da5f sna: Avoid reads from a GTT mmapped upload buffer
We now allow LLC machines to also use GTT upload buffers, so we need to
be cache when scanning the cache to look for suitable buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-28 10:15:03 +01:00
Chris Wilson 5a5f9b2812 sna: OsSigHandler expects 0 on handled
Returning 0 from sigtrap_handler() when we wish to fallback to the core
OsSigHandler was precisely the wrong thing to do.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-28 08:12:22 +01:00
Chris Wilson 2893d2b516 sna: Fix regression in picture extraction
This is a little helper function, that just returns a bool, not the
error code used by the render backends. Instead the caller tries an
alternative method of extraction before giving up.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27 19:52:30 +01:00
Chris Wilson 4c9265ebff sna: Only flush the scanout if we successfully upload it to the GPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27 10:47:18 +01:00
Chris Wilson 47ac44159c sna: Make sure we do not try to upload indirectly if the GPU is wedged
Otherwise we trigger assertions and may end up with corruption.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27 10:47:18 +01:00
Chris Wilson 7206d0bb91 sna: Disable the promotion of large bo as flush
We can rely on our aperture and idleness tracking to appropriate flush
batches. Marking the large bo as flush interferes with the treatment of
flush for externally named bo, such as DRI/PRIME.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27 10:47:18 +01:00
Chris Wilson 6ac1ac98c2 sna: Catch SIGBUS to prevent X death
We know that when we access either a CPU or GTT mmap we are vulernable
to receiving a SIGBUS. In fact, we can catch these and abort the
operation preventing X and all of its clients from randomly dieing.

This helps for instance if you try and use a 1GiB frontbuffer on a 2GiB
machine...

For complete protection, we also need to catch signals for all GTT maps,
such as VBO and staging buffers. (TBD)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27 10:47:18 +01:00
Chris Wilson 7025956558 sna: Mark all large cached buffers as purgeable
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27 10:47:18 +01:00
Chris Wilson 455754ca8d sna: Make sure the transformed CRTC box is clipped correctly.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27 10:47:18 +01:00
Chris Wilson ec9ffc9e41 sna: Trigger fallback after intermediate pixmap allocation failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27 10:47:17 +01:00
Chris Wilson bbfbe22954 sna/gen4+: Handle very large copies more gracefully
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27 10:47:17 +01:00
Chris Wilson 4d2840919f sna: In desperation, query the actual available aperture space
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27 10:47:17 +01:00
Chris Wilson bf1268838a sna: Drop the REPLACES hint for a pinned target bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-26 14:48:31 +01:00
Chris Wilson 50bd37cf7f sna: Simplify the clearing of a transformed frontbuffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-26 14:24:45 +01:00
Chris Wilson c9445af34a sna: Remove a bogus assert
We keep active/inactive scanouts in the same cache, so drop the assert
that they are all inactive - as it is handled a couple of lines later!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-26 11:43:14 +01:00
Chris Wilson 17f47afcbc sna: Eliminate a DBG compile warn for 32-bit builds
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-26 11:42:05 +01:00
Chris Wilson 8ef851b223 sna: Promote self-copies to the GPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-25 15:07:48 +01:00
Chris Wilson 1c7df83ca7 sna: Micro-optimise copies
Defer the read of the fExpose bit until we need it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-25 15:07:24 +01:00
Chris Wilson d7eb40efa7 sna: Check that the bo exists before attempting to undo it
Fixes a NULL dereference from sna_blt_composite().

Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1228677
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-25 13:54:43 +01:00
Chris Wilson a934b2455a sna: Add a few more asserts around tracking of bo->exec vs bo->request
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-25 12:06:56 +01:00
Chris Wilson 598dae9af9 sna/gen[35]: Remove dead code for choosing between BLT/render composite
For these gen, we always want to use BLT where possible - even if it
incurs a context switch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-25 10:53:11 +01:00
Chris Wilson 3a05b1a4aa sna/gen6+: Fallback to BLT composite if fallback is forced
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-25 10:53:07 +01:00
Chris Wilson 5dfe9217f2 sna: Clear CPU damage when uploading partial images inplace
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-25 09:40:35 +01:00
Chris Wilson 53b43673ef sna: Add some DBG for early flushes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-25 09:40:35 +01:00
Chris Wilson ad03900688 sna: Separate out copy preferrence from operating in place decision
The two decision trees are no longer identical.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-25 09:40:34 +01:00
Chris Wilson 63a81c87b1 sna/dri: Prevent a NULL dereference in a DBG msg
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-23 21:12:19 +01:00
Chris Wilson 3fd116782b sna/dri: Clear the clear hint upon applying DRI damage
Otherwise a later call to GetImage will not notice the DRI update if it
was already clear - and so return a blank image. One example is the use
of x11vnc replaying xbmc.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69730
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-23 21:12:17 +01:00
Chris Wilson 8f54e9d3c4 sna: Check OPTION_PREFERRED_MODE rather than M_T_USERPREF
During the intial KMS probe, we do not yet have the list of output
modes, and in particular do not have the list of user preferred modes.
So, in order to honour the user preferrence, we need to query for any
preferred mode on the output from the option list.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=841696
2013-09-23 19:37:48 +01:00
Chris Wilson 3e276b96cb sna/video: Add always-on-top to the list of Xv attributes
Otherwise it goes unknown, and not reported by xvinfo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-23 14:17:03 +01:00
Chris Wilson e4850bbbcc sna: Fix cast from u64 to pointer for 32-bit hosts
Missing chunk from

commit 42330fbae8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Sep 22 14:39:57 2013 +0100

    sna: Track CPU/GTT maps independently

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-23 11:55:21 +01:00
Chris Wilson bee26a8e2e sna/dri: Sanitize the backbuffer flip cache
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-23 10:49:46 +01:00
Chris Wilson c4f5da7ab9 sna/dri: Report saner target_msc values for vblank_mode=0
If desired target_msc is 0 report 0 rather than (CARD64)-1.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-23 10:48:53 +01:00
Chris Wilson f296872f37 sna/dri: Fix SwapbufferWait
A regression from

commit f99e49f764
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Sep 17 09:15:40 2013 +0100

    intel: Make the option to control VSync and PageFlip explict

which used the inverse meaning of the option to disable waiting on
swapbuffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-23 10:48:52 +01:00
Chris Wilson 42330fbae8 sna: Track CPU/GTT maps independently
Now that we use CPU mmaps to read/write to tiled X surfaces, we find
ourselves frequently switching between CPU and GTT mmaps and so wish to
cache both.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-23 10:48:52 +01:00
Chris Wilson 8478e9c444 sna: Both clear PolyGlyph and ImageGlyph are no-ops
For ImageGlyphs, we pre-clear the area hence the bg is always set.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-22 10:38:57 +01:00
Chris Wilson 395f07b1fe sna: Undo region translation after failing to begin ImageGlyphs
If we fail the initial tests, we need to undo our translation to the
region before returning and starting the fallback paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-22 10:38:57 +01:00
Chris Wilson 2851b7747b sna: ImageGlyphs completely overwrite the destination
So we can use the usual rules for discarding unused reads.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-22 10:31:01 +01:00
Chris Wilson 27f87a56e9 sna: Don't set the mapped hint for inplace tiled accesses
The mapped hint is only useful for coherent mappings where it is
preferable to guide placement of regular operations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-21 08:44:59 +01:00
Chris Wilson 799f1e2355 sna: Prevent invalid use of set-write-domain on scanouts when debugging
One debugging option forces the use of the write domain when
synchronising to force a full synchronisation. This trips up an
assertion to catch when we try to move the scanout into the CPU write
domain. So don't.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-21 08:37:40 +01:00
Chris Wilson 4497212307 uxa: Do not change DPMS mode on unconnected outputs
The operation is in theory redundant, and in the case of Haswell where
we have multiple outputs aliasing to the same encoder, actually harmful.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68030
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Stefan Dirsch <sndirsch@suse.de>
2013-09-20 11:45:47 +01:00
Chris Wilson 63a070a31a sna: Do not change DPMS mode on unconnected outputs
The operation is in theory redundant, and in the case of Haswell where
we have multiple outputs aliasing to the same encoder, actually harmful.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68030
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-19 15:35:34 +01:00
Chris Wilson 011e567e84 sna: Add output names to DBG dpms changes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-19 15:35:22 +01:00
Chris Wilson 0e1abe3cd0 sna/gen4: Remove long dead code for forced batch emission between CA passes
Forcing the batch emission on virtually every glyph eats a lot of CPU
time sending very short commands to the GPU, and is totally unnecessary.

Reported-by: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-19 13:00:36 +01:00
Chris Wilson 6316905983 intel: Fix includes for intel_options
In commit dcf9b5ae18
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Sep 17 22:27:45 2013 +0100

    intel: Compile fixes for base install of SLED11.sp3

the includes were juggled around to avoid pulling in xorg-server.h
outside of the driver. However, missing xorg-server.h leads to subtle
bugs in the layout of structures, in this case breaking xf86Options.

Reported-by: FBrown <francisbrwn9@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69555
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-19 11:28:30 +01:00
Chris Wilson afad7dd43d sna: Pushed dixPrivateKeyRegistered wrapper into compat-api.h
Move the wrapping out of the main code body and hide it with the others
in our compatability header.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-18 15:37:09 +01:00
Chris Wilson 53574e4f4f sna: Wrap use of dixPrivateKeyRegistered for uevents
SLED11 also requires us to poke around in the privates as it does not
provide the more recent privates API.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-18 15:28:09 +01:00