If we fail to allocate the next bo to use for the next_request, we can
just fallback to the delayed allocation used by !llc.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Whilst we currently do not try and submit a failed batch buffer
allocation, we still treat it as a valid request. This explodes much
later when we inspect the NULL rq->bo.
References: https://bugs.freedesktop.org/show_bug.cgi?id=91577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the pageflip following the CRTC fixup fails, we can be left with the
flip-to bo being left as the CRTC scanout. If that is so, reset the
desired mode (and original scanout bo).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Different OS name the i915 KMS module differently, so make it convenient
for us to be able to feed in the right name, or even just try them all
and pick the first one that exists!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Broadwell expanded all the relocations and we needed to adjust our
command construction to match. I missed offsetting the XY_SRC_COPY_IMM
used for XCopyPlane resulting in garbage for small copies on Broadwell.
Reported-by: Omar Sandoval
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91499
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Read all available HOTPLUG uevents and batch them into a single topology
probe. Like waiting for a bus, when one hotplug uevent arrives expect a
few more.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
check_pixmap() can be called very early in the Window setup proceeding,
before a pixmap is even assigned to a Window. There we expect the Window
to be NULL, so be more careful in our check_pixmap.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91467#c16
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When juggling Present and TearFree, we have to hide the extra flips from
Present as it cannot account for them. Preferrably we want to schedule
the Present flip following completion of the TearFree flip, but for the
moment simply block and wait until TearFree completes before starting
Present.
Reported-by: Andreas Reis <andreas.reis@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91467
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Still need to improve the handling of set_gpu_tiling() to mark up the
unfenceable buffers better, but we can't more the asserts here as we
don't have the kgem struct available.
Fixes 2f1623daed94b98d3bae3c9ee8346e8de9afc33d with asserts enabled
Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Since the kernel now differentiates whether the buffer is busy for
read/write, we can use that knowledge to better set our own
bo->needs_flush flag only when there are outstanding writes to the
buffer.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We use the fence as a backchannel to commuicated the tiling mode to the
DRI2 client, so in such cases we cannot tolerate a failure to set the
tiling mode.
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c114
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
I chopped off one too many characters when creating the path in the
presence of a colon-delimited list.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we are doing synchronous but immediate swaps, we may notice that we
have a vblank placeholder from the last swap. If so, we can replace it
with the swap we need to perform on the next vblank.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As a slightly more convenient approach than loading the EDID on the
kernel command line, allow the user to specify the EDID path in the
Device section of xorg.conf, e.g.
Section "Device"
Identifier "igfx"
Option "CustomEDID" "DP1:/path/to/dp1.edid,DP2:/path/to/dp2.edid"
EndSection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89945
Modesetting can be slow, and we certainly don't want to have to keep
restarting it due to an interrupt from an invisible cursor.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we fail to CPU mmap an object, mark it as inaccessible and never try
again. The likely scenario is that is it a PRIME object not backed by
our shmemfs storage and so unmappable.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Suppose that the kernel reported a truncated EDID, we will eventually
crash by trying to access invalid memory. Prevent the crash by fixing up
the EDID header to fit the size read from the kernel (though we don't
fixup the checksum, so strict conformance tests will still complain, but
we won't crash.)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
After the Window resizes, we should never hand back a buffer of the old
size or else we end up rendering garbage - with the possibilty of GPU
hangs or memory corruption.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91036
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
It's possible if the Window is redirected whilst the client render for
its backbuffer to no longer overlap with the visible Window. In this
case, we attempt to copy an empty region, but it debugging is enabled
this throws an assert.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91120
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
sna_dri2_xchg() is also called on the flip path to do an immediate swap
of a hidden buffer, in which case can_xchg() returns false as it
believes that the swap requires a flip.
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c109
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When we record the next scanout for display after the following vblank,
note the size of the allocation as well as its name and bo et al.
References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c105
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Apply s/cacheing/caching/ because I am alone in my belief of how to
spell cacheing correctly :)
Suggested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we need to handle a FillRectangles request that is larger than the 3D
pipeline can handle, we need to split that operation up into smaller
chunks. This is achieved by redirecting the rendering through a view of
the surface (offset so that coordinates are within range), or else we
have to fallback to creating temporary surfaces.
If we fail to do so, we should hit an assertion that the render target
fits within the 3D pipeline inside gen4_emit_drawing_rectangle()
Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Looks like amalgamating the per-CRTC xchg with the blit caused a few
regressions with TearFree single monitor flipping.
References: https://bugs.freedesktop.org/show_bug.cgi?id=91066
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
One assert(active_scanout) was firing when feed in an old flip bo, which
in hindsight was quite expected.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we cannot cache the current backbuffer, due to either it not fitting
or because a reference to it still exists, delete the cache entry we
were holding for it - or else we slowly leak the cache list and
gradually get slower and slower walking along the growing chain.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We can fail to submit the batch if the GPU is wedged (or the driver
upset), in which case the bo will be NULL and we should not blindly
dereference it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Since the /sys/device/backlight never turned up we face an issue with
disambiguating the backlight on multi-GPU devices. Both intel_backlight
and nv_backlight are presented are raw interfaces, and on modern systems
the ACPI interface is defunct, so we need a way to distinguish them. So,
we fallback to our priority table of known interfaces and rank them
accordingly, first by class (platform, native, raw) and then by priority.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Since there were two paths performing similar tasks for swapping a
windowed buffer, they would get easily confused and queue themselves in
conflict with each other as they behaved slightly differently wrt to rapid
swaps. Almagamate the two paths such that the behaviour is the same -
with the complication being in tracking the spare active buffer.
Fixes (some at least!) flickering from
commit 72d208a7f2
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Mar 5 12:26:15 2015 +0000
sna/dri2: Perform swap elision on windows for swap-interval==0
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we fail to turn off an output via DPMS, disable the entire CRTC in
order to blank the output and save the screeen/power.
Reported-by: Lukas Hejtmanek <xhejtman@fi.muni.cz>
References: https://bugs.freedesktop.org/show_bug.cgi?id=90179
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Fixes copy'n'paste error in
commit d46c793663
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Jun 12 13:50:35 2015 +0100
sna/dri2: Remove the active_scanout flag when deleting the event
Reported-by: Andreas Reis <andreas.reis@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90968#c8
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If there is already a pending operation on the drawable, the swap is
queued. It is queued with SWAP_THROTTLE which classes with the
vblank_mode=0 chaining, so the choice is to either review all other uses
of SWAP_THROTTLE and duplicate the chain swap handling, or to choose when
use to the alternate copy or back buffer. This patch opts for the
latter.
Fixes regression from
commit dcb4d323ca
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Jun 11 13:54:49 2015 +0100
sna/dri2: Mark the pending backbuffer copy as active
Reported-by: Christoph Haag <haagch@frickel.club>
Reported-by: Andreas Reis <andreas.reis@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90968
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>