Admittedly ScrnInfoPtr->pScreen has nearly always existed, but for
completeness wrap it up in a compat macro.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we are a PRIME slave, we never need to allocate any memory for the
frontbuffer, so skip the forced allocation during modesets.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When applying both a slave offset and an output rotation, order is
important. To get the order right, we need to combine the two into a
single transformation.
Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As the damage is entirely empty due to the screen clipping, we can save
a few electrons by not recording it. Ordinarily, we will then get the
damage event later when the screen is resized.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Fixes regression in
commit 836f9e11d6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Jan 9 19:55:41 2015 +0000
sna: Disable detiling for gen2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
gen2 use a different tile layout to all the other generations, and are
not supported by the existing routines. Disable for now.
References: https://bugs.freedesktop.org/show_bug.cgi?id=88112
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
A glitch from the last patch forgot to set the priv->mapped flag
correctly after setting up a mmap(wc).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Accessing a mmap'ed pointer (especially our shmemfs backed bo) can throw
SIGBUS when out of memory, for which we use sigtrap for graceful
failure.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The status of sna_pixmap->mapped was changed with the introduction of
mmap(wc), but the code was still asserting that the mmap could only be
cached.
References: https://bugs.freedesktop.org/show_bug.cgi?id=88112#c20
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Since gen2 cannot rendering into a snooped bo, we have to be careful
before trusting the CPU bo as a GPU target.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
It looks out of place starting with a lower case letter when the
surrounding messages are sentence captilized.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
xf86DisableUnusedFunctions() uses crtc->dpms(off) to disable unused
pipes. In this case, we do want to explicitly disable the CRTC to
release any shared state (e.g. PLLs and encoders). However, the user can
also request for the DPMS to be disabled, either via the DPMS extension
or the ScreenSaver. Here, we don't want to full disable the pipe as that
incurs extra latency (and risk of failure) when switching the display
back on. In order to distinguish the two cases, we can hook into the
user paths and skip disabling the CRTCs.
Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Fixes regression from a missed replacement in:
commit 191c6b6ca7 [2.99.917]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sun Oct 5 09:05:20 2014 +0100
sna/trapezoids: Improve sample locations for imprecise rasterisation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the GPU is wedged, we cannot use the blitter for filling the
colorkey, so provide an interface to write the value using the GTT
instead.
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The value is typically used only for human readable output, though some
kernel modules do use it for preferred mode matching (notably not
i915.ko today). Let us not second guess the desired vrefresh if it is
known.
Suggested-by: "Jasper St. Pierre" <jstpierre@mecheye.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We only want to prefer shadow access to ordinary pixmaps (to avoid
reading back via the GTT). However, since we must use the GTT for
scanouts, we may as well take advantage of direct writes even if the GPU
is wedged.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the user sets the CRTC position before resizing the framebuffer, we
end up with an out-of-bounds CRTC and install a shadow (as the current
framebuffer does not cover the CRTC). In this case, we copy the visible
region before displaying on the CRTC. However, this needs to be clipped
for self-consistency.
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we don't have a GPU available, we can not do the colour space
conversion and compositing with the GPU, so bail early.
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Now included in upstream kernels as of
commit 1816f92363036600f2387bb8273b1e5e1f5b304e
Author: Akash Goel <akash.goel@intel.com>
Date: Fri Jan 2 16:29:30 2015 +0530
drm/i915: Support creation of unbound wc user mappings for objects
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When we read vblank events back from the fd, we have to be wary in case
they are older than the most recent vblank query. If they are stale, we
do not want to record them as being the last-known vblank event.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
For whatever reason, it seems that for HSW GT1 we cannot specify the
maximum value of the field and leave it to the hardware to clamp the
value to the maximum supported. The impact should be zero other than the
possibilty it workarounds an issue if the hardware doesn't apply the
limit.
References: https://bugs.freedesktop.org/show_bug.cgi?id=87564
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
After showing the new front buffer, we have to avoid writing to the back
buffer whilst the flip is still pending (as it may still be being shown
by the display). To do this we check if there are any outstanding flips,
and reallocate if so. However, with a CRTC override, we may just be
flipping that one CRTC and not the current TearFree back buffer and in
that case we can avoid the reallocation.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In the Composite setup, if we are doing a DRI2 copy onto the front
buffer, we are fully cognizant that the copy will not go onto the
unredirected Windows of another Client. So we can preserve the shadow
CRTC mapping for those Clients, and prevent ping-ponging between CRTC
modes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As we have relaxed the pitch restriction between front/back buffers when
swapping, we need to make sure that any change is also reported back
along with the change in front/back names.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In case we receive quick successive calls to DRI2GetBuffers on the same
Window, we need to check that the private exists before dereferencing
it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the Pixmap for a Window is changed (i.e. Composite
redirection/unredirection), we also need to decouple any associated DRI2
front buffer for the Pixmap (e.g. used for single CRTC flipping).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The crtc flip (for when the kernel can't do a pageflip) made the mistake
of setting the shadow buffer to the scanout - nullifying the effect of
the TearFree.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When we AddTraps to a low resolution bitmap, we need to fallback as we
don't wrap it with a GPU pixmap.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If Xinerama is enabled, than RandR12 will be silently disabled. Be
careful not to dereference the rrScrPiv when it doesn't exist.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87207
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Fixes regression from
commit 0aa2edbd29
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Nov 5 11:56:20 2014 +0000
Remove defunct glamor support
where the wrong branch of pixmap exchange upon SwapBuffers was kept when
removing the glamor paths.
Reported-by: Rui Matos
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>