Atter a modeset or KMS takeover, we do a quick readback of the kernel
state in order to verify that it matches our expectations. If we find
that a foreign framebuffer is attached, or no mode if set on the output,
we then turn off that connection and release any resources associated
with that pipe. This patch tries to reduce the number of superfluous
requests to turn off a connection.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
ModeSet is called after updating each CRTC, unlike crtc_notify which is
called after applying all changes. The last is what we need as if we are
called too early we detect that the next CRTC doesn't match our
expectations and so we disable it, right before applying the desired
mode.
References: https://bugs.freedesktop.org/show_bug.cgi?id=66494
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We cannot simply rely on connector->encoder->crtc status as with the
introduction of Haswell or SDVO we may have multiple connectors using the
same encoder. So we need to explictly check the connector status first,
before determining if the output is connected to an active encoder and
CRTC.
References: https://bugs.freedesktop.org/show_bug.cgi?id=66488
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Currently we leak the fd should we open the device node and decide that
is not a GEM/KMS kernel driver. The simplest way to perform the cleanup
upon failure is to move the checking for GEM/KMS into the device open
routine.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
I forgot how insane the data structure for the list of dirty boxes
attached to the damage is. It is neither a simple list, nor does not store
the count of boxes within each chunk.
Fixes regression from
commit 9026bb9546 [2.21.11]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Jun 28 15:59:17 2013 +0100
sna: Inspect the dirty boxes when querying whether damage contains a rectangle
A side effect is that we now make sure that there is an upper bound to
the amount of searching we do for the no-reduce fast path.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66430
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Fixes regression from
commit 77fa8ab08b [2.21.11]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Jun 25 22:25:25 2013 +0100
sna: Free just-allocated bo if we fail to set-tiling on CREATE_EXACT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As we unconditionally use it irrespective of whether we then call
accelerated code paths or not.
Fixes regression from
commit dc18eaa585 [2.20.10]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sun Aug 12 10:34:10 2012 +0100
sna: Make the failure to create render caches non-fatal
in the event we need to start with a hung GPU.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
A few new paths were missing the debug check, and clarify a few indirect
uses by performing the explicit check.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Search the few canonical locations for our hang state so that we can be
more explicit to the user about what to include.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We can improve our query for whether the rectangle of interest is within
the damage by checking whether the damage extents contains the entire
box rather than just checking for an overlap.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Use drmSetMaster/drmDropMaster instead of calling the ioctls
directly. Fixes compilation on OpenBSD where these ioctls
aren't defined.
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Avoid having to search the device tree once again in order to simply
recover the path we used to open the device.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
With the split into per-swizzle functions, and with the forced
optimisation levels, it appears that i386 doesn't suffer so badly and
the tiled memcpy are a viable method.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Always enable gcc to fully optimize the core memcpy routines (provided
that optimisations are not entirely disabled, for instance for
debugging).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The inplace routine assumed that the region to be read was already in
pixmap coordinates. Making it so makes the code easier, so do it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Rather than peppering the discard manually before the call to free the
GPU bo, always discard the COW when we actually free the GPU bo.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Refactor the CPU mapping tests to a single function, and remember to
test for a pending GPU write (i.e. bo->exec).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This helps in the cases where we have subtracted a small number of
rectangles from an all-damage pixmap (such as a number of successive
GetImage, PutImage operations). The danger is that we end up searching a
long list of dirty boxes - maybe just search the first chunk if that
becomes noticeable?
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
With the advent of the more permissive mapping schemes and finer damage
tracking, we are more liable to have pixmaps mapped and so can reach the
upload path with the pixmap still mapped.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Should you ever need to read back from a tiled surface and for whatever
reason do not have a CPU bo to accelerate the operation, maybe we could
use the manual tiling instead (as it is useful elsewhere).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Be kinder to smaller machines by lowering the threshold at which treat
an object as huge and worthy of avoiding duplication.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As we strive to only keep one copy when working with very large objects,
so try operating inplace on a mapping for CPU operations with a large
GPU bo.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This is lower latency than the double copy incurred for first moving the
bo to the CPU and then copying it back - but due to the less efficient
tiled memcpy, it has lower throughput. So x11perf -shmget500 suffers
(by about 30%) but real world applications improve by about 2x.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
To provide symmetry with the ability to write into an X-tiled mapping of
a bo, we add the memcpy_from_tiled to be able to read back from the same
bo.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>