Commit Graph

6548 Commits

Author SHA1 Message Date
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 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 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 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 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 fcac4f7f2b sna: Only use the experimental create2 if we support DISPLAY cacheing as well
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-08 14:53:26 +01:00
Raul Fernandes c6add09791 Micro-optimise box intersections
We can shave a few instructions off the routine by incrementally
performing the "is-empty" check as soon as we compute the intersection
in each dimension.
2013-08-08 09:28:20 +01:00
Chris Wilson c01c66bca2 sna: Update experimental create2 struct definition
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-07 18:54:57 +01:00
Chris Wilson a875ba39be sna: Rename the attribute macro __packed__ to avoid clang barfing
Using __packed__ as shorthand for ___attribute__(__packed__) confuses
clang as. (I guess to it expands (__packed__) which gcc skips.) As
clang also uses packed in its builtins, we have to find a compromise,
and so tightly_packed wins for being a more verbose description without
the dangerous leading underscores.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-05 16:20:35 +01:00
Chris Wilson 2536ad044b sna: Tweak threading thresholds
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-04 13:10:26 +01:00
Chris Wilson 2cdd57c804 sna/trapezoids: Some minor DBG to investigate threaded rendering
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-04 12:54:27 +01:00
Chris Wilson 1f7e20d812 sna: Define fast function attribute for old gcc or other compilers
Also written by Mark Kettenis and reported by Sedat Dilek.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-04 12:54:17 +01:00
Chris Wilson a5bf389908 sna: Mark the entire userptr proxy chain as flush/non-reusable
Fixes cache bookkeepping when mixing userptr uploads.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-04 09:51:26 +01:00
Chris Wilson 5287660aaf sna: Reserve relocation entries for the deferred VBO
Whilst we reserved exec entry slots for the deferred VBO, there were no
relocation spaces reserved. So if we submitted a render command followed
by a multitude of BLT copies, we could then overrun the relocation array
when adding the deferred vbo to the batch.

Reported-by: Danny <moondrake@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67504
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-02 13:18:12 +01:00
Chris Wilson 3f04b6f33f sna/dri: Disable TripleBuffering by default for compositors
Ideally, the method of swapping is something that the applications have
control over, along with how to synchronise to the vertical refresh.
Whilst triple buffering is good to reduce jitter for games (at the cost of
an extra frame of latency, usually considered a good tradeoff), it
prevents the applications from accurately controlling the presentation
of animations. One vocal critique is Owen Taylor, who demands accurate
swap control for smooth animations in gnome-shell. For example,

http://blog.fishsoup.net/2012/11/28/avoiding-jitter-in-composited-frame-display/

In lieu of application control, just apply a quirk for the compositor.
Everyone else will just have to wait for DRI3.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-01 15:21:04 +01:00
Chris Wilson 0ae07158c3 sna: Add a few more details to the log for mode switching
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-01 11:18:19 +01:00
Chris Wilson 246911d742 sna: Don't force inline string-ops for the general memcpy_blt routine
As we need optimal copy code for the general case, where unlike
swizzling the run lengths are not known before hand, we need to call the
arch specific routines from glibc.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-01 11:18:18 +01:00
Chris Wilson 8174c56c3a sna/glyphs: Allow glyphs-to-dst to discard CA masks for a8 glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-01 11:18:18 +01:00
Damien Lespiau c5e3b66c27 uxa/display: Keep the EDID blob around for the lifetime of an output
xf86InterpretEDID() doesn't copy the EDID raw data in xf86MonPtr but
just stores the given pointer. The DDX driver needs to make sure that
data stays valid.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-31 18:57:28 +01:00
Chris Wilson 278ee155d5 sna: Relax readback constraint for CPU mappings of scanouts
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-31 17:45:16 +01:00
Chris Wilson bfe25b8110 sna: Fix interaction between WT mapping of scanouts and allocating from stolen
If we allocate the scanout from stolen, we cannot then access it via the
CPU - so prevent the mapping in those cases.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-31 11:01:37 +01:00
Chris Wilson 493763301e sna: Allow CPU access to scanouts if WT cached
On Iris, we may store the framebuffer in the eLLC/LLC and mark it as
being Write-Through cached. This means that we can treat it as being
cached for read accesses (either by the GPU or CPU), but must be careful
to still not write directly to the scanout with the CPU (only the GPU
writes are cached and coherent with the display).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-30 23:02:50 +01:00
Chris Wilson cdbc097796 sna/gen7: Set appropriate constants for Haswell GT3
GT3 has twice the number of cores and URB as GT2, and so we can use
more threads and URB entries.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-30 16:44:31 +01:00
Chris Wilson 9a390c77dc sna/gen4: Hide an unused function
Whilst we are force flushing vertexes we are not using the threaded
emitter, so simply hide it from the compiler to prevent it warning about
the unused function.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-30 14:07:45 +01:00
Chris Wilson 208282d316 Suppress a bunch of compiler warnings for using constant strings
We want these allocated in ro memory even if the antique API complains.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-30 13:26:14 +01:00
Chris Wilson 7e3445a330 sna/dri: Tidy up applying damage to the Pixmap when copying regions
Now that we are doing a true move-to-gpu first, we can drop the hacks
from damage().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-30 12:46:18 +01:00
Chris Wilson c507f621c9 sna: Suppress a few harmless warnings
Mostly of the only used in debugging path variety.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-29 23:54:31 +01:00
Chris Wilson cf7d36455f intel: Suppress some extremely noisy warnings
Warning about redundant declarations within the xorg headers hides
genuine warnings in our own code - disable them until the headers are
cleaned up.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-29 23:49:08 +01:00
Chris Wilson d7465ece29 sna: Cleanup along all error paths in sna_pre_init()
Only one out of a dozen error paths actually freed the locally allocated
memory, oops.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-29 21:55:29 +01:00
Chris Wilson 5751b9f1f5 sna/dri: Prevent stale DRI buffers from a NULL dereference
If the DRI buffer is stale, the drawable may have been recreated and no
longer be associated with DRI. In this case, the pixmap may not be on
the GPU, so just subsitute the client's old bo and hope the it catches
up and does a GetBuffers in the near future.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-29 15:21:19 +01:00