The uterm library does not need and must not depend on main.h. Remove the
unneeded inclusion.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds two more color-palettes and a mode to choose the used palette.
The "solarized" palettes are from an online project that tries to optimize
color palettes.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds a color-palette-pointer to VTE objects so each VTE object can
have a different palette. This allows runtime configuration of terminal
colors.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This new function allows other layers to control the default attribute of
a console. This attribute is used when clearing the screen or when
allocating new cells.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The fakevt helper binary can be used on VT-less systems or seats to make
kmscon activate the fake VT and deactivate it. This way, you can control
when kmscon acquires video devices and when it releases them.
This is a global setting that affects all seats where kmscon is running
except seat0 if it uses real VTs.
This should only be used for debugging. This is really no intended for use
in production.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
/dev/tty may be available even though CONFIG_VT is not set. Therefore,
check for /dev/tty0 instead which is guaranteed to be not available with
CONFIG_VT=n.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We must make sure that the returned value is non-NULL, otherwise we crash
during device-change events for non-DRM-Hotplug events.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds a very limited non-multi-seat-capable fake-VT logic. If you use
this in production it will break your multi-seat systems so do not use it
except for debugging.
On SIGUSR1 we activate fake VTs and on SIGUSR2 we deactivate them. The
signals must be sent from a priviledged process. Kernel signals are
ignored.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
If using real linux VTs, we must ignore all signals that are not sent from
the kernel. Otherwise, we might get problems if we reuse SIGUSR for other
functionality.
Note that we already check that we are the active VT before handling
SIGUSR. However, this hardens this check to be more sure that this is
really the signal we want.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
To avoid useless checks wether a vt is valid we simply mark it as dead and
centralize the checks in the API entry point.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This register the SIGUSR1/2 signal handlers even though we are no real VT.
This is needed to implement other fake-VT helpers for systems were real
VTs are not available.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of using the old kmscon_vt_* names we now prefix everything that
implements real linux VTs with real_*. An internal flag specifies which
mode the VT is in so we can check whether we are a real VT or a fake one.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This removes both functions and merges them into the callers. They're
small enough to be directly included.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We always open a new VT as there is no need for us to open an existing VT.
Hard-code this behavior but keep the open_tty() backend accepting
VT-numbers just in case we want this some time in the future.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This enum is not needed as the uterm-vt code already has enums for
vt-actions. Replace it with UTERM_VT_ACTIVATE/DEACTIVATE.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This merges both files so we can reduce the code overhead here. This is
still some very old code that was never correctly merged into new
uterm_vt.c subsystem. This should help doing it now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of having a global symbol, we simply move the check to uterm-vt
and can remove it from global namespace. Furthermore, we cache the result
so we can reuse it on the VT-master if required.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The old --seat argument was no implemented, so replace it with --seats
which accepts a list of seats where kmscon runs on. Each seat is separate
from the others but kmscon allows providing terminal services to multiple
users/seats in a single process sharing resources like fonts and
renderers.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The string-list type parses an argument as a list of strings separated
with commas. Empty arguments are accepted and correctly parsed.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of accessing the kmscon configuration from the uterm code, we
should pass it in on creation. Otherwise, uterm depends on main.c which
would be really ugly.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The main configuration is now limited to kmscon and thus should not use
the conf_* prefix. Move all code to use the new name and introduce the new
main.h header mainly for kmscon.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This replaces the global conf-options array with a parameter so we can use
the config parsers with different argument-lists.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
In order to make the conf subsystem more open we need to make all
important symbols visible so others can include them.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The aftercheck logic allows each argument to make adjustments after the
argument-list has been parsed. It is also used to consume remaining
arguments.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
It is not acceptable to start the applications with wrong parameters. A
typo must be corrected before starting the application so simply fail
loudly on errors.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Whether an option takes an argument or not is definitely a property of the
type and not of the option. Therefore, move the flag to the type structure
and remove it from the option structure.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This abstracts the type system of the config parser so other types can be
added without changing the parser itself. This will also be required to
make the conf-subsystem exportable to other users.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This is part of an effort to make the conf-subsystem more friendly for
external users like the tests/* binaries.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This is again a development release. However, the kmscon application is
now at a point where it is quite stable and provides many of the planned
features. API/ABI compatibility is not guaranteed, yet.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
All other subsystems were updated to support multiple video objects. As
last step, the main-handler just has to forward all video objects and
correctly wake them up and put to sleep.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
When removing a video object we also need to remove all displays from the
terminal object. Otherwise, the terminal will still try to draw on the
displays which obviously fails.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Copy and paste error. We obviously should specify the LOG_SUBSYSTEM to be
"ui" and not "config".
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Whoops, obvious typo. We need to free the face if the refcount drops to
zero and not if it is non-zero.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We copy the real attributes into the parent font structure only during
font-creation. However, if multiple renderers run simultaneously, they
might share fonts so we need to copy the attributes when reusing a font,
too.
This fixes a nasty division by zero bug during font rendering.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Internally, the UI subsystem already supports multiple video objects.
However, the public API didn't expose that, yet. This changes the API to
allow adding and removing video objects from the UI.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We used to have a global video object for each terminal. However, this has
all been moved to the UI subsystem which can deal with multiple video
objects simultaneously. Hence, we can remove this as it is no longer used.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds blitting/blending/filling support for devices which are not the
classic xrgb32 device. bpp=24 is not supported as it is still unclear how
3-byte integers look like in mixed/big endian.
This uses a very basic dithering technique to check for errors between the
real and computed values which is then distributed horizontally only.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
udlfb incorrectly reports framebuffer sizes. That is, if we request a
framebuffer twice the size as the real framebuffer for double-bufferring,
it will accept these values and report success. We can even map this
virtual framebuffer successfully! However, the memory that is internally
allocated is only the real smaller framebuffer and we will get segfaults.
This might even leak internal kernel memory so we should fix this on
kernel-side as soon as possible.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This directory and the DejaVu Font is no longer used and replaced with a
proper fontconfig subsystem. There is also another in-memory font in the
8x16 font subsystem so no need to have this one.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>