Commit Graph

7102 Commits

Author SHA1 Message Date
Chris Wilson fc4e81726d sna/video: Disable the existing sprite when switching CRTCs
After starting a new video on another CRTC, disable the old one as we
currently only track the single video port. However, showing a video
split across multiple CRTCs would be a useful extension in the future.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-23 02:25:34 +01:00
Chris Wilson 509e7aaf84 sna/gen7: Prefer the render ring for more operations
As we get more well-endowed GPUs with ever more execution units, it
becomes advantageous to do even basic copies through the render ring.
However, the extra performance comes at a cost - higher power usage. To
mitigate this, we apply a heuristic of only allowing a switch over to
the render ring if the render ring is already active with an early
request (in addition to the usual stall avoidance and general
performance heuristics).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-23 02:12:59 +01:00
Chris Wilson f57ce6ef9c 2.21.15 release 2013-08-21 12:20:29 +01:00
Chris Wilson ed40a7c3de sna/gen6+: Tweak semaphore avoidance for composite operations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-18 14:45:39 +01:00
Chris Wilson 4486ae2d82 sna: Do not force use of the CPU bo if replacing a busy GPU bo
To minimise waiting for the SHM pixmap afterwards.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-18 10:11:49 +01:00
Chris Wilson f1cbf13bb1 sna/video: Initialise the UV offsets to 0 for packed formats
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-17 23:37:57 +01:00
Chris Wilson db41bec0fd sna/video: Return the planar offset calculations to the planar branch
They where accidentally move the packed branch in
commit 85e89f2121
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Aug 16 21:11:33 2013 +0100

    sna/video: YUV420 is not supported by sprites, replace it with a RGB passthrough

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-17 23:34:46 +01:00
Chris Wilson fed9ca236a sna/video: Turn off passthrough if given a zero name
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-16 22:43:26 +01:00
Chris Wilson 18e274425d sna: Make sure that external scanouts are immediately discarded
An issue with passthrough Xv buffers is that they end up in the scanout
cache and potentially reused instead of being immediately discarded.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-16 22:03:25 +01:00
Chris Wilson 6692077aca sna/video: Keep a ref to the passthrough overlay bo
Otherwise we will destroy it at the end of the frame whilst it is still
meant to be shown. Not normally an issue as the next frame is show
before it vanishes, but is if the image is shown for an extended period
of time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-16 22:03:25 +01:00
Chris Wilson d8c9b2c852 sna/video: Mark the sprite color key as changed when disabling
Otherwise we will forgot to send the command to turn off the colorkey.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-16 22:03:25 +01:00
Chris Wilson 85e89f2121 sna/video: YUV420 is not supported by sprites, replace it with a RGB passthrough
As YUV420 is not supported by any of the current sprite implementations
drop it. Instead implement some RGB passthroughs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-16 21:32:09 +01:00
Chris Wilson c610d37dae sna/video: Expose an attribute to keep the overlay always on top
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-16 18:22:45 +01:00
Chris Wilson 7a6bd55da9 sna/video: Don't assert on a client error, return BadAlloc
If the client sends a BO that is too small to satifsy the PutImage, then
reject with BadAlloc rather than die with an assert.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-16 15:39:30 +01:00
Chris Wilson cb35a0b19a uxa: Restore the lost copyright block after splitting i965_reg.h from i915_reg.h
Reported-by: "Lim, Siew Hoon" <siew.hoon.lim@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-16 08:48:32 +01:00
Chris Wilson 445f205a18 sna: Clip the tiled copy during framebuffer resize
If we use the BLT for copies, then we need to supply correctly clipped
coordinates.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-15 00:28:25 +01:00
Sedat Dilek 6bd897157b Correct misspelled caching
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
2013-08-14 19:10:11 +01:00
Chris Wilson 5d29daa7df sna: Make sure the frontbuffer exists before doing pitch checks
An unusual path to be sure, to call sna_crtc_set_mode_major before we
create a GPU bo for the scanout - but might be possible after a GPU
hang, or it appears after trying to set a 0x0 mode. At any rate, make
sure the GPU bo exists before dereferencing.

Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1212344
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-14 18:21:58 +01:00
Chris Wilson a0f90a4c79 sna: Rename sna_pixmap_get_bo()
Mark how dangerous this function is by giving it a __ prefix.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-14 18:12:15 +01:00
Chris Wilson 2be9118e88 sna: Tile the old image onto the new framebuffer when enlarging
This improves the transition from going from a mirrored fbcon
framebuffer to an extended mode.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-14 17:54:46 +01:00
Chris Wilson 394978867e sna: Check that we successfully install the required hosting midlayer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-14 08:38:52 +01:00
Chris Wilson 3d818c0a36 sna: unwrap old modesetting API whilst hosted
If we are hosted, then we do not have our own modesetting backend and
calling it results in fireworks. So leave the old modesetting entry
points for the hosting midlayer to control.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-14 08:34:46 +01:00
Chris Wilson 504b18b079 sna: Fix the assertions for the composite fb path
Having updated the offsets for the dst, we also need to update the
assertions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-13 11:02:05 +01:00
Julien Cristau 5840bfe285 Link the driver against pixman 2013-08-12 22:50:29 +01:00
Julien Cristau b2df6cc8f0 configure: use CPPFLAGS for xaa.h check, not CFLAGS
CFLAGS aren't passed to the preprocessor, which then can't find the
header.

Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-08-12 22:42:18 +01:00
Julien Cristau d661332de9 Check for struct sysinfo as well as <sys/sysinfo.h>
Non-linux glibc systems have the latter but not the former.

Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-08-12 22:42:12 +01:00
Chris Wilson 5775731b64 sna/glyphs: Do not attempt to release the negative cache lookup
Following

commit 021c59f624
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Aug 10 13:15:48 2013 +0000

    sna/glyphs: Micro-optimise glyph drawing

we need to be careful during sna_glyph_release() that the atlas points
into the glyph cache before releasing it. Fortunately caught by an
assertion.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-12 22:24:47 +01:00
Chris Wilson 8da8c88e99 intel: Check for HW_SKIP_CONSOLE before use
For the older xserver.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-12 13:12:21 +01:00
Chris Wilson 4abc9c317b configure: Correct the spelling of XORG_TESTSET_CFLAGS
Reported-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-12 13:10:05 +01:00
Chris Wilson ce666270c8 sna: Fix use of obsolete this_atlas in a DBG message
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-12 13:07:03 +01:00
Chris Wilson b3cb8b209d configure: Fix reversed check for XORG_TESTSET_CFLAG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-12 13:05:18 +01:00
Chris Wilson 9645e71cb2 sna: Reorder composite fallback migration to handle src==dst || mask==dst
Order is important when moving and marking damaged regions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-12 11:28:03 +01:00
Chris Wilson e8dfc5b3f4 sna: Fix destination offset along memcpy composite fallback fastback
The application of dst_x|y was incorrect, and so the drawing could end
up in the wrong location for a window.

References: https://bugs.freedesktop.org/show_bug.cgi?id=66990
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-12 10:33:41 +01:00
Chris Wilson 8d48a43ed9 sna/gen7: Refine ring selection
Don't force us to select BLT too early if we allow ring switching. As
the RENDER ring benefits from more cacheing over time (e.g. HSW:GT3e) it
becomes much more preferable to use it over the BLT. Since we already
have the logic to decide if ring switching is possible/preferred, relax
the initial checks on where the current activity is to allow switching
between batches.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-11 11:50:53 +01:00
Chris Wilson 6f3999f38c sna: Avoid confusing conflicting CRTC probes vs a DRM race
Only bail we fail to find the CRTC for this output amongst the allowed
set for this ZaphodHead - but allow us to find an invalid CRTC.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-10 19:44:00 +01:00
Chris Wilson 6cd366b79a sna: Remove the redundant clearing of kgem at startup
struct kgem is contained within a cleared superstruct.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-10 17:55:50 +00:00
Chris Wilson b364305b16 sna/glyphs: Micro-optimise glyphs-to-dst
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-10 13:41:46 +00:00
Chris Wilson 021c59f624 sna/glyphs: Micro-optimise glyph drawing
When you don't have many cycles to play with, every one counts.

Here we make sure we cache negative lookups for large glyphs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-10 13:35:10 +00:00
Chris Wilson 4d5483c253 sna: Tune pixmap_inplace() not to use a pinned busy GPU bo for replacement
Obviously we can only replace the bo if it is not pinned and so just
incur a stall when we could have instead rerouted the rendering through
its CPU bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-10 08:59:33 +01:00
Chris Wilson de379943b4 sna: Allow LLC to reuse any active write buffer
The inplace write distinction is not important on LLC, so pick any
buffer that is on the GPU and available for reuse.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-09 16:37:29 +01:00
Chris Wilson 821b34f5db sna: Squelch a "valid" mode without a dotclock
There is yet another race in drm initialisation where X is starting long
before the drm device is completely ready, and is being told that the
output has a valid mode, but with bogus settings. Ignore it, and hope it
comes to its senses later on.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-09 14:55:09 +01:00
Chris Wilson b6b5c3f009 intel: Disable incompatible features whilst hosted
Start adding the infrastructure to disable direct hardware access if X
is being run under a system compositor (aka "hosted").

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-09 11:46:24 +01:00
Chris Wilson ab445c2307 sna: Rewrite the can-mmap-cpu test to handle stolen unclaimed bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-09 11:09:42 +01:00
Chris Wilson f1d3d1f8c6 sna: Check for EINVAL after mmapping
I want to catch this error as it happens to see which (stolen) bo is
being erroneously mmapped.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-09 11:09:42 +01:00
Chris Wilson 039a64e89e configure: Only use XORG_TESTSET_CFLAG if defined
Repairs the build for f16 which has an older version of xorg-macros.
Fortunately, as it doesn't define XORG_TESTSET_CFLAG it also doesn't use
it generate noisy output.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-09 09:14:42 +01:00
Chris Wilson 31b4110b51 sna: Use create2 to allocate a DISPLAY bo even if we have not enough stolen
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-08 23:18:20 +01:00
Chris Wilson 0f82c1a451 sna: Always reuse scanout bo where possible
When looking for an inactive scanout and all are busy, select the oldest
for reuse.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-08 23:18:20 +01:00
Chris Wilson bd7e653e1e sna: Avoid leaking stolen framebuffer bo
Framebuffers created from stolen bo were not being released and so the
kernel would keep the fb and bo alive, causing the memory to be
remain unreusable whilst X lived and us to leak all available stolen
memory.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-08 23:18:13 +01:00
Chris Wilson 097669cd72 sna/dri: Do not create a scanout-capable buffer if not flipping
Avoid paying the penalty of creating an uncached buffer if we never
intend to flip to it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-08 20:58:02 +01:00
Chris Wilson cbf1f97d5d configure: Include the experimental features in the configuration summary
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-08 19:43:24 +01:00