64 Commits

Author SHA1 Message Date
David Herrmann
5117852e75 text: add helpers to (un)load all modules at once
Instead of doing all this in main() we now use the two helpers. This makes
the code much more readable and avoids too many stuff in main().

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-26 22:00:01 +02:00
David Herrmann
f2081c84ee conf: remove uterm depedency
We move the GRAB type into kmscon-main.c to avoid any uterm dependency in
the conf subsystem. It is still open how we can better handle the
key-parser without a valid uterm_input object, but when there will be a
xkbcommon release, we can hopefully add a hard depedency to it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-24 21:57:23 +02:00
David Herrmann
6b500b39e9 main: pick up non-FBDEV_DRM devices without --fbdev
Now that we can differentiate between fbdev-DRM and normal fbdev devices,
we can just pick up the normal fbdev devices by default.

--fbdev now makes kmscon use the FBDEV_DRM devices instead of pure DRM.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-21 14:31:27 +02:00
David Herrmann
69259c8d64 build: make xkbcommon built-time dependency
We really need xkbcommon-keysyms.h for building kmscon/uterm/TSM/etc.
However, the recent fix was ugly and didn't really help. Instead we copy
the keysyms file into external/xkbcommon/ so we can just include the real
xkbcommon files from any source but have a fallback in external/.

Hence, you can still build kmscon without xkbcommon with this fallback,
but this will be removed the first day when xkbcommon sees a public
release.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-18 12:29:06 +02:00
David Herrmann
a34ddc1888 main: change default font size to 12
We changed the PPI value to 96 so the default font size looks abnormally
large now. Reset it to the previous value of 12 so it is more "normal".

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-18 09:54:08 +02:00
David Herrmann
7867c50025 main: add --font-dpi option
This adds a new option to force a global PPI for all fonts. This overrides
per monitor PPI values.
This is useful if monitors do not provide correct PPI values and we want
the same behavior as all other X11 apps (which is 96 PPI forced).

Internally we speak of "Pixels per Inch" as this is more correct. However,
to not confuse users we use the more common term "Dots per Inch".

This also changes the default PPI value from 72 to 96. 96 is the de-facto
default value on linux so we should use it, too.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-18 09:53:12 +02:00
David Herrmann
93c553c1bc shl: move timer to shl_timer_*
This moves the timers to SHL and removes the old static_misc header and
source. They are no longer needed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-16 17:08:21 +02:00
David Herrmann
aed1373bc6 shl: move dlist to shl_dlist.h
Instead of including dlist in the static library, we now move it to SHL.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-15 20:11:00 +02:00
David Herrmann
715e247676 shl: move dlist implementation to shl_dlist_*
Shl (Static helper library) is the new name of all static helpers in
kmscon that might be shared between different applications.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-15 19:10:37 +02:00
David Herrmann
55e37dde77 uterm: add uterm_keysyms.h
We need a copy of xkbcommon-keysyms.h as long as xkbcommon is not included
in all major distributions. We _need_ this build-time dependency,
otherwise, we cannot build the other keyboard backends.

However, requiring xkbcommon as build-time dependency is not a solution as
no major distribution includes it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-11 19:30:26 +02:00
Marcin Slusarz
1060e57a8d main: change default font-size to 15
"10" is really small and not really suited as default value. We currently
do debugging a lot and hence using bigger fonts makes that task a lot more
easy. Furthermore, as a "first impression" people get from kmscon, we want
the font to be at a proper size.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-08 15:08:09 +02:00
David Herrmann
a0c644f3b3 main: change default TERM to xterm-256color
We have added a lot of more xterm functionality so "xterm-256color" should
be the better default value now. It also makes most applications behave
better as they can use improved control sequences.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-08 14:53:49 +02:00
David Herrmann
009d8aa182 terminal: make shortcuts configurable via command-line
This adds command line options to make all currently available keyboard
shortcuts of the terminal layer configurable on the command-line and
config-file.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-05 19:50:41 +02:00
David Herrmann
6bc433dc8b main: make bbulk renderer the default
The bbulk renderer performs like 30% better than the bblit renderer so we
should make it the default.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-04 18:21:29 +02:00
David Herrmann
9a33668923 console: add --render-timing parameter
This parameter makes the console subsystem print rendering-performance
information to the debug log. This can be used to find rendering
bottlenecks and compare each render-engine.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-04 18:16:38 +02:00
David Herrmann
6ae5ddc0e7 text: add bbulk renderer
The bbulk renderer is very similar to the bblit renderer but it assembles
a request-buffer of all characters and then pushes these requests via a
vector-call to the video hardware.
This turns out to increase performance slightly as we do not call into the
video subsystem for every characters but only once.

This renderer can reduce performance when used with partial-redraws (which
are not implemented, yet), so we keep the bblit renderer around.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-04 17:58:37 +02:00
David Herrmann
e1a6437473 main: add --render-engine option
This option allows changing the console renderer during runtime. This is
only useful for debugging. The default choice should be best for all
situations.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-28 10:41:33 +02:00
Ted Kotz
4788267a9c text: font: add unifont backend
This adds a new Unifont font-backend based on the recently added Unifont
data. The backend is disabled by default for 2 reasons:
  - It takes about 5min to compile and needs >1GB of memory on an Intel
    Atom N450
  - License situation is unclear as it is GPL

Written-by: Ted Kotz <ted@kotz.us>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-25 17:04:51 +02:00
David Herrmann
8398f4b0f9 terminal: add --fps to limit framerate
Instead of redrawing on change, we now use a framerate-timer which
redraws the screen. This timer stays active for 1s after the last redraw
so we do not enable/disable the timer while the console is under heavy
work-load. This still needs to be benchmarked but it seems to work nicely.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-21 17:59:02 +02:00
David Herrmann
06d33f6636 uterm: vt: add fake VT via user-input
This actually incorporates the fakevt tool into kmscon. That is, if the
user presses ctrl+mod4+F12, we activate or deactivate the fake VT.

This is for debugging only and needs to be made more configurable. Use it
on your own risk.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-15 09:27:11 +02:00
David Herrmann
2ba0cc5ec2 main: correctly wake up UI subsystem
We must wake up the UI system _after_ wakeing up everything else,
otherwise, they might assume everything else is already up.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-15 09:23:24 +02:00
David Herrmann
dbb589c55b ui: add sleep/awake logic to UI
We need to forward all sleep/awake states to the lower subsystems to avoid
overdoing stuff like rendering an user-input. That is, while being asleep
we shouldn't render and/or do any other user-interaction.

This patch simply adds this logic to the UI subsystem, which, however,
does not to anything useful, yet.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-15 08:54:02 +02:00
David Herrmann
5a24d624ae terminal: add --sb-size to control scrollback buffer size
The new sb-size option specifies the size of the scrollback buffer. Use 0
to disable the scrollback-buffer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-14 17:08:55 +02:00
David Herrmann
4f7188337e main: add --dumb option to control uterm devices
The --dumb option disables hardware-accelerated rendering and instead uses
the dumb-DRM devices.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-14 16:34:28 +02:00
David Herrmann
4a034895c8 main: add font options
This adds two options --font-size and --font-name that can be used to
configure which font is used.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-14 16:29:55 +02:00
David Herrmann
227ada42a2 vte: add --palette=XY to choose color palette
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>
2012-08-14 16:08:30 +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
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
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
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
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
df84e9f217 text: gltex: add OpenGL text renderer
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>
2012-08-10 11:43:07 +02:00
David Herrmann
0fee19a8c0 text: font: Simplify font-system and add freetype2 renderer
The freetype2 renderer uses ft2 and fontconfig to provide a very
simplistic renderer. We also simplify the logic of the whole subsystem a
lot and guarantee that each glyph will have the same size now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-06 14:48:22 +02:00
David Herrmann
5517fa16bd Use new text renderer
This fixes the console and terminal layer to use the new text renderer
instead of the old one.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-01 15:41:22 +02:00
David Herrmann
741b8d33df Refactor input backend-system
This is a rewrite of the input system. The backends itself are not
modified. However, it is now possible to have multiple backends and change
them on runtime.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-21 19:06:50 +02:00
David Herrmann
dd68e97016 conf: add config-file parser
This again refactors the whole config subsystem but this should be the
last time. We now have generic parsers for booleans and strings and don't
leak any memory, anymore. Furthermore, this adds a config-file parser so
common options can now be placed into /etc/kmscon.conf or ~/.kmscon.conf.

The config files parse the same arguments as the command-line and the
command-line always has precedence even though it is parsed first.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-17 22:47:15 +02:00
David Herrmann
ffd543f41d main: use UTERM_VIDEO_DUMB as fallback when DRM is not available
If the uterm video object fails to initialize the DRM device, then we try
again with the dumb device. Only if both devices fail, we drop the device
and continue.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 14:31:50 +02:00
David Herrmann
f1326b2728 static: move statically linked subsystems to static_*
Small stuff that is not worth putting into a separate library is no moved
into the "static" library which is statically linked into all our
subsystems.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 20:35:22 +02:00
David Herrmann
0f19a8496d eloop: move to llog
Move every use of log_* to llog_* and make all objects aware of llog
objects.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 18:53:46 +02:00
David Herrmann
4fb2f85f67 main: use --fbdev options to switch between DRM/fbdev
The new --fbdev option allows runtime switching between the two backends.
That is, we only use fbdev devices when --fbdev is given. Otherwise, DRM
is used.

Technically, it would also be possible to use both. However, almost every
DRM device does also register an fbdev device for backwards compatibility.
Therefore, we must avoid using both, the DRM and fbdev device of the same
display at the same time. As this would also mean dealing with failures in
one backend and then switching to the other, we avoid this for complexity
reasons. Who needs fbdev and drm simultaneously, anyway?

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 11:01:25 +02:00
David Herrmann
148655bb7d main: do not depend on OpenGL
We currently try activating the OpenGL context when adding a video device
to a seat. However, not all video backends provide OpenGL contexts so
remove this restriction. The terminal subsystem does all this by itself
now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 10:28:40 +02:00
David Herrmann
a1b2202ccf main: start ui on each seat
We now have a video device for each seat so we only need to launch the UI
when the video device is registered.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-27 12:08:49 +02:00
David Herrmann
4f0defca3f input: remove old input subsystem
We are no longer using the old subsystem, so remove it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 14:58:53 +02:00
David Herrmann
8af8f47143 main: remove old session code
We now run a session on each registered seat so we no longer need the old
session code.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 14:39:25 +02:00
David Herrmann
7107550fd4 main: allocate one VT per seat
Each session needs a virtual terminal where it operates. Therefore,
allocate one VT per seat so we can react on events on that seat.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 14:34:46 +02:00
David Herrmann
625ae94daa main: poll video devices on hotplug
When the monitor notifies us about an hoptplug event, then we need to poll
the current video device. Otherwise, we might miss hotplugged monitors.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 13:47:23 +02:00
David Herrmann
3ac89ed33f main: add input device to each seat
Each seat now collects all input devices that are associated to that seat.
When multi-session support is added, then we can even share them between
the sessions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 13:44:36 +02:00
David Herrmann
42de147268 main: collect one DRM device per seat
We need a single graphics card on a seat to run kmscon. Therefore, wait
for the first DRM device that appears and make it the current graphics
device for the seat. We do not support multiple graphics cards per seat
but this may be added in the future.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-26 13:38:23 +02:00