external: remove unused imKStoUCS files

We needed these files before libxkbcommon had a function to convert
keysyms to unicode, and then for the 'plain' keyboard backend, which
didn't use libxkbcommon. Since this backend was removed, these files are
no longer needed.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
COPYING: remove no longer relevent sections

All of the (xkb) keyboard handling code was written by David and me;
even the old code was not based on xlib but written against the
specification (not entirely correct, too). All of this logic was moved
to libxkbcommon, which we merely link against.

We also no longer carry our own uterm_keysyms.h file, so that section is
not relevant either.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
seat: fix staying alive if compositor-registration fails

If the compositor cannot be created, we now still stay alive and allow
other sessions to work. However, the terminal session is still required as
it is considered to be crucial.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: input: fix resetting key-repeat timer during key-press

We currently do not reset the key-repeat-delay when key-presses are
changed fast enough to fall into the repeat-rate range. Therefore, we
might get spurios key-repeats, even though the key itself wasn't held for
repeat-delay milliseconds.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
seat: fix sending all displays to newly created sessions

We used to create all sessions that listen to displays during startup.
Therefore, all displays were kind of "hotplugged". However, we must also
send already existing displays to new sessions so we can create them
during runtime just fine.

This simply calls the session-callback during session-registration so you
must be fine getting the session callback when calling
kmscon_session_register().

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
seat: add keyboard grabs to close sessions and start new terminals

You can now use ctrl+alt+w to close the current session and
ctrl+alt+Return to start a new terminal (if it is built-in).

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
kmscon: add dummy session type

The dummy session is a very simply session implementation that simply
draws a black background. It will be used by each seat as fallback if no
other session is available. If we didn't do that, we wouldn't be able to
guarantee that the screen is cleared after a session is unregistered.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
seat: use dummy session

This makes the seat implementation register one dummy session as fallback.
This session isn't switched to except if no other session is available.
Furthermore, if the dummy is active and a new session is registered, it is
automatically activated.

External applications should never know of this dummy session. It's a
kmscon internal fallback so we can draw the screen even if there is no
other session available.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
kmscon: add --session-max parameter

This parameter allows to limit the maximum number of sessions to a sane
limit. Otherwise, a user could DOS a systemd by opening as many session as
they want.
This can be set to 0 to drop that limit, however, this is not recommended.
Instead, if you want an ability to add more sessions than that limit, you
should implement a flag to register_session() that overwrites the limit.
This can then be used by a safe way to register new sessions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
kmscon: reorganize configuration items

This just rearranges all options so they are logically grouped and in the
same order at all places. It also changes the internal variable for
"--fbdev" from "use_fbdev" to "fbdev" so all variables have the same name
as the option-names.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
conf: introduce conf_parse_file_f()

This new helper allows easily parsing arbitrary filenames. It does the
same as conf_parse_file() but allows giving filenames in printf format.

The other parsers are slightly adjusted so they can be more easily reused
by other projects.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
kmscon: drop all configs and use new /etc/kmscon/kmscon.conf

This drops all config-file support except for the new
/etc/kmscon/kmscon.conf. For backwards-compatibility, we still parse
/etc/kmscon.conf but this will be removed soon.

We want to add one kmscon-config for each seat so you can have different
configurations per seat. These will all be put into /etc/kmscon/ so we
need this directory.

We also drop ~/.kmscon.conf. This was never really useful as kmscon is a
system daemon and should not be used with user-configuration files.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
kmscon: add helpers to access kmscon_conf

We are about to introduce per-seat-configuration so we need some helper
macros that will later select the right configuration that we read from.

These helpers simply hook into the kmscon-config and return the correct
value.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
kmscon: make configuration-parser modular

This allows changing the backing-memory of a kmscon-config object. This
way, we can parse the same options into a per-seat config object.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: video: drm: do not set EGL_DISPLAY

EGL_DISPLAY is a no-op and we probably want to set EGL_PLATFORM. However,
it doesn't make any sense to set it, because EGL should be able to
properly detect the platform.
If this doesn't work on your machine, you should really try fixing your
environment before forcing this. If there are corner cases where this
doesn't work, you should file a bug against mesa.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
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>
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>
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>
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>
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>