log: move includes to top

There is no reason to include headers in the main body of the source code.
Move it to the top so it's more readable.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
shl: move log.[ch] to shl_log.[ch]

We want to avoid any static files that are shared between multiple
programs but are not part of SHL. These make the build-process just more
complex.
Move log.[ch] to SHL so we have a known context.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
shl: move githead into a source file

This moves githead.h to shl_githead.c so we can skip recompilations on
GIT-HEAD changes. We only need to relink now (which we cannot skip).

This speeds up build-processes considerably on slower machines.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
uvtd: add new Virtual Terminal daemon

This introduces uvtd which replaces kmscon sessions as an external helper
program. It's still a dummy program but it will get extended soon. After
that, kmscon sessions will get removed and limited to a single seat. This
will simplify kmscon itself heavily and move rarely used features out of
kmscon into helpers.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
tests: use new shl_log.h

log.h was moved to shl so use it in all tests.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
build: add --enable-all

This flag enables all other options that extend the build. It is used for
debugging only and should never be used by distributions to control what
is built. Hence, we don't document it and never advertise it.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
build: use xz tarballs instead of bz2

xz is way better than bz2 with same/better decompression times.
Compression will take longer, but that's totally ok.

All new tarballs will be provided as xz only. Please adjust your
build-scripts to stop using bz2.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
docs: fix links to point to freedesktop.org

kmscon is now hosted on freedesktop.org. Please don't use the github
links, anymore. I will push to github for some more weeks, but I recommend
to everyone to use my freedesktop.org repository as primary upstream link.

There were many reasons why github.com wasn't sufficient, anymore. But the
main reason is that they no longer provide upload space for release
tarballs. Hence, lets ditch github and move to freedesktop.org which
kindly provides everything we need plus a really nice mailing-list.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
build: add .xz files to gitignore instead of bz2

We use .xz now instead of .bz2 for release tarballs.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
README: fix tarball-link to /software/kmscon

We now have official upload space on freedesktop.org. No need to link to
my personal upload space, anymore.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
shl: array: add shl_array_zresize()

This helper resizes the array to a given length and zeroes out all new
elements.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
shl: dlist: add _first/_last helpers

These helpers return the first and last elements respectively.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
shl: add flagset helper

A flagset is a dynamic array where each bit of the array can be
independently set/reset. It can be used for minor/major allocations or
for other dynamically growing bitsets.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
uvt: cdev: print minor/major debug messages

These numbers are pretty useful during debugging so print them before
attempting to create the cdev devices.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
uvt: cdev: fix sending DEVNAME parameter

We used an incorrectly formatted arguments as we mixed up two local
variables. Use the correct DEVNAME format now.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
uvt: add SHL_EXPORT to cdev+ctx subsystems

We need to export the symbols to make use of them. This exports all useful
ctx+cdev functions for outside use. The other subsystems still need to get
reviewed before we export them.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
build: add shl_flagset to build-system

We need the shl_flagset as part of SHL to make use of it.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
uvt: ctx: add major/minor helpers

Two new functions to retrieve the current major number and dynamically
allocate minor numbers.
This can be used by clients that allocate more than one CDEV for VTs to
dynamically retrieve a new minor number.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
uvtd: add ctx subsystem

The ctx subsystem manages the CDEV devices for each seat. It currently
allocates one manager device and a given number of legacy devices that can
be accessed via subdirectories.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
uvt: include inttypes.h

We use uint8_t so make sure we include inttypes.h in uvt.h.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>