Commit Graph

115 Commits

Author SHA1 Message Date
Chris Wilson 10c18b1a46 intel-virtual-output: Mark the source SHMPixmap as writeable
This is fortunately a no-op, as it gets initialized to zero already
(that is the pixmap is writeable). However, we may as well do the right
thing...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-16 10:02:16 +01:00
Chris Wilson 0625185f47 intel-virtual-output: Make it possible to disable building via configure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-14 17:29:21 +01:00
Chris Wilson c5bad6daaa intel-virtual-output: Disable remote CRTC using the remote Display!
Reported-by: Kirill Müller <mail@kirill-mueller.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78293
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-07 07:56:14 +01:00
Chris Wilson 77507909a1 intel-virtual-output: Grab the server whilst cleanging up the local output
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-06 06:59:20 +01:00
Chris Wilson 464ef44ab1 intel-virtual-output: Copy existing CRTC information
If we fail to disable the remote output during initialisation, copy the
current configuration in order to try and keep the bookkeeping in order.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-05 14:50:44 +01:00
Chris Wilson 194f9332d3 intel-virtual-output: Try disabling Panning after disabling CRTC
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-05 14:34:12 +01:00
Chris Wilson 5279ebf564 intel-virtual-output: Mark ShmPixmap destinations as writeable
In order to prevent a subsequent BadAccess when we try to use it as a
ShmPixmap, we need to mark the segment as writeable.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
References: https://bugs.freedesktop.org/show_bug.cgi?id=78293
2014-05-05 13:07:31 +01:00
Chris Wilson a93d2d4f91 intel-virtual-output: Check for errors whilst creating ShmPixmaps
Creating a ShmPixmap may cause an asynchronous BadAccess error, so wrap
the construction with XSync and check for an error before proceeding.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
References: https://bugs.freedesktop.org/show_bug.cgi?id=78293
2014-05-05 13:07:31 +01:00
Chris Wilson 45892b3a63 intel-virtual-output: Record shm/randr/xinerama queries in DBG log
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-05 12:42:56 +01:00
Chris Wilson 6c9f216d7c intel-virtual-output: Check error state when disabling CRTC
Only mark an output as disabled if we do successfully disable it. This
will require a little more work to make sure that such errors are
cleanly propagated back to the host...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-05 12:42:56 +01:00
Chris Wilson f9a279b2dc intel-virtual-output: Fix damage bounds
Sigh. A serious mixup of integer promotion rules and wraparound caused
the damage computation for small regions to be completely bogus.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-09 22:15:19 +01:00
Chris Wilson bf18751398 intel-virtual-output: Fixup DBG messages
Use the right variables and it may even compile.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-07 08:28:55 +01:00
Chris Wilson 771b86e2a8 intel-virtual-output: Add DBG option to force 16 bit transfers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-27 14:26:54 +00:00
Chris Wilson a273b207b9 intel-virtual-output: Fix damage iteration over active list
When iterating over the active list to mark the current damage, we need
to chase the ->active pointer rather than ->next or else we walk the
wrong list from the wrong starting point.

Reported-by: Kirill Müller <mail@kirill-mueller.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76271
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-25 09:40:40 +00:00
Chris Wilson bfd51e2056 intel-virtual-output: Add a little more DBG around damaging clones
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-25 08:59:58 +00:00
Chris Wilson 278ef8f7bc intel-virtual-output: Do not detach with DBG enabled
Since DBG is sent to stdout, we only see it if we do not daemonize
(which closes stdout).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-25 08:33:46 +00:00
Chris Wilson 57e63221ec intel-virtual-output: Minor DBG fixes
Improve the summary after failing to detect MIT-SHM, and fix a DBG

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 19:49:59 +00:00
Chris Wilson 8cc1f005c6 intel-virtual-output: Iterate over remote outputs in the same order as listed
If we walk the output lists in the same order as they are listed by
RandR, we are more likely to hit favourable priority sorting. E.g. the
user is likely to setup the outputs in the same order as listed, meaning
fewer CRTC transitions etc.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 15:55:41 +00:00
Chris Wilson a55bbe3b59 intel-virtual-output: Disable panning before setting mode on CRTC
For whatever reason, presumably to do with the switch between CRTCs, we
need to disable the panning before setting the mode in order for our
desired CRTC position to take effect.

Reported-by: Jeff Katz <bugzilla@kraln.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76146
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 15:47:20 +00:00
Chris Wilson 5079830bd5 intel-virtual-output: Mode names are freed with ScreenResources
So we have to be careful not to continue to reference the strings after
they may be freed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 14:35:29 +00:00
Chris Wilson f47f192f22 intel-virtual-output: Include extra debug information for modesets
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 11:38:19 +00:00
Chris Wilson 0ad54325e9 intel-virtual-output: Disable remote CRTCs at startup
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 08:15:24 +00:00
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