1113 Commits

Author SHA1 Message Date
David Herrmann
a9c61f7644 kmscon: add --video-devices option
If all the auto-detection logic of kmscon still does something you don't
want, you can now use this list to override all this logic with a
statically configured white-list.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 16:02:28 +01:00
David Herrmann
fb2006fe9a shl: add shl_string_list_is() helper
This helper tests whether a string-list has only a single entry and
compares this with the given entry.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 16:01:47 +01:00
David Herrmann
bedba7a7e3 uterm: monitor: mark vesafb devices as primary
VESA VGA devices are platform devices so they are always primary.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 15:40:56 +01:00
David Herrmann
8bd338f8b1 kmscon: remove deprecated /etc/kmscon.conf support
This was supported for backwards-compatibility, but is no longer
supported. Use the new /etc/kmscon/kmscon.conf files.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 15:23:09 +01:00
David Herrmann
3085b252ca kmscon: replace --fbdev/--dumb with --drm/--hwaccel
The old options were quite stupid and low-level. It doesn't make sense to
require users to understand "--dumb" (besides, it sounds wrong).

Therefore, two new options replace the old options:
 --drm: Enabled by default. If true, kmscon uses primary DRM devices and
        avoids primary fbdev devices. If false, kmscon uses no DRM devices
        at all but uses primary fbdev devices now.
 --hwaccel: Disabled by default. If true, kmscon tries to
            hardware-accelerate any rendering if available. This can also
            affect fbdev or other devices in the future.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 15:20:20 +01:00
David Herrmann
3e1f9f0c61 uterm: add uterm_video_available() helper
This helper provides information whether a given backend is available and
even whether kernel-runtime support is available for this backend.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 15:17:36 +01:00
David Herrmann
b1c7902eeb uterm: enable DRM helpers with UTERM_VIDEO_DUMB
The DRM helpers can actually also be used with dumb-displays so provide it
in both cases.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 14:22:19 +01:00
David Herrmann
16cf16c1aa NEWS: add kmscon-6 entries
Add entries for all main features since kmscon-5.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 19:22:56 +02:00
David Herrmann
f5a98b0c6b kmscon: fix --fbdev implying --all-gpus
We currently have no code that sets PRIMARY flags for fbdev devices so
this logic does not make sense with --fbdev. Hence, imply --all-gpus when
--fbdev is set.

Reported-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 19:21:56 +02:00
David Herrmann
e495126c80 kmscon: add --xkb-model option
This option now allows the user to change the XkbModel from the command
line or configuration file.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 19:00:43 +02:00
David Herrmann
8f79d860c1 uterm: input: allow passing "model" for keyboard descs
We set the model to a system-default, which means, we are hosed if the
system-default is not what the user expects. Therefore, allow setting the
model via internal APIs.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:55:21 +02:00
David Herrmann
3c9a3f3e2d kmscon: turn --switchvt on by default
We really _want_ this so turn it on by default. Especially for fake-VTs,
this really should be turned on all the time.
Use --no-switchvt to disable it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:50:50 +02:00
David Herrmann
797675953b conf: fix CONF_OPTION_BOOL warnings
We need to cast the boolean to void* to avoid warnings when using "true"
as default value instead of "false" (which evaluates to 0 => NULL).

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:50:03 +02:00
David Herrmann
9d2018f521 build: fix "make check" build failures
I forgot again to keep these up to date. The conf-layer updates broke them
horribly. However, we now build them correctly without kmscon-core by
including all required layers directly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:32:43 +02:00
Ran Benita
6e05334695 tsm_vte: don't interpret Pause, it hangs the VTE
Pressing the 'Pause/Break' key causes the VTE to hang with no apparent
way to recover (from within kmscon). It must turn on some software flow
control, XON/XOFF or whatever.
We might want to do something with this key, but certainly not *that*.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:21:11 +02:00
Ran Benita
a939a9e59f tsm_vte: don't send sequence for Scroll_Lock
This value should not be sent to the application; currently pressing
Scroll Lock does some weird character transposing, which I believe to be
completely accidental.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:17:25 +02:00
Ran Benita
c8f79aa53d tsm_vte: bind non-numlock'ed keypad keys correctly
When a user presses on the 4 key on the keypad with NumLock off, the
expected behavior is to move left. This commit fixes all of the main
keypad keys to act like their counterparts (though KP_Begin is not
bound to anything).
This is also what xterm does, as far as I can tell:
http://anonscm.debian.org/gitweb/?p=pkg-xorg/app/xterm.git;a=blob;f=input.c;h=f049078ed672c1da5adc169e85dc458b0fffc100;hb=HEAD#l984

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:13:42 +02:00
Ran Benita
b5c05dd5f1 uterm_input_uxkb: update leds to match keyboard state
Upon device wakeup or led state changes, we update the keyboard LEDs to
match the new xkb state.

This means that every kmscon instance retains its own LED state, in the
users eyes. In other words, if you had Num Lock set on one kmscon, switched
to an X VT where it's off, and come back, then Num Lock will be set as
when you left. This is what X server, linux VT, etc. do.

Note that since we need to write the LED events to the evdev devices, we
need to open them RDWR. But since we don't really care what happens to
that write(), that's fine.

Also note that this means NumLock is off by default, which might be
annoying. We need to think how to get some 'setleds' or 'numlockx'
equivalent functionality.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:12:59 +02:00
Ran Benita
28c8d07109 uterm_input: change device 'feature' to device 'capability'
'capability' seems to be the common terminology for this, and it sounds
better - so use it.

We also move the enum definition to the header, because otherwise the
'capabilities' field there doesn't make sense.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:08:30 +02:00
Ran Benita
874bbbe17a uterm_input: remove supporting code for updating LED state
Before we transitioned to xkbcommon, we had some code that, upon
returning from a VT-switch, looked at the evdev led state and updated
the keyboard modifier state accordingly. So if we returned and NumLock
was on, we adjusted ourselves to that. That was pretty cute.

xkbcommon however doesn't support updating the state by LEDs like that.
Normally, the state of the LEDs is derived from the modifiers; going the
other way is tricky, error-prone and not used much. What we should be
doing is updating the LEDs according to *our* state.

This commit does the part of removing the unused dead code.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:08:05 +02:00
Ran Benita
2843c80c5b xkb: use system defaults instead of "us" for layout
libxkbcommon has a configure option to set the default values for the
RMLVO's (if they are passed as NULL or "" - we use "" so it'd be safe to
print). If they are not specified there, it's just "us" like we currently
do have. But if they are specified, we should most likely defer to it.

We do the same for the model field, instead of hardcoding "evdev". The
rules field remains hardcoded to "evdev", because we rely on it when
doing the evdev scancode-to-keycode +8 mapping.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:06:43 +02:00
Ran Benita
ae78864cc9 xkb: don't use deprecated libxkbcommon symbols
Now that libxkbcommon had a release, that has some API breakage (in
particular to xkb_keysym_from_name), we should update our code against
it and advise users to just use the xkbcommon release.

This should not happen anymore, for the foreseeable future at least.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:05:59 +02:00
David Herrmann
5be8972270 kmscon: add --primary-gpu-only and --all-gpus options
By default, kmscon now only uses primary und auxiliary displays. All
uncategorized displays are ignored. This fixes problems with dual-GPU
systems.

--primary-gpu-only makes kmscon not use any auxiliary displays. --all-gpus
makes kmscon also use uncategorized displays.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:00:27 +02:00
David Herrmann
dbd5fa7e74 uterm: monitor: mark auxiliary devices
We now mark auxiliary displays specially so applications know which
devices can be used independently. We currently only mark USB devices as
such but this can be extended in the future for more devices.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 17:46:48 +02:00
David Herrmann
881026ad31 uterm: monitor: report primary GPUs to caller
We check every DRM GPU now whether it matches the primary PCI GPU. If it
does, we set a new UTERM_MONITOR_PRIMARY flag for the device.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 13:55:54 +02:00
David Herrmann
9015f3107d uterm: monitor: add "dev_flags" field to event-structure
Instead of using different types we now use flags. This is more
appropriate and will allow us more easily to add new flags.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 13:41:23 +02:00
David Herrmann
89e84aa78c uterm: add PCI primary GPU detection
We used to simply probe every GPU that is reported by the kernel. However,
if a system has multiple GPUs that share display controllers, we cannot
use both simultaneously. Unfortunately, the kernel currently does not
notify us about this. Hence, we use some heuristics to determine which GPU
is the boot-gpu/primary-gpu.

This only adds the detection logic, it does not modify any code to use
this detection at all.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 13:25:44 +02:00
David Herrmann
2c5e9bff2b kmscon: add character-device session dummy
If libfuse is available then kmscon is built with a new session type: cdev
This session creates a fake TTY char-dev via CUSE (which itself uses FUSE)
which then can be used by user-space as if it were a real VT.

This is still incomplete and does only support basic I/O, yet. But it
shows in what direction this is going.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-26 18:08:35 +02:00
David Herrmann
eaffe90061 shl: ring: provide offset parameter for shl_ring_peek()
If we want to fill a whole buffer, we actually might have to read more
data than just the data from the beginning. Therefore, provide an offset
so we can read from multiple pages.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-25 14:47:32 +02:00
David Herrmann
a0a9a7f9b4 kmscon: fix session-include fallbacks
We must provide safe fallbacks if the register-functions are not provided
as they are not compiled into kmscon.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-24 18:52:54 +02:00
David Herrmann
8b30e6cf11 wlt: toolkit: update to new wayland-0.99 API
The wayland-0.99 API changed some bits. This updates wlt-toolkit to work
with the new API.

There are still some bugs that need to be fixed, however, it builds fine
and runs perfectly well on weston. The last flickering/tearing bugs have a
low priority, currently. They can be fixed when kmscon-6 is done.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-24 17:01:44 +02:00
David Herrmann
031e9a9039 eloop: fix ev_fd_update() to do nothing if the mask does not change
If the new mask is equal to the old mask, we shouldn't change anything.
This improves performance and avoids syscalls when they aren't needed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-24 17:00:48 +02:00
David Herrmann
b9743bb75c conf: try to give better hints if keysyms were mistyped
We can now check keysym names on case-insensitive basis. We can use this
to try to give hints to the user what they probably meant when mistyping a
keysym name.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-24 15:46:19 +02:00
David Herrmann
37d3499fb5 README: remove xkbcommon references
xkbcommon now has seen a public release (0.2.0) and we have a hard
dependency on it. No more config-fiddling. You must provide xkbcommon to
make kmscon work!

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-24 15:45:21 +02:00
David Herrmann
069e467913 conf: fix using new xkbcommon-0.2.0 API
The xkbcommon API was changed for 0.2.0 release. But now it should be
stable so we hopefully fixed it for the last time.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-24 15:25:23 +02:00
David Herrmann
1cd2e00bc1 kmscon: rework --login handling
We implement --login as special type now. This allows us to correctly
parse it in configuration files.
We also replace the default value by /bin/login.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-23 13:22:06 +02:00
David Herrmann
6b8006a530 kmscon: simplify --vt handling
We can reuse all the conf_string.* functions and do not have to implement
them ourself.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-23 13:21:27 +02:00
David Herrmann
55410d376a seat: fix closing dummy sessions
We must reset the "dummy" pointer when unregistering dummy sessions,
otherwise, we will get NULL pointer derefs.
This also prevents keyboard-input from closing dummy sessions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-23 13:18:42 +02:00
David Herrmann
0cd57e21ae shl: misc: add shl_dup_array_size() helper
This is the same as shl_dup_array() but the source might not be NULL
terminated so it takes a "size" argument.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-23 12:32:37 +02:00
David Herrmann
936992298c build: fix typo in wlterm dependency checking
This is just two small typos/copy-paste-errors that didn't get checked
earlier.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-23 12:06:55 +02:00
David Herrmann
d4529d735a conf: simplify helper macros
Instead of using "NULL, NULL, NULL, " in every macro, we now provide a
*_FULL variant which allows setting these. All other macros simply set
these to NULL by default.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-23 12:05:42 +02:00
David Herrmann
8923fe2123 conf: call aftercheck after config-file parsing is done
We need to call afterchecks after any parsing we do. To signal that there
are no extra-arguments, we pass argv==NULL.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-23 11:45:43 +02:00
David Herrmann
6aeae8be93 conf: add "file" callback
The "file" callback is used to parse configuration files. If it is not
given, the string is parsed via "parse".

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-23 11:41:34 +02:00
David Herrmann
8a4ddda742 Merge branch 'github/master'
Merge upstream development into the config-rework.
2012-10-23 11:39:24 +02:00
David Herrmann
696adf965a build: add proper dependency checking to configure.ac
We build several tools inside of this repository and we need to make sure
all dependencies are met. Furthermore, we must make sure that default
values are recognized even on dependencies.
Hence, this reworks the whole configure.ac handling and does some renaming
of the constants that are used all over the source.

We need to test this some more weeks, but it should finally be a proper
autotools handling that we can release with kmscon-6.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-23 11:35:49 +02:00
David Herrmann
338e1ee063 uterm: dumb: clear buffer on allocation
DRM buffers are not guaranteed to be cleared after allocation. This is to
boost performance for small buffers that are allocated and freed often.
However, for render-buffers we can clear them without loosing any
performance as they are allocated once and then only freed on shutdown.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-22 14:00:39 +02:00
David Herrmann
9e0db18fb9 kmscon: use local configs instead of global kmscon_conf
We now have the ability to pass on local configurations so we no longer
need the global kmscon_conf.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-19 17:18:58 +02:00
David Herrmann
d40b23d789 conf: add option-copy callback
We allow options to specify "aftercheck" callbacks but do not call them
during a copy. Therefore, we need a way to copy side-effects. As we cannot
do that generically, we now allow each option to specify such a callback.

We use it for the "all_seats" and "argv" parameters in kmscon.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-19 16:51:01 +02:00
David Herrmann
78cf66f087 conf: fix overwriting locked options during copy
If we copy entries into another context, we must not overwrite locked
entries. Furthermore, if we copy a locked entry, we must also copy that
lock.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-19 16:19:26 +02:00
David Herrmann
06c6e56d4c kmscon: implement per-seat configuration
Sorry for the huge commit, but this reworks the whole configuration
handler. We now provide conf_ctx contexts which contain a pointer to the
backing storage and the config-options that are used.

It is also possible to copy config-options now. So we can use the
main-config as default value for seat-configurations.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-19 16:15:34 +02:00