Commit Graph

7065 Commits

Author SHA1 Message Date
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
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
Dave Airlie 6004870d53 configure.ac: fix dri enabled with kms only picked
Otherwise we'd fail saying DRI1 wasn't possible, when that
is exactly what we asked for.

[ickle: The breakage was introduced with

commit bd6ffd1ad2 [2.21.14]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Jul 27 15:33:19 2013 +0100

    configure: Print a summary of compilation options

which modified the search to only take place if UMS was enabled, but
missed mollifying the resulting error.]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-08-06 09:31:21 +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 0cd154039a 2.21.14 release 2013-08-04 10:30:14 +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 a3eea6e61e Suppress misleading warnings for -Wmaybe-uninitialized
All the curent reports by gcc are false positives. Instead we have better
static analysis tools at our disposal and valgrind.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-30 13:26:14 +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
Egbert Eich 8619db7224 Add support for the dell backlight interface
Signed-off-by: Egbert Eich <eich@freedesktop.org>
[ickle: Add the failsafe to sna as well.]
2013-07-29 13:05:03 +01:00
Chris Wilson c9d8949980 sna: Composite region is already in dst drawable space
So do not offset it again when processing the fallback composite
operation.

Regression from commit 6921abd810
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jul 18 16:21:27 2013 +0100

    sna: Add a fast path for the most common fallback for CPU-CPU blits

References: https://bugs.freedesktop.org/show_bug.cgi?id=66990
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-29 12:16:21 +01:00
Chris Wilson 3cb75950a9 uxa: Fix incorrect include path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-29 11:05:28 +01:00
Chris Wilson 1dd79c225c sna: Restore driver info upon FreeScreen
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-29 11:05:23 +01:00
Chris Wilson b0826907dd sna: Fix limit on stipples to only use immediate operands for <= 32 dwords
The check was still based on bytes after the len had been converted to
dwords.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-28 19:23:40 +01:00
Chris Wilson 5e9decc963 uxa: Add the missing include to silence the compiler warning
Silence compiler warning for no prior declaration of intel_init_scrn().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-28 16:51:32 +01:00
Chris Wilson f97b55d283 intel: Remove the unused SDV PCI IDs
As a first step towards working out what to do with the remaining
used-once PCI IDs, delete the used-never ones.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-28 16:51:32 +01:00
Chris Wilson 679416f9a5 sna: Allow PutImage to utilise userptr for busy targets
Typically, PutImage is not a performance critical path since ShmPutImage
uses CopyArea and so PutImage is relegated to small one off transfers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-28 16:51:32 +01:00
Chris Wilson bd6ffd1ad2 configure: Print a summary of compilation options
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-28 14:51:56 +01:00