Commit Graph

93 Commits

Author SHA1 Message Date
Chris Wilson ecc20fbcf8 intel-virtual-output: Discard unwanted events from the mouse recorder
X always sends MappingNotify events (there is no way for the client
to ignore them). In particular, MappingNotify would be sent after a VT
switch, and this would knock out our ability to track the cursor..

Reported-by: Raul Dias <raul@dias.com.br>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75115
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-18 07:56:07 +00:00
Hans de Goede e860b3eaed backlight-helper: Simplify reading the level from stdin
Since the helper is a standalone app, the usual xserver rules of not using
stdio because of signal handling don't apply.

And since the helper does run with elevated rights, it is important to keep
the code KISS so that it can be audited easily.

This commit replaces the hard to read "raw" read loop with a much simpler
loop using fgets, improving readability of the code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-02-17 18:38:54 +00:00
Jan Alexander Steffens (heftig) b71f3d8bd4 Backlight helper build fixes
Don't hardcode $(prefix)/libexec

Fix install hook when DESTDIR is set

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75028
2014-02-15 17:39:01 +00:00
Chris Wilson 3d629c91cf intel: Add a helper for setting backlight without root rights
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>
2014-02-15 15:33:47 +00:00
Chris Wilson 564a766a6b intel-virtual-output: Do not resize the screen whilst all outputs are off
If all the outputs are off, we try to resize the screen to 1x1, which is
typically illegal. So, just keep the existing screen and xfer buffer for
next time it is enabled.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12 16:21:30 +00:00
Chris Wilson 87b9d9f507 intel-virtual-output: Force an output probe on initial connection to remote display
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12 15:56:45 +00:00
Chris Wilson dda57f2e28 intel-virtual-output: Fix checking for no change in output modes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12 15:56:45 +00:00
Chris Wilson 94e5ca3d5a intel-virtual-output: Always requery modes after OutputNotify
References: https://bugs.freedesktop.org/show_bug.cgi?id=74800
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12 15:13:42 +00:00
Chris Wilson d84940cc9d intel-virtul-output: Double check timestamps
Compare both res->timestamp and res->configTimestamp for changes in
state.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12 14:48:24 +00:00
Chris Wilson 55a933aa29 intel-virtual-output: Tidy some DBG for copying new modes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-20 13:29:22 +00:00
Chris Wilson 637e7c2186 intel-virtual-output: Print error events for debugging
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-20 12:33:47 +00:00
Chris Wilson 92e9bf82b2 intel-virtual-output: Disable remote display if SetCrtcConfig fails
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-20 12:33:47 +00:00
Chris Wilson 3138d06893 intel-virtual-output: Clone modes onto remote display
If the user adds a mode to the VIRTUAL display and then attempts to use
it, add that mode to the remote display.

Reported-by: Christoph Bessei <admin@schwarzwald-falke.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73816
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-20 12:03:13 +00:00
Chris Wilson d65b57cd33 intel-virtual-output: Trim remote framebuffer to fit
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-27 12:59:25 +00:00
Chris Wilson dd7c556072 intel-virtual-output: Workaround mutter always using the same timestamp
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-27 12:57:09 +00:00
Kirill Müller 80d1dee70b intel-virtual-output: mute spurious warnings
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72027
2013-11-26 10:52:18 +00:00
Chris Wilson 36ac68bedd intel-virtual-output: Clone remote EDID for virtual outputs
References: https://bugs.freedesktop.org/show_bug.cgi?id=72020
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-26 09:41:42 +00:00
Chris Wilson 63a964d6d0 intel-virtual-output: Correct clip region of rotated outputs in source framebuffer
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71846
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-26 08:52:39 +00:00
Chris Wilson 5580df729f intel-virtual-output: Include transforms when computing required fb size
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71846
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-25 16:56:06 +00:00
Chris Wilson 5fa1b0a2c5 intel-virtual-output: Tweak DBG messages for copying rotation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-25 16:13:45 +00:00
Zdenek Kabelac d2df10e28f Remove uneeded headers
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
2013-11-25 10:04:47 +00:00
Zdenek Kabelac 2275ef581e Makefile convert @var@ to $(var)
Avoid using @var@ since this could not be easily overwritten through
'make var=xxx' option which is normally available.
For Makefile.am users should avoid using @var@.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
2013-11-25 09:25:56 +00:00
Chris Wilson 12e974c7bc Revert "intel-virtual-output: Only track the most recent visibility status of the cursor"
This reverts commit abf1a16914.

We need to track visibility over all clones on a display, not just the
last.

Regression from
commit abf1a16914 [2.99.906]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Nov 8 17:09:35 2013 +0000

    intel-virtual-output: Only track the most recent visibility status of the curso

Reported-by: Kirill Müller <mail@kirill-mueller.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71838
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-22 17:40:10 +00:00
Chris Wilson b14228fafb intel-virtual-output: Check for failure to create a clone
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-19 12:17:47 +00:00
Chris Wilson 9e6979b67a intel-virtual-output: Fix trivial and unlikely fd leak from bumblebee failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-19 12:13:26 +00:00
Chris Wilson 20e318c292 intel-virtual-output: Manually adjust screen size
When we modify the outputs and end up with a different screen size, we
need to actually tell the display to resize with an explicit
XRRSetScreenSize.

Reported-by: Jethro Beekman <freedesktop-bugs@jbeekman.nl>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71441
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-12 20:18:48 +00:00
Chris Wilson 3e93449b54 intel-virtual-output: Fix format specifiers for Visual DBG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-11 13:15:07 +00:00
Chris Wilson 31b5ff5889 intel-virtual-output: Fix cut'n'paste DBG error
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-11 12:56:48 +00:00
Chris Wilson 3e81a9cbd6 intel-virtual-output: Avoid the infinite loop around XPending
XPending() reports if there are any events pending and does not perform
any dequeuing itself - ergo for a remote display while (XPending()) ;
becomes an infinite loop should there be an event pending.

References: https://bugs.freedesktop.org/show_bug.cgi?id=71345
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-11 10:49:10 +00:00
Chris Wilson 7b0771180d intel-virtual-output: Do not hide the cursor on the local/source display
Whilst we want to take over and hide the cursor on the remote displays,
on the source we need to not interfere with the host.

Reported-by: Jethro Beekman <freedesktop-bugs@jbeekman.nl>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71439
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-10 10:35:27 +00:00
Chris Wilson abf1a16914 intel-virtual-output: Only track the most recent visibility status of the cursor
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-08 17:10:09 +00:00
Chris Wilson b46d0d3271 intel-virtual-output: Fix forced synchronisation of clones
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-08 14:04:32 +00:00
Chris Wilson fa40286e2f intel-virtual-output: Tighten bad_visual() checks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-08 13:53:48 +00:00
Chris Wilson 83c33a1f43 intel-virtual-output: Disable event tracking after a failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-08 13:00:11 +00:00
Chris Wilson 8b10c52804 intel-virtual-output: Add DBG for the latest XSync
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-08 12:58:06 +00:00
Chris Wilson 969b064f74 intel-virtual-output: Perform an explicit sync
If we fail to track rendering using ShmCompletionEvents and begin to
drop frames, insert an explicit XSync.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-08 12:56:06 +00:00
Chris Wilson e0075ccee2 intel-virtual-output: Check for pending events before skipping draw
Make sure we check if the destination display has caught up before
skipping a frame.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-08 12:46:58 +00:00
Chris Wilson ea4f99c333 intel-virtual-output: Add some DBG for bad_visual()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-08 12:30:21 +00:00
Chris Wilson be17746549 intel-virtual-overlay: Error out if no X11 SHM header is defined
Make the error explicit rather than dieing later with unknown constants.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-04 08:40:49 +01:00
Chris Wilson dd130d1b06 intel-virtual-overlay: Grab the server around mode manipulations
Prevent other clients from seeing the intermediate states.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-23 10:48:52 +01:00
Chris Wilson 011636d25b intel-virtual-output: Hide the remote cursor on initial connection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-20 18:57:11 +01:00
Chris Wilson dcf9b5ae18 intel: Compile fixes for base install of SLED11.sp3
Highlights of that distribution include xorg-xserver-1.6.5, kernel
3.0.76 and gcc-4.3.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-18 12:49:41 +01:00
Chris Wilson 0ceba64821 intel-virtual-output: Debug option for forcing full redraws
References: https://bugs.freedesktop.org/show_bug.cgi?id=68987
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-08 13:51:14 +01:00
Chris Wilson ccd605c492 intel-virtual-output: Unregister our singleton on a clean shutdown
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 00:34:07 +01:00
Chris Wilson 3c5caaf0a9 intel-virtual-output: Only wake up for a change in a visible cursor
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 00:30:53 +01:00
Chris Wilson 91b1f77da5 intel-virtual-output: Make the flush for recreating Damage explicit
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 00:23:37 +01:00
Chris Wilson 3979d11677 intel-virtual-output: Just request Damage BBox
As we ourselves only track the BBox of damage on the virtual outputs, we
can ask X to amalgamate the damage events as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 23:28:16 +01:00
Chris Wilson 2263f8f26f intel-virtual-overlay: Reset damage across modesets
Some versions of the Xserver lose Damage tracking across the modeset,
causing a loss of damage notifications and repainting to cease on the
virtual outputs. We can workaround this by reattaching the damage every
time we receive notification that the local Screen configuration
changes.

Reported-and-tested-by: Severin Strobl <fd@severin-strobl.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68987
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 22:29:55 +01:00
Chris Wilson 5dea07c31d intel-virtual-output: Reset the damage just prior to reading it back
Slightly more efficient command packing and reduces a damage race
slightly...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 21:25:00 +01:00
Chris Wilson bae4162487 intel-virtual-output: We don't need to enable the timer for reconfigure
The timer will be enabled if a reconfiguration actually takes place and
we mark the damaged region to be redrawn.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 21:23:56 +01:00