summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* util: add alloca_align()David Herrmann2014-09-22
| | | | | | | | | | The alloca_align() helper is the alloca() equivalent of posix_memalign(). As there is no such function provided by glibc, we simply account for additional memory and return a pointer offset into the allocated memory to grant the alignment. Furthermore, alloca0_align() is added, which simply clears the allocated memory.
* test-util: make valgrind happyDavid Herrmann2014-09-22
| | | | | Properly free all temporary resources to make valgrind not complain about lost records.
* terminal: raise sysview DEVICE_CHANGE events per attachmentDavid Herrmann2014-09-22
| | | | | | | Instead of raising DEVICE_CHANGE only per device, we now raise it per device-session attachment. This is what we want for all sysview users, anyway, as sessions are meant to be independent of each other. Lets avoid any external session iterators and just do that in sysview itself.
* terminal: forward evdev RESYNC events to linked devicesDavid Herrmann2014-09-22
| | | | | | Whenever we resync an evdev device (or disable it), we should send RESYNC events to the linked upper layers. This allows to disable key-repeat and assume some events got dropped.
* terminal: always call _enable/_disable on evdev devicesDavid Herrmann2014-09-22
| | | | | | The current pause/resume logic kinda intertwines the resume/pause and enable/disable functions. Lets avoid that non-obvious behavior and always make resume call into enable, and pause call into disable, if appropriate.
* terminal: print RESYNC state in evcatDavid Herrmann2014-09-22
| | | | | Whenever a key-event is part of a RESYNC, we should print that verbosely as those events are out-of-order.
* bus-policy: add test utilityDaniel Mack2014-09-20
| | | | Add some test files and routines for dbus policy checking.
* bus-policy: add policy check functionDaniel Mack2014-09-20
| | | | | Add policy_check() to actually check whether an incoming message is allowed by the policy. The code is not yet used from the proxy daemon, though.
* bus-policy: print numeric [gu]id in dump_items()Daniel Mack2014-09-20
|
* bus-policy: do not exit() from policy_dump()Daniel Mack2014-09-20
| | | | | This function is quite useful for debugging. Exiting from it seems unnecessary.
* bus-policy: implement dump_items() with LIST_FOREACHDaniel Mack2014-09-20
| | | | Instead of making the function call itself recursively.
* bus-policy: resolve [ug]id of POLICY_ITEM_{USER,GROUP}Daniel Mack2014-09-20
| | | | | Do the lookup during parsing already, and set i->uid, or i->gid to the numerical values.
* bus_policy: set i->[ug]id_validDaniel Mack2014-09-20
|
* bus-policy: append items rather than prepending themDaniel Mack2014-09-20
| | | | | In the D-Bus policy, the order of items matters, so make sure to store them in the same order as they are parsed by the sax parser.
* bus-policy: story mandatory items in right listDaniel Mack2014-09-20
|
* test: udev - restrict nemuric uid's to existing onesTom Gundersen2014-09-20
| | | | | We now verify the existence of uid's before applying them to devicenodes, so change the test accordingly. We assume that both uid/gid 1 and 2 exist on the test system.
* terminal: fix mode sync for connectorsDavid Herrmann2014-09-20
| | | | | | | | | | | | | | | | | | The GETXY ioctls of DRM are usually called twice by libdrm: Once to retrieve the number of objects, a second time with suitably sized buffers to actually retrieve all objects. In grdrm, we avoid these excessive calls and instead just call ioctls with cached buffers and resize them if they were too small. However, connectors need to read the mode list via EDID, which is horribly slow. As the kernel still cannot do that asynchronously (seriously, we need to fix this!), it has a hack to only do it if count_modes==0. This is fine with libdrm, as it calls every ioctl twice, anyway. However, we fail horribly with this as we usually never pass 0. Fix this by calling into GETCONNECTOR ioctls twice in case we received an hotplug event. Only in those cases, we need to re-read modes, so this should be totally fine.
* terminal: restructure some logging calls in grdrmDavid Herrmann2014-09-20
| | | | | | | | | | | | Multiple issues here: 1) Don't print excessive card dumps on each resync. Disable it and make developers add it themselves. 2) Ignore EINVAL on page-flips. Some cards don't support page-flips, so we'd print it on each frame. Maybe, at some point, the kernel will add support to retrieve capabilities for that. Until then, simply ignore it. 3) Replace the now dropped card-dump with a short message about resyncing the card.
* terminal: grdev: schedule virtual frame events if hw doesn't support itDavid Herrmann2014-09-20
| | | | | | | Whenever we cannot use hardware frame events, we now schedule a virtual frame event to make sure applications don't have to do this. Usually, applications render only on data changes, but we can further reduce render-time by also limiting rendering to vsyncs.
* terminal: grdev: raise frame event after DISPLAY_ADD/CHANGEDavid Herrmann2014-09-20
| | | | | | Whenever a display is added or changed, we suppressed any frame events. Make sure to raise them manually so we can avoid rendering when handling anything but FRAME events.
* terminal: split grdrm_crtc_commit() apartDavid Herrmann2014-09-20
| | | | This helper is quite huge, split it apart to make it easier to follow.
* terminal: grdev: refresh device state on hotplug eventsDavid Herrmann2014-09-20
| | | | | Whenever we get udev hotplug events, re-read the device state so we properly detect any changed in the display setups.
* terminal: grdev: treat udev-devices without devnum as hotplugDavid Herrmann2014-09-20
| | | | | | | | | If we get udev-device events via sysview, but they lack devnum annotations, we know it cannot be a DRM card. Look through it's parents and treat it as hotplug event in case we find such a card. This will treat any new/removed connectors as sub-devices of the real card, instead of as devices on its own.
* terminal: modeset: forward DEVICE_CHANGE events into grdevDavid Herrmann2014-09-20
| | | | | Properly forward DEVICE_CHANGE events into grdev so we can react to changing display setups.
* terminal: reduce speed of morphing colors in modeset testDavid Herrmann2014-09-20
| | | | | | The high frequency of the color-morphing is kinda irritating. Reduce it to a much lower frequency so you can actually look at it longer than few seconds.
* terminal: make drm-connectors first-level devicesDavid Herrmann2014-09-20
| | | | | | So far, we only forward DRM cards via sysview APIs. However, with MST, connectors can be hotplugged, too. Forward the connectors as first-level devices via sysview so API users can react to changing DRM connectors.
* terminal: forward DEVICE_CHANGE events via sysviewDavid Herrmann2014-09-20
| | | | | | | Whe need to react to "change" events on devices, but we want to avoid duplicating udev-monitors everywhere. Therefore, make sysview forward change events to the sysview controllers, which can then properly react to it.
* terminal: parse ID_SEAT not only for parents but the device itselfDavid Herrmann2014-09-20
| | | | | | | | When deciding what seat a device is on, we have to traverse all parents to find one with an ID_SEAT tag, otherwise, input devices plugged on a seated USB-hub are not automatically attached to the right seat. But any tags on the main device still overwrite the tags of the childs, so fix our logic to check the device itself first, before traversing the parents.
* nspawn: don't try to create veth link with too long ifnameTom Gundersen2014-09-19
| | | | Reported by: James Lott <james@lottspot.com>
* terminal: add systemd-modeset debugging toolDavid Herrmann2014-09-19
| | | | | | | | | The systemd-modeset tool is meant to debug grdev issues. It simply displays morphing colors on any found display. This is pretty handy to look for tearing in the backends and debug hotplug issues. Note that this tool requires systemd-logind to be compiled from git (there're important fixes that haven't been released, yet).
* terminal: add grdev DRM backendDavid Herrmann2014-09-19
| | | | | | | | | | | | | | | | The grdev-drm backend manages DRM cards for grdev. Any DRM card with DUMB_BUFFER support can be used. So far, our policy is to configure all available connectors, but keep pipes inactive as long as users don't enable the displays on top. We hard-code double-buffering so far, but can easily support single-buffering or n-buffering. We also require XRGB8888 as format as this is required to be supported by all DRM drivers and it is what VTs use. This allows us to switch from VTs to grdev via page-flips instead of deep modesets. There is still a lot room for improvements in this backend, but it works smoothly so far so more enhanced features can be added later.
* terminal: add graphics interfaceDavid Herrmann2014-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | The grdev layer provides graphics-device access via the libsystemd-terminal library. It will be used by all terminal helpers to actually access display hardware. Like idev, the grdev layer is built around session objects. On each session object you add/remove graphics devices as they appear and vanish. Any device type can be supported via specific card-backends. The exported grdev API hides any device details. Graphics devices are represented by "cards". Those are hidden in the session and any pipe-configuration is automatically applied. Out of those, we configure displays which are then exported to the API user. Displays are meant as lowest hardware entity available outside of grdev. The underlying pipe configuration is fully hidden and not accessible from the outside. The grdev tiling layer allows almost arbitrary setups out of multiple pipes, but so far we only use a small subset of this. More will follow. A grdev-display is meant to represent real connected displays/monitors. The upper level screen arrangements are user policy and not controlled by grdev. Applications are free to apply any policy they want. Real card-backends will follow in later patches.
* login: pause devices before acknowledging VT switchesDavid Herrmann2014-09-19
| | | | | | | | | | | | | | | | | | If a session controller does not need synchronous VT switches, we allow them to pass VT control to logind, which acknowledges all VT switches unconditionally. This works fine with all sessions using the dbus API, but causes out-of-sync device use if we switch to legacy sessions that are notified via VT signals. Those are processed before logind notices the session-switch via sysfs. Therefore, leaving the old session still active for a short amount of time. This, in fact, may cause the legacy session to prepare graphics devices before the old session was deactivated, and thus, maybe causing the old session to interfer with graphics device usage. Fix this by releasing devices immediately before acknowledging VT switches. This way, sessions without VT handlers are required to support async session switching (which they do in that case, anyway).
* socket: introduce SELinuxContextFromNet optionMichal Sekletar2014-09-19
| | | | | | | | | | This makes possible to spawn service instances triggered by socket with MLS/MCS SELinux labels which are created based on information provided by connected peer. Implementation of label_get_child_mls_label derived from xinetd. Reviewed-by: Paul Moore <pmoore@redhat.com>
* shared: wtmp-utmp - don't clear store_wtmp in utmp_put_dead_process()Tom Gundersen2014-09-19
| | | | | Also modernize a few other things and add comments to explain CID #1237503 and CID #1237504.
* test: warn if we could not parse the loop count argumentThomas Hindoe Paaboel Andersen2014-09-19
| | | | Found by coverity. Fixes: CID#1237512
* shared/sparse-endian.h: add missing byteswap.h includeEmil Renner Berthing2014-09-19
|
* shared/label.h: add missing stdio.h includeEmil Renner Berthing2014-09-19
|
* pty: include linux/ioctl.h for TIOCSIGDavid Herrmann2014-09-19
| | | | | | TIOCSIG is linux specific, so include the linux ioctl header to make sure it's defined. We currently rely on some rather non-obvious recursive includes. Make sure its always defined regardless of the system headers.
* nss: remove dead codeThomas Hindoe Paaboel Andersen2014-09-19
| | | | | | | | | | | | | | | | | | | | | | | | c > 0 is already guaranteed from earlier checks. We go from ms = ALIGN(l+1) + sizeof(char*) + (c > 0 ? c : 1) * ALIGN(alen) + (c > 0 ? c+1 : 2) * sizeof(char*); to ms = ALIGN(l+1) + sizeof(char*) + c * ALIGN(alen) + (c+1) * sizeof(char*); to ms = ALIGN(l+1) + c * ALIGN(alen) + (c+2) * sizeof(char*); Found by coverity. Fixes: CID#1237570 and CID#1237610
* timesyncd: check return of setting IP_TOSTom Gundersen2014-09-18
| | | | Fonud by Coverity. Fixes CID #1237534.
* udevd: don't fail if /run/udev existsTom Gundersen2014-09-18
|
* udev: fix typosTom Gundersen2014-09-18
| | | | Spotted by Andreas Henriksson.
* udev: ctrl - log if setting SO_PASSCRED failsTom Gundersen2014-09-18
| | | | | | No functional change. Found by Coverity. Fixes CID #1237533.
* udev: node - warn if chmod/chown failsTom Gundersen2014-09-18
| | | | | | No functional change, just log the warning. Fonud by Coverity. Fixes CID #1237544.
* udevadm: hwdb - check return value of fseeko()Tom Gundersen2014-09-18
| | | | Fonud by Coverity. Fixes CID #996255.
* udevd: check return of various functionsTom Gundersen2014-09-18
| | | | One reported by Coverity. Fixes CID #996252.
* udevd: parse_argv - warn if argumens are invalidTom Gundersen2014-09-18
| | | | Found by Coverity. Fixes CID #1238780.
* journal-remote: check return code of sd_event_defaultAndreas Henriksson2014-09-18
| | | | | | | Handle sd_event_default returning error and bail out properly as done in every other caller of this function. Found by coverity. Fixes: CID#1238957
* sysusers: Remove some gcc warnings about uninitialized variablesPhilippe De Swert2014-09-18
| | | | | Gcc is spewing some warnings about uninitialized variables. Let's get rid of the noise.