731 Commits

Author SHA1 Message Date
David Herrmann
e1c591a3ef fakevt: add fakevt helper for VT-less systems
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>
2012-08-12 13:35:18 +02:00
David Herrmann
9bce87d564 uterm: vt: fix checking for /dev/tty0 instead of /dev/tty
/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>
2012-08-12 13:31:19 +02:00
David Herrmann
2841558f7c test_output: add --dev parameter
The --dev parameter is used to specify the device that is used for
testing.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-12 13:30:51 +02:00
David Herrmann
d97fc0baf0 uterm: monitor: fix crash during device hotplug
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>
2012-08-12 13:26:16 +02:00
David Herrmann
f084da1852 uterm: vt: add fake-vt logic for debugging
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>
2012-08-12 11:18:48 +02:00
David Herrmann
4f3cd2eecd uterm: vt: ignore non-kernel signals in real-mode
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>
2012-08-12 10:21:11 +02:00
David Herrmann
4c1da1069d uterm: vt: mark vts as dead during deallocation
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>
2012-08-12 10:16:55 +02:00
David Herrmann
4029539cd1 uterm: vt: always register signal handlers
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>
2012-08-12 10:11:50 +02:00
David Herrmann
58eb1e85b9 uterm: vt: rename real VTs internally to real_*
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>
2012-08-12 10:03:01 +02:00
David Herrmann
1f9867e786 uterm: vt: remove connect_eloop/disconnect_eloop functions
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>
2012-08-12 09:40:49 +02:00
David Herrmann
8752fe33af uterm: vt: merge uterm_vt and kmscon_vt
There is no need to use separate structures so merge both into a unified
uterm_vt.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-12 09:37:58 +02:00
David Herrmann
358b6a4ed1 uterm: vt: remove obsolete kmscon_vt_id
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>
2012-08-12 09:23:23 +02:00
David Herrmann
edae24f501 uterm: vt: remove duplicate kmscon_vt_action
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>
2012-08-12 09:19:36 +02:00
David Herrmann
1101a6b5c3 uterm: vt: move all vt.h/c code into uterm_vt.c
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>
2012-08-12 09:11:35 +02:00
David Herrmann
891400ad91 uterm: vt: move kmscon_vt_supported() to uterm-vt
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>
2012-08-12 09:04:54 +02:00
David Herrmann
31188d4c79 main: replace unused --seat argument with --seats
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>
2012-08-11 23:42:16 +02:00
David Herrmann
3d2165a4ba conf: add string-list type
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>
2012-08-11 23:41:36 +02:00
David Herrmann
e20283217b tests: make all tests use the new conf-parsers
This allows the tests to have their own command-line parsers. Finally!

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 22:43:13 +02:00
David Herrmann
0377b96c1a main: add main.h header
Whoops, I missed this in the previous commits. damnit...

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 22:42:51 +02:00
David Herrmann
f4b4bc2ee4 uterm: input: pass xkb parameters from outside
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>
2012-08-11 22:41:53 +02:00
David Herrmann
c9ccc70fcb main: move conf_global to kmscon_conf in new header main.h
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>
2012-08-11 22:02:46 +02:00
David Herrmann
39be24697a conf: make config functions take conf-options as arguments
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>
2012-08-11 21:50:41 +02:00
David Herrmann
09e2c17336 conf: make important symbols global
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>
2012-08-11 21:37:32 +02:00
David Herrmann
c52df82033 conf: add aftercheck logic
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>
2012-08-11 21:32:15 +02:00
David Herrmann
ac6078445f conf: be more verbose about wrong arguments
We didn't handle the case that an argument has a parameter but doesn't
need one.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 21:11:41 +02:00
David Herrmann
28be382019 conf: make missing arguments or wrong arguments fatal
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>
2012-08-11 21:00:03 +02:00
David Herrmann
5c13be3f1d conf: move CONF_HAS_ARG flag to config-types
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>
2012-08-11 20:52:17 +02:00
David Herrmann
c65ac64aa5 conf: make config types constant
Config types are shared so they should never be modified. Hence, make them
constant.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 20:51:30 +02:00
David Herrmann
e80a39b5be conf: make types generic
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>
2012-08-11 20:16:38 +02:00
David Herrmann
d00f61305f conf: prefix helpers with CONF_*
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>
2012-08-11 19:52:11 +02:00
David Herrmann
022209905d Release kmscon-3
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>
kmscon-3
2012-08-11 15:28:34 +02:00
David Herrmann
ac26c0ee2f Update NEWS file
Add information about all changes since kmscon-2.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 15:27:56 +02:00
David Herrmann
ed8c730f99 Update README
Update dependency and configuration information.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 15:17:47 +02:00
David Herrmann
d51a40d090 main: add support for multiple video objects per seat
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>
2012-08-11 14:59:16 +02:00
David Herrmann
8dae4e744c ui: correctly remove all displays when video is removed
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>
2012-08-11 14:58:08 +02:00
David Herrmann
42c177e3cd ui: fix log-subsystem
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>
2012-08-11 14:55:49 +02:00
David Herrmann
d9e7137861 text: font: pango/freetype2: fix correctly freeing font faces
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>
2012-08-11 14:54:43 +02:00
David Herrmann
21092ba70f text: font: freetype2/pango: fix always setting real attributes
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>
2012-08-11 14:35:01 +02:00
David Herrmann
66936a194c ui: convert API to support multiple video objects
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>
2012-08-11 14:09:44 +02:00
David Herrmann
11a4b6c887 terminal: remove global video object
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>
2012-08-11 14:01:04 +02:00
David Herrmann
bed915dfb6 uterm: video: fbdev: add support for non xrgb32 devices
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>
2012-08-11 13:51:10 +02:00
David Herrmann
ea62198b6e test_output: always use blitting backend
This removes the currently non-working OpenGL test and always uses the
blitting functions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 13:21:15 +02:00
David Herrmann
faa12b6a61 uterm: fbdev: add udlfb workaround
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>
2012-08-11 11:32:55 +02:00
David Herrmann
e5dfe1164d Remove fonts/ directory
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>
2012-08-10 18:03:32 +02:00
David Herrmann
7a64adeca9 Move doc/vte.txt to docs/vte.txt
There is really no reason to have _two_ documentation directories.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-10 18:02:32 +02:00
David Herrmann
7ae88d4ed7 eloop: finish documentation
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>
2012-08-10 18:01:14 +02:00
David Herrmann
48d9743be5 console: correctly catch text-renderer errors
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>
2012-08-10 11:53:25 +02:00
David Herrmann
ac8cc08f41 terminal: check for errors when initializing text renderer
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>
2012-08-10 11:51:02 +02:00
David Herrmann
4e9ad1b915 terminal: choose "gltex" renderer if OpenGL is available
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>
2012-08-10 11:49:12 +02:00
David Herrmann
2652637fb9 text: fix choosing fallback backend
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>
2012-08-10 11:48:28 +02:00