If we have no pinned batches available, use the kernel w/a if available
rather than stall waiting for an active batch.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Currently we turn off the CRTCs when switching away from X in order to
not leak our framebuffer. With the new drm_plane support, we can simply
unset the framebuffer, which should be a lighterweight operation than
disabling the CRTC.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The clones are indices into the output arrays, so recompute the clones
if we reorder the outputs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
IGNORE_DAMAGE is used by sna_drawable_use_bo to ignore both CPU/GPU
damage. It used to only ignore CPU damage, but now is a more general
hint. However, here we were intending to only say ignore the cpu damage
that we explicitly discarded anyway.
References: https://bugs.freedesktop.org/show_bug.cgi?id=81973
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
These outputs are already marked as disconnected and so should be
excluded from the CRTC set, but to be safe skip over them.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The rule for the origin of the CompositeTrapezoids routine is the
upper-left corner of the first trapezoid. Care must be taken in case the
trapezoid edge is upside down to consider the upper vertex.
Reported-by: "Jasper St. Pierre" <jstpierre@mecheye.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Given a ridiculous CopyArea, say copying from (-32000,-32000), the
region extents will wrap around when translated before the final clip
and reject test. To overcome this, do source based rejection earlier
before the potential underflow.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the client and drawable destroys are racing, we may trigger the event
removal twice.
References: https://bugs.freedesktop.org/show_bug.cgi?id=83183
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Instead of checking for a particular version of GCC check for
a cpuid.h with __cpuid_count. This allows cpuid.h to be
provided for older/different compilers.
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
[ickle: Delete the bare and redundant config.h]
We only automount debugfs for Linux, but sys/mount.h on BSD has unmet
dependencies breaking the build.
Reported-by: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Future commit "pixmap: fix reverse optimus support with multiple heads"
will allow for tracking within pixmaps (i.e. break the presumption that
everything starts at offset 0,0 in the target pixmap).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Third one-line patch to fix copying from the tainted user argument into
the socket's path buffer. This time, give in and just use snprintf() as
it guarrantees that it will not write more than 'n' characters and that
the last is a NUL byte.
Suggested-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Somebody (me) confused it with snprintf() and put the string length in
the wrong location. Also note that strncpy() does not NUL terminate long
strings.
Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
ADDFB fails with a headless config (as any fb size is invalid).
Fortunately, with headless we can use any depth we like.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
os.h redefines a few common libc functions, so check if the host
provides them first and inform os.h if that is the case.
Suggested-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When the client goes away, we need to free its events. However, we
have to defer the freeing of any pending event (ones currently routed
through the kernel) for those we need to remember to decouple the event
from the Drawable's list before they are freed.
Reported-by: John Lindgren <john.lindgren@aol.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82979
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Especially when we delete the output property halfway through and the
ChangeProperty routine then attempts to wire it back up...
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82833
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
A slightly more complex patch to disable the SHM based tests of
lowlevel-blt-bench when MIT-SHM support is not available at compile
time.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Since 37ac34c4e4, lowlevel-blt-bench
requires SHM support, so only compile it if we detect such during
configure.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Other platforms are not going to have the same debug infrastructure, nor
even the same mount(2).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Since this is an error path with a major user visible failure (the
modeset fails), make sure that we log the reason.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In Xorg-1.12.4 we have DRI2 version 6 (and so triple buffering support
by Xorg) but we don't yet have Prime. Remove the check for the Prime bug
in the Xserver for that case.
Reported-by: Axel Rohde
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Internally only use a square cursor, but 845g/865g actually supports
rectangular cursors (as they have a relaxed cursor height restriction).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Mostly paranoia, but we need to validate that the stored mode is valid
before applying the modeset.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We only want to log a mode change when it is initiated by the user. For
internal updates, such as changing the frame or restoring a mode from
DPMS, we want to silently apply the current mode.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Before we can query whether an option is set, we first need to generate
the options table. This is done through xf86OutputUseScreenMonitor() so
make sure it is called as early as possible in the proceedings.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>