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>
Finish source code documentation. gtk-doc isn't working very well so this
probably needs to be re-done, but not now...
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We should check for errors to avoid doing all the rendering even though
the text-renderer already failed. Also print debug messages if specific
intermediate steps fail.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We need to check for errors, otherwise, the text-renderer may be invalid
and we will never be able to render on it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
If the uterm backend supports OpenGL, then we should use the "gltex"
renderer as the "bblit" renderer performs pretty badly on OpenGL displays.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We didn't correctly choose the fallback backend but instead used the
last-registered backend. Fix this.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds an OpenGL text renderer. It uses textures to store glyph
information and renders the characters by assembling a vertex-list first.
To improve performance, we use texture-atlases.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This reworks the text renderer system to make it easier to write backends.
We also allow returning errors during rendering now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We should reset all used vertex-attrib-arrays, otherwise, we have to reset
them before drawing as we cannot sure that some other renderer left them
on.
As a rule we always assume a reset state similar to our assumption that no
VBO is bound during rendering.
This is a quite bad side-effect from OpenGL being a state-machine. As we
are a library, we cannot make any undocumented assumptions about the
OpenGL state. Therefore, we try to be as strict as possible.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This allows configuring the bblit backend during kmscon-build. If other
rendering backends are preferred, you can now compile kmscon without the
bblit backend.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This implements the static 2D blitting callbacks for the DRM backend. It
uses OpenGL to push the images with textures through the rendering
pipeline. Please note that this is horribly slow when used like 2D
blitting. However, it is a safe backend and better than nothing.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We currently return "true" if the hashtable is invalid which is
irritating. Fix this to be "false".
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We need to hash the key instead of the whole entry, otherwise, we have
dead/wrong entries in the hash-table after a rehash-round.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>