Age | Commit message (Collapse) | Author |
|
Whilst hosted, which is very similar to being headless, we do not even
have the kmode pointer and so checking kmode->count_crtcs is fatal.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The fallback xf86InitialConfiguration() is another function that may
explode if called without any CRTCs attached.
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>
|
|
Our fallback path for finding the backlight interface uses a hardcoded
table of known backlight controllers in proirity order. Rather than
maintain this table twice in the midst of the KMS logic, push it to the
new set of common backlight routines.
This incorporates bugfixes from SNA to handle unknown backlights, but
usable, gracefully.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Once the xserver stops running as root on kms capabable systems, we will need
some other way to access the backlight.
The approach taken in this patch moves most of the heavy lifting to a
helper that runs with root privileges and pipes our requested brightness
into the sysfs backlight interface. Where required, we use pkexec to
launch the helper with the elevated privilege.
v2: Amalgamate much more of the duplicate code.
Keep the daemon and pipe alive for the lifetime of the backlight interface.
Provide an alternative for systems without PolicyKit.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> [v1]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
It is not just the BSDs that lack these ioctls in their userspace
headers, but everything older than about a year...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
These are not currently exported on OpenBSD and cause the build to fail.
Hide their use behind an ifdef guard for the time being.
"I noticed the following when trying to compile xf86-video-intel git on OpenBSD:
/usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: 'DRM_MODE_OBJECT_CRTC' undeclared (first use in this function)
/usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: (Each undeclared identifier is reported only once
/usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: for each function it appears in.)
/usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2107: error: 'DRM_MODE_OBJECT_PLANE' undeclared (first use in this function)"
Reported-by: Jonathan Gray
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Before we write values into the file, we want to be sure that it is our
sysfs backlight interface, and not some ordinary file we are about to
destroy.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Attempting to create a 0x0 frontbuffer results in erroneous pixmap
generation, and is liable to explode at a random point in future, so
just reject it outright.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Before attaching properties to any connector, check that we can indeed
control the backlight through the sysfs interface by doing an access
check. If the xserver is started without root privileges, we cannot
write through /sys/class/backlight and so should take care not to
advertise that we can.
Reported-by: Hans de Geode <hdegeode@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Assume the worst and force us to reset the property when we restore
control.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The sprite plane can be independently rotated to the CRTC primary plane.
To rotate the sprite plane, we just set a property on the plane similar
to how we rotate the CRTC, so we can refactor them together to use the
same routines.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Otherwise X tells Clients that the cursor is still in the unrotated
location when it appears rotated on the display.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
In some cases, such as querying the mode from the CRTC, we may not have
a name associated with the mode. However, RandR always expects a valid
name. To satisfy this requirement, always generate the canonical mode
name if no other is specified.
References: https://bugs.freedesktop.org/show_bug.cgi?id=70132
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Use the display hardware for simple rotations, when exported through the
rotation property on the CRTC.
As the kernel support is not yet merged upstream, the feature is hidden
behind --enable-rotation.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This reverts commit 2a5ad9c015bbb41550536dd3cf4ad18b7f21fd80.
Oops, pushed from the wrong machine and merged in a incomplete bugfix
branch.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
sna_display.c: In function 'preferred_mode':
sna_display.c:3393:7: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
mode = xf86GetOptValString(output->options, OPTION_PREFERRED_MODE);
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We allocated and own the string, so we can free it!
sna_display.c: In function 'sna_output_get_modes':
sna_display.c:2314:4: warning: passing argument 1 of 'free' discards 'const' qualifier from pointer target type [enabled by default]
free(current->name);
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The backlight_iface is a freeable string, in places we were assigning a
constant string and later freeing it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we have not had cause to flush the wait_for_shadow buffer during the
course of the rendering, then we never wrote to the backbuffer and its
contents are still identical to the current frontbuffer. So if the
wait_for_shadow is still flagged as required on the scanout, we know we
can safely discard the redisplay request.
References: https://bugs.freedesktop.org/show_bug.cgi?id=70905
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If the kernel reports an error from setting the DPMS property, we need
to undo the local changes and propagate back the error to the caller.
Although the latter is prevented by the RandR API, we can at least
restore the backlight.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Reported-by: Nick Bowler <nbowler@draconx.ca>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73981
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Composite operations were presumed to cover their entire width x height
area. However, a few paths submit boxes that do not cover the clip
region and so the optimisation made during prepare to discard completely
overwritten data is incorrect (and leads to corruption - stale data is
seen which the client expected to have been overdrawn). So along these
more unusual paths, we must add a flag to prevent the overzealous
discard. Notably, xfce4 triggers this as it uses a lot of unantialiased
trapezoids in its theme drawing.
References: https://bugs.freedesktop.org/show_bug.cgi?id=69528
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Otherwise we may end up in a sitation where we show stale contents for a
(sometimes signification) fraction of a second before it is refreshed
with the correct contents.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73842
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Rather than just assert that we have used the pending update in
wait_for_shadow, discard it first.
Reported-by: Joe Peterson <joe@wildlava.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=70905
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
As an extra complication for handling TearFree is that if we attempt to
requeue a swap whilst the pipe is off, that fails. As we have recursed
from the pixmap migration path, we have to abort the blit but still send
the event back to the client so that they unblock.
Reported-by: Harald Judt <h.judt@gmx.at>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73469
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
As we assume that Suspend, Standby alias to Off and disable the crtc
when switching to any mode other than On, we need to also perform the
backlight updates for Suspend,Standby prior to passing the DPMS value
onto the kernel.
Suggested-by: Alexander Monakov <amonakov@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Now that we do not remove the move-to-gpu for a plain read from the
TearFree buffer, it is viable to use that buffer as source for cloning.
So we need to kill the stale assertion.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
sna_display.c: In function 'sna_crtc_redisplay__fallback':
sna_display.c:4104:19: warning: unused variable 'sna_crtc' [-Wunused-variable]
struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Broadwell uses the same mechanism as Haswell for vsync.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Older version of glibc and valgrind require a slight massage.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
My current best guess at the glaring hole in the spec that is
synchronisation to vertical refresh.
Note that this leaves VSync disabled for BYT for now as it is
ineffective - but at least it now doesn't hang!
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69869
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Add in a couple of newcomers to the connector type and make it easier to
track updates in future.
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>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Since commit 8ff8eb2b38dc705f5c86f524c1cd74a811a7b04c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Sep 9 16:23:04 2013 +0100
sna/hsw: Scanline waits require both DERRMR and forcewake
we have been emitting LRI to enable vsync on the render ring. This
requires a privileged batch buffer, and whilst we were checking for
kernel support, we forgot to actually tell the kernel to submit the
batch with the right privileges.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71328
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The BYT vsync is closer to the IVB vsync, and using gen6 is just
erroneous. Apparently. At least that is what is in bspec today.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we get a pageflip fail when trying to do a TearFree update, just
fallback to a copy (before turning off the display for complete
failure). The rare tearing copy should mar the user experience far less.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Whoops. Only the kernel sprintf() accepts NULL as a valid target string,
not libc's.
Reported-by: Jay Little <jaylittle@jaylittle.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70835
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|