Age | Commit message (Collapse) | Author |
|
During incremental clipping of the trapezoids, we can assign the end
BoxPtr to begin, and so we should be careful not to dereference that
pointer (as it points passed the end of the clip boxes).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The end BoxPtr actually points to one past the end of the clip boxes, so
in order to inspect whether the line is after the clip region, we want
to look at the last box, i.e. the box before. We also only want to
ignore the clip if we do not intersect at all, otherwise we need to find
the start of the clip row.
Reported-by: Matti Hämäläinen <ccr@tnsp.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
In order to handle PRIME offscreen Windows nicely, tie their
presentation into the Primary CRTC (if available).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Within a span, we have the advantage of knowing that we only need to
intersect one box with the clip region, and that box has monotonically
increasing y. This avoid having to compute RegionIntersect for every
span element which was very slow (e.g. libreoffice).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Rather than synchronously wait in the unflip for the pageflips to complete
by forcing the modeset, try to queue the unflip to happen after the pending
flip completes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When disabling outputs with DPMS, make sure we update front_active for
consistency.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we have a linear buffer, we can request the kernel mmap it directly
with write-combining without having to pin it into the GTT. This allows
us to efficiently upload very large buffers, and can avoid the dreaded
aperture thrashing.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Beware the barbarians at the gate, who invade and steal your ScrnInfoPtr
and its Entity from underneath you. In some configurations, we lose
access to the struct intel_device stored on the Entity after
initialisation, causing havoc. Workaround this by storing the
intel_device that we open in our driverPrivate.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When using ZaphodHeads, we share the /dev/dri/card0 fd between both
screens. So when we read an event back from the fd, it could be for
either head and we cannot assume that our private pointer is valid for
the data passed along with the event. Instead, we need to retreive that
pointer from the event.
Fixes regression from
commit 8369166349c92a20d9a2e7d0256e63f66fe2682b [2.99.912]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Jun 4 08:29:51 2014 +0100
sna/dri2: Enable immediate buffer exchanges
although the design bug is actually older.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84744#c15
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If the ddx is configured without udev support, we do not receive
notifications when the MST topology is changed. This leads us to query
the kernel for bad connectors, and so we end up reporting an unknown
connection status for them, which the user and client often find
confusing. However, we can not simply act upon the detection failure as
we are too deep inside the callback chain and cannot change the arrays of
known connectors whilst iterating over them. A neat compromise is to
hook into the rrGetInfo call chain and poll for MST changes before we
report back the current configuration.
References: https://bugs.freedesktop.org/show_bug.cgi?id=84718
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we attempt to share an unused Pixmap, we first create an ordinary GPU
bo when migrating onto the GPU. Add a flag here to cause the migration
to create a Pixmap suitable for PRIME instead.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we have unfortunate fragmentation, e.g. a cursor is pinned in the
middle of an aperture, we can struggle to fit large objects, especially
fenced objects on gen2/gen3. We do have one last trick up our sleeves
that we can try: disable all of the outputs and cursors and try
submitting the batch in as pristine an aperture as we can arrange. We
can only hope that the subsequent restoration of the outputs is more
conducive to future batches (and so not lead us into continual flicker).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The intention is to be able to capture the assertion in the Xorg.0.log
(journald equivalent). At the moment, it is emitted to stderr which is
difficult to capture and defeats the goal of only asking the reporter to
upload one log file.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Add the Pixmap id to various DBG messages to make it easier to track
rendering.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If the user specifies the Option "Primary" for a monitor, we need to set
it as the RandR primary output.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82193
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
As root, X gets away with many things, including submitting commands to
the DRM device whilst it is no longer authorised (i.e. when it has
relinquished master to another client across a VT switch). In the
non-root future, if we attempt to use the device whilst unauthorized the
rendering will be lost and we will mark the device as unusable. So flush
our render queue to the device around a VT switch.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When we are constructed as a slaved device, we need to disable all
outputs or else they are not correctly hooked into the master device
upon startup.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
uClibc is one such library that doesn't implement getline()
Reported-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When we tile, we do so in order to fit an operation involving two
objects larger than the aperture. If we then choose an intermediate
tiling object that is larger than either of those two, the error will
persist and we will be forced to recuse.
In the worst case, this will provide an upper bound to the recursion.
Reported-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This option should only be used for compatibility. Previously this was
done at a high level, this changes it to enforce the tiling as we apply
the CRTC.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
As the Window may exist for multiple Clients, we cannot rely on the
destruction of the Window decoupling all outstanding events and
preventing chasing a stale Client pointer.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80157
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Instead track what we explicitly want to discard for the next operation,
so that we don't have to copy back the whole buffer if we have to
replace the shadow and intend to overwrite it all.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Unlike GLXWindows, GLXPixmaps are rendered directly into, without a
staging copy. Therefore we must treat those carefully when exported and
clear our hints everytime control passes back to the Client.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79999
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Panel Self-Refresh requires us to avoid frontbuffer rendering in order
to be power efficient. This is a job for TearFree!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Tricksy asserts making sure that the correct arguments are passed
around!
Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
As the kernel does not send out an explicit DISCOVER event, we have to
reinspect every connector after every hotplug event to detect topology
changes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Baby step. We first take advantage of TearFree to allow us to redirect a
single CRTC to the DRI2 frontbuffer and so allow a fullscreen game
covering a single monitor to avoid expensive blits when running in a
multi-monitor setup.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The tearfree code forgot to update the shadow bo, so after the first
flip it would be rendering to the scanout anyway and flip to itself
periodically.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Changes to the backlights are notified through uevents. Hooking up a
udev monitor to listen out for external changes to the backlight (e.g.
through ACPI function keys, or by the user writing to
/sys/class/backlight directly) is easier than enabling polling on the
backlight sysfs file using X's select() mechanism.
Since we listen to backlight changes, we have to be careful not to
confuse the side-effects of disabling connectors (which may cause either
ourselves or the kernel to turn off the backlight) with the user value.
Many thanks to Alexander Mezin for the suggestion to use udev for
tracking the notifications for external changes to the backlight.
Reported-by: Alexander Mezin <mezin.alexander@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79699
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The primary benefit of this is avoid the extra blit when using a
compositor and instead propagate the compositor flip on the frontbuffer
to the scanout, or equivalently allows a fullscreen game to flip onto
the scanout without intervention by TearFree.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If a flip fails, attempt to restore the previous working configuration
(using a modeset) then disable further flipping.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The scanout is a global property, track it as so. The primary benefit to
this is it strengthens our assertions that we never hand out an active
scanout for use as a back buffer.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Replace the fixed size MAX_PIPES array by moving the vblank handling to
per-crtc.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we have a queue of events, we may set the msc from a recent vblank
query only to then process an older vblank event and declare the counter
wrapped.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|