summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2014-12-17intel-virtual-output: Do not attempt to tidy up the local display if it failsChris Wilson
Just fix the segfault dereferencing the primary display if we bail during its setup. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-17intel-virtual-output: Add version number to verbose outputChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-12intel-virtual-output: Initialise width/height for a disabled outputChris Wilson
virtual.c:1081:6: warning: variable 'width' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (clone->dst.mode.id == 0) { ^~~~~~~~~~~~~~~~~~~~~~~ virtual.c:1092:6: note: uninitialized use occurs here if (width == clone->width && height == clone->height) ^~~~~ virtual.c:1081:2: note: remove the 'if' if its condition is always false if (clone->dst.mode.id == 0) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ virtual.c:1079:11: note: initialize the variable 'width' to silence this warning int width, height; Reported-by: Zdenek Kabelac <zkabelac@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-27intel-virtual-output: Use snprintf() for simplicityChris Wilson
Third one-line patch to fix copying from the tainted user argument into the socket's path buffer. This time, give in and just use snprintf() as it guarrantees that it will not write more than 'n' characters and that the last is a NUL byte. Suggested-by: Zdenek Kabelac <zkabelac@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-26intel-virtual-output: Fix invocation of strncpy()Chris Wilson
Somebody (me) confused it with snprintf() and put the string length in the wrong location. Also note that strncpy() does not NUL terminate long strings. Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-26intel-virtual-output: Sanity check length on user supplied socket pathChris Wilson
Reported-by: Zdenek Kabelac <zkabelac@redhat.com> Suggested-by: Zdenek Kabelac <zkabelac@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-18configure: Double check xinerama's headersChris Wilson
Having the pkgconfig present doesn't always necessarily imply the headers are installed correctly - just fail over gracefully for xinerama and intel-virtual-output Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-17backlight: Prevent dereference of potential NULL argvChris Wilson
Adam Sampson spotted that "It's possible (but not very sensible) to exec a program with an empty argument list, so argv[0] is not necessarily a valid pointer. For example: $ cat exec0.c int main(int argc, char *argv[]) { char *empty[1] = { NULL }; execvp(argv[1], empty); perror("execvp"); return 1; } $ ./exec0 /usr/libexec/xf86-video-intel-backlight-helper Usage: (null) <iface> " He sensibly suggested that we hardcode the program name to avoid the NULL dereference. Being the paranoid type, we should also be careful not to write to any file descriptors outside of our control (i.e. stderr), so disable the messages unless we are debugging. Reported-by: Adam Sampson Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-04backlight: Fix security issues in handling of the interface path name.Matthieu Herrb
- don't allow '/' in the interface name to avoid escaping the /sys hierarchy - check snprintf() return value for overflow. Problems reported by Adam Sampson. Thanks. Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> Reviewed-by: Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-30intel-virtual-output: Remove one redundant cleanup on errorChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-29intel-virtual-output: Cleanup singleton on failureChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-29intel-virtual-output: Convert debugging messages to verbosityChris Wilson
Original patch by main.haarp: "A verbose switch is quite useful for debugging, it shouldn't require editing and recompilation to gain more useful output. I added it." Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80664 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-25intel: Fix weblinks (again)Chris Wilson
Julien pointed out that I fail at checking links. Reported-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-25intel: Fix weblinksChris Wilson
Matti reported a few outdated links to intellinuxgraphics.org, now superseded by 01.org. Reported-by: Matti Hämäläinen <ccr@tnsp.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13intel-virtual-output: Compile fixesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13intel-virtual-output: Disable outputs on remote displays upon shutdownChris Wilson
References: https://bugs.freedesktop.org/show_bug.cgi?id=79994 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13intel-virtual-output: Initialise image after cloneChris Wilson
As the image inherits its width/height from the clone, we need to set those first on the clone. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79994 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13intel-virtual-output: Only call XShmDetach on a valid SHM segmentChris Wilson
Saves a couple of extraneous XErrors. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13intel-virtual-output: Check for an error creating the DRI3 fdChris Wilson
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79994 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-02intel-virtual-output: Add DRI3 xfer pathChris Wilson
Just as proof-of-principle. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-22intel-virtual-output: Probe after claiming virtual outputChris Wilson
Rerun a detection cycle after claiming the virtual output so that it is hidden again. References: https://bugs.freedesktop.org/show_bug.cgi?id=78293 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-16intel-virtual-output: Mark the source SHMPixmap as writeableChris Wilson
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-14intel-virtual-output: Make it possible to disable building via configureChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-07intel-virtual-output: Disable remote CRTC using the remote Display!Chris Wilson
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-06intel-virtual-output: Grab the server whilst cleanging up the local outputChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-05intel-virtual-output: Copy existing CRTC informationChris Wilson
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-05intel-virtual-output: Try disabling Panning after disabling CRTCChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-05intel-virtual-output: Mark ShmPixmap destinations as writeableChris Wilson
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-05intel-virtual-output: Check for errors whilst creating ShmPixmapsChris Wilson
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-05intel-virtual-output: Record shm/randr/xinerama queries in DBG logChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-05intel-virtual-output: Check error state when disabling CRTCChris Wilson
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-04-09intel-virtual-output: Fix damage boundsChris Wilson
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-07intel-virtual-output: Fixup DBG messagesChris Wilson
Use the right variables and it may even compile. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-27intel-virtual-output: Add DBG option to force 16 bit transfersChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-25intel-virtual-output: Fix damage iteration over active listChris Wilson
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-25intel-virtual-output: Add a little more DBG around damaging clonesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-25intel-virtual-output: Do not detach with DBG enabledChris Wilson
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-14intel-virtual-output: Minor DBG fixesChris Wilson
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-14intel-virtual-output: Iterate over remote outputs in the same order as listedChris Wilson
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-14intel-virtual-output: Disable panning before setting mode on CRTCChris Wilson
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-14intel-virtual-output: Mode names are freed with ScreenResourcesChris Wilson
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-14intel-virtual-output: Include extra debug information for modesetsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14intel-virtual-output: Disable remote CRTCs at startupChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-18intel-virtual-output: Discard unwanted events from the mouse recorderChris Wilson
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-17backlight-helper: Simplify reading the level from stdinHans de Goede
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-15Backlight helper build fixesJan Alexander Steffens (heftig)
Don't hardcode $(prefix)/libexec Fix install hook when DESTDIR is set Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75028
2014-02-15intel: Add a helper for setting backlight without root rightsChris Wilson
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-12intel-virtual-output: Do not resize the screen whilst all outputs are offChris Wilson
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-12intel-virtual-output: Force an output probe on initial connection to remote ↵Chris Wilson
display Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12intel-virtual-output: Fix checking for no change in output modesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>