platform/upstream/kmscon.git
12 years agotest_output: add --dev parameter
David Herrmann [Sun, 12 Aug 2012 11:30:51 +0000 (13:30 +0200)]
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>
12 years agouterm: monitor: fix crash during device hotplug
David Herrmann [Sun, 12 Aug 2012 11:26:16 +0000 (13:26 +0200)]
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>
12 years agouterm: vt: add fake-vt logic for debugging
David Herrmann [Sun, 12 Aug 2012 09:18:48 +0000 (11:18 +0200)]
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>
12 years agouterm: vt: ignore non-kernel signals in real-mode
David Herrmann [Sun, 12 Aug 2012 08:21:11 +0000 (10:21 +0200)]
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>
12 years agouterm: vt: mark vts as dead during deallocation
David Herrmann [Sun, 12 Aug 2012 08:16:55 +0000 (10:16 +0200)]
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>
12 years agouterm: vt: always register signal handlers
David Herrmann [Sun, 12 Aug 2012 08:11:50 +0000 (10:11 +0200)]
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>
12 years agouterm: vt: rename real VTs internally to real_*
David Herrmann [Sun, 12 Aug 2012 08:03:01 +0000 (10:03 +0200)]
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>
12 years agouterm: vt: remove connect_eloop/disconnect_eloop functions
David Herrmann [Sun, 12 Aug 2012 07:40:49 +0000 (09:40 +0200)]
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>
12 years agouterm: vt: merge uterm_vt and kmscon_vt
David Herrmann [Sun, 12 Aug 2012 07:37:58 +0000 (09:37 +0200)]
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>
12 years agouterm: vt: remove obsolete kmscon_vt_id
David Herrmann [Sun, 12 Aug 2012 07:23:23 +0000 (09:23 +0200)]
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>
12 years agouterm: vt: remove duplicate kmscon_vt_action
David Herrmann [Sun, 12 Aug 2012 07:19:36 +0000 (09:19 +0200)]
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>
12 years agouterm: vt: move all vt.h/c code into uterm_vt.c
David Herrmann [Sun, 12 Aug 2012 07:11:35 +0000 (09:11 +0200)]
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>
12 years agouterm: vt: move kmscon_vt_supported() to uterm-vt
David Herrmann [Sun, 12 Aug 2012 07:04:54 +0000 (09:04 +0200)]
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>
12 years agomain: replace unused --seat argument with --seats
David Herrmann [Sat, 11 Aug 2012 21:42:16 +0000 (23:42 +0200)]
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>
12 years agoconf: add string-list type
David Herrmann [Sat, 11 Aug 2012 21:41:36 +0000 (23:41 +0200)]
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>
12 years agotests: make all tests use the new conf-parsers
David Herrmann [Sat, 11 Aug 2012 20:43:13 +0000 (22:43 +0200)]
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>
12 years agomain: add main.h header
David Herrmann [Sat, 11 Aug 2012 20:42:51 +0000 (22:42 +0200)]
main: add main.h header

Whoops, I missed this in the previous commits. damnit...

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: input: pass xkb parameters from outside
David Herrmann [Sat, 11 Aug 2012 20:41:53 +0000 (22:41 +0200)]
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>
12 years agomain: move conf_global to kmscon_conf in new header main.h
David Herrmann [Sat, 11 Aug 2012 20:01:08 +0000 (22:01 +0200)]
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>
12 years agoconf: make config functions take conf-options as arguments
David Herrmann [Sat, 11 Aug 2012 19:50:41 +0000 (21:50 +0200)]
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>
12 years agoconf: make important symbols global
David Herrmann [Sat, 11 Aug 2012 19:37:32 +0000 (21:37 +0200)]
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>
12 years agoconf: add aftercheck logic
David Herrmann [Sat, 11 Aug 2012 19:32:15 +0000 (21:32 +0200)]
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>
12 years agoconf: be more verbose about wrong arguments
David Herrmann [Sat, 11 Aug 2012 19:11:41 +0000 (21:11 +0200)]
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>
12 years agoconf: make missing arguments or wrong arguments fatal
David Herrmann [Sat, 11 Aug 2012 18:56:41 +0000 (20:56 +0200)]
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>
12 years agoconf: move CONF_HAS_ARG flag to config-types
David Herrmann [Sat, 11 Aug 2012 18:52:17 +0000 (20:52 +0200)]
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>
12 years agoconf: make config types constant
David Herrmann [Sat, 11 Aug 2012 18:51:30 +0000 (20:51 +0200)]
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>
12 years agoconf: make types generic
David Herrmann [Sat, 11 Aug 2012 18:16:38 +0000 (20:16 +0200)]
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>
12 years agoconf: prefix helpers with CONF_*
David Herrmann [Sat, 11 Aug 2012 17:52:11 +0000 (19:52 +0200)]
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>
12 years agoRelease kmscon-3
David Herrmann [Sat, 11 Aug 2012 13:28:34 +0000 (15:28 +0200)]
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>
12 years agoUpdate NEWS file
David Herrmann [Sat, 11 Aug 2012 13:27:56 +0000 (15:27 +0200)]
Update NEWS file

Add information about all changes since kmscon-2.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoUpdate README
David Herrmann [Sat, 11 Aug 2012 13:17:47 +0000 (15:17 +0200)]
Update README

Update dependency and configuration information.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agomain: add support for multiple video objects per seat
David Herrmann [Sat, 11 Aug 2012 12:59:16 +0000 (14:59 +0200)]
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>
12 years agoui: correctly remove all displays when video is removed
David Herrmann [Sat, 11 Aug 2012 12:58:08 +0000 (14:58 +0200)]
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>
12 years agoui: fix log-subsystem
David Herrmann [Sat, 11 Aug 2012 12:55:49 +0000 (14:55 +0200)]
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>
12 years agotext: font: pango/freetype2: fix correctly freeing font faces
David Herrmann [Sat, 11 Aug 2012 12:54:43 +0000 (14:54 +0200)]
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>
12 years agotext: font: freetype2/pango: fix always setting real attributes
David Herrmann [Sat, 11 Aug 2012 12:35:01 +0000 (14:35 +0200)]
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>
12 years agoui: convert API to support multiple video objects
David Herrmann [Sat, 11 Aug 2012 12:09:44 +0000 (14:09 +0200)]
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>
12 years agoterminal: remove global video object
David Herrmann [Sat, 11 Aug 2012 12:01:04 +0000 (14:01 +0200)]
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>
12 years agouterm: video: fbdev: add support for non xrgb32 devices
David Herrmann [Sat, 11 Aug 2012 11:48:44 +0000 (13:48 +0200)]
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>
12 years agotest_output: always use blitting backend
David Herrmann [Sat, 11 Aug 2012 11:21:15 +0000 (13:21 +0200)]
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>
12 years agouterm: fbdev: add udlfb workaround
David Herrmann [Sat, 11 Aug 2012 09:32:55 +0000 (11:32 +0200)]
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>
12 years agoRemove fonts/ directory
David Herrmann [Fri, 10 Aug 2012 16:03:32 +0000 (18:03 +0200)]
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>
12 years agoMove doc/vte.txt to docs/vte.txt
David Herrmann [Fri, 10 Aug 2012 16:02:32 +0000 (18:02 +0200)]
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>
12 years agoeloop: finish documentation
David Herrmann [Fri, 10 Aug 2012 16:01:14 +0000 (18:01 +0200)]
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>
12 years agoconsole: correctly catch text-renderer errors
David Herrmann [Fri, 10 Aug 2012 09:53:25 +0000 (11:53 +0200)]
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>
12 years agoterminal: check for errors when initializing text renderer
David Herrmann [Fri, 10 Aug 2012 09:51:02 +0000 (11:51 +0200)]
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>
12 years agoterminal: choose "gltex" renderer if OpenGL is available
David Herrmann [Fri, 10 Aug 2012 09:49:12 +0000 (11:49 +0200)]
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>
12 years agotext: fix choosing fallback backend
David Herrmann [Fri, 10 Aug 2012 09:48:28 +0000 (11:48 +0200)]
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>
12 years agotext: gltex: add OpenGL text renderer
David Herrmann [Fri, 10 Aug 2012 09:43:07 +0000 (11:43 +0200)]
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>
12 years agotext: rework text renderer system
David Herrmann [Fri, 10 Aug 2012 09:42:00 +0000 (11:42 +0200)]
text: rework text renderer system

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>
12 years agouterm: video: drm: reset vertex-attrib-arrays after use
David Herrmann [Fri, 10 Aug 2012 09:38:42 +0000 (11:38 +0200)]
uterm: video: drm: reset vertex-attrib-arrays after use

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>
12 years agobuild: make bblit backend optional
David Herrmann [Wed, 8 Aug 2012 17:33:34 +0000 (19:33 +0200)]
build: make bblit backend optional

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>
12 years agouterm: video: drm: implement .blit, .blend and .fill callbacks
David Herrmann [Wed, 8 Aug 2012 17:01:53 +0000 (19:01 +0200)]
uterm: video: drm: implement .blit, .blend and .fill callbacks

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>
12 years agogl: add shader helpers
David Herrmann [Wed, 8 Aug 2012 13:32:01 +0000 (15:32 +0200)]
gl: add shader helpers

New helper functions for working with OpenGL shaders.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agomisc: fix returning false in kmscon_hashtable_find() when invalid
David Herrmann [Wed, 8 Aug 2012 13:14:35 +0000 (15:14 +0200)]
misc: fix returning false in kmscon_hashtable_find() when invalid

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>
12 years agomisc: fix rehashing hashtable entries
David Herrmann [Wed, 8 Aug 2012 13:13:49 +0000 (15:13 +0200)]
misc: fix rehashing hashtable entries

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>
12 years agollog: mark llog_format as unused
David Herrmann [Wed, 8 Aug 2012 11:02:44 +0000 (13:02 +0200)]
llog: mark llog_format as unused

Gcc emits useless warnings when llog_format is not used so mark it as
unused.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agostatic: add gl math helpers
David Herrmann [Wed, 8 Aug 2012 10:21:23 +0000 (12:21 +0200)]
static: add gl math helpers

These are the same helpers that were previously removed, however, they are
now part of the static-kmscon library and can be stripped away by the
linker.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agogenshader: make shader generation more flexible
David Herrmann [Wed, 8 Aug 2012 10:13:29 +0000 (12:13 +0200)]
genshader: make shader generation more flexible

The genshader program now takes all input shaders as arguments so we can
easily add new shaders. We also name the constants after the shader file
to be as flexible as possible.

This also moves the generated shaders into the static-kmscon library. The
linker will strip unused symbols, anyway, so we aren't loosing anything
here.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agogl: remove GL subsystem
David Herrmann [Wed, 8 Aug 2012 09:36:51 +0000 (11:36 +0200)]
gl: remove GL subsystem

The GL subsystem is no longer used so we can remove it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoterminal: remove gl.h include
David Herrmann [Wed, 8 Aug 2012 09:28:23 +0000 (11:28 +0200)]
terminal: remove gl.h include

We do not use this header inside of the terminal subsystem so we can
remove it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agofont: remove font.h
David Herrmann [Wed, 8 Aug 2012 09:28:03 +0000 (11:28 +0200)]
font: remove font.h

This header is unused so we can remove it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: move font_char_attr to text.h
David Herrmann [Wed, 8 Aug 2012 09:27:19 +0000 (11:27 +0200)]
text: move font_char_attr to text.h

This way we can now remove all font.h includes. We can rename the
structure later.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: video: drm: adopt new libgbm API
David Herrmann [Wed, 8 Aug 2012 09:21:20 +0000 (11:21 +0200)]
uterm: video: drm: adopt new libgbm API

libgbm changed the API (why?) so we need to use get_stride() instead of
get_pitch().

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoterminal: remove OpenGL drawing stubs
David Herrmann [Wed, 8 Aug 2012 09:20:36 +0000 (11:20 +0200)]
terminal: remove OpenGL drawing stubs

Drawing with OpenGL didn't work, so we can safely remove the stubs.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agomisc: remove log references
David Herrmann [Mon, 6 Aug 2012 17:04:04 +0000 (19:04 +0200)]
misc: remove log references

The static-* code does not depend on the log subsystem so it should not
include the header nor define some internal logging helpers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: bblit: remove unused private data
David Herrmann [Mon, 6 Aug 2012 13:44:41 +0000 (15:44 +0200)]
text: bblit: remove unused private data

The bit-blitting renderer does not really use the helper structure so
remove it and simplify the code a lot.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agobuild: add --disable-optimizations option
David Herrmann [Mon, 6 Aug 2012 13:27:53 +0000 (15:27 +0200)]
build: add --disable-optimizations option

We are in a state where redrawing the console can take a significant
amount of time on slower machines. Therefore, we definitely need gcc code
optimizations which help here a _lot_. However, they are currently bundled
to the debug flags.

This splits this into two options. We still need this flag to get getter
backtraces. Otherwise, those inlined functions are horrible to track done.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoSuppress some odd gcc warnings
David Herrmann [Mon, 6 Aug 2012 13:04:42 +0000 (15:04 +0200)]
Suppress some odd gcc warnings

As gcc is not aware of out list-semantics, it warns about uninitialized
variables when in fact we know that they must be initialized. Suppress
some by initializing the variables to NULL.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: bblit: do not clear screen
David Herrmann [Mon, 6 Aug 2012 12:54:34 +0000 (14:54 +0200)]
text: bblit: do not clear screen

The console layer guarantees that all glyphs are sent to the renderer so
there is no need to clear the screen before redrawing.

This reduces flickering of single-buffered video backends.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: font: Simplify font-system and add freetype2 renderer
David Herrmann [Mon, 6 Aug 2012 12:48:22 +0000 (14:48 +0200)]
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>
12 years agouterm: uxkb: fix typo in (u)xkb_available=false
David Herrmann [Mon, 6 Aug 2012 12:47:12 +0000 (14:47 +0200)]
uterm: uxkb: fix typo in (u)xkb_available=false

When compiling without xkbcommon we currently get compiler errors as the
uxkb_available variable hasn't been correctly renamed previously.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoconf: add "font-engine" option
David Herrmann [Mon, 6 Aug 2012 12:45:03 +0000 (14:45 +0200)]
conf: add "font-engine" option

This option allows to select the font-engine during run-time.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoRemove old font renderer sources
David Herrmann [Wed, 1 Aug 2012 13:42:35 +0000 (15:42 +0200)]
Remove old font renderer sources

font_freetype.c was unused for long and font_pango.c has been removed
recently.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoUse new text renderer
David Herrmann [Wed, 1 Aug 2012 13:41:22 +0000 (15:41 +0200)]
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>
12 years agotext: font: pango: fix memory allocation
David Herrmann [Tue, 31 Jul 2012 14:59:36 +0000 (16:59 +0200)]
text: font: pango: fix memory allocation

Whoops, we were checking the wrong variable. Fix the OOM check to
correctly catch the right errors.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: add bblit text-renderer
David Herrmann [Tue, 31 Jul 2012 14:50:20 +0000 (16:50 +0200)]
text: add bblit text-renderer

The bblit text-renderer is the most basic renderer which simply blits or
blends the glyphs into the framebuffer memory. It cannot be used with
displays that do not provide framebuffer access but only 3D access.
However, 3D rendering is currently broken, anyway, so we can ignore it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: add text renderer subsystem
David Herrmann [Tue, 31 Jul 2012 14:49:32 +0000 (16:49 +0200)]
text: add text renderer subsystem

The text-renderer subsystem provides a way to register arbitrary
text-rendering backends. These backends use the font-objects to draw the
console into a framebuffer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: font: pango: fix font width being 0
David Herrmann [Tue, 31 Jul 2012 14:46:22 +0000 (16:46 +0200)]
text: font: pango: fix font width being 0

We must avoid having a width of zero, otherwise, the text renderers might
divide by zero.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: font: correctly measure pango fonts
David Herrmann [Tue, 31 Jul 2012 14:44:28 +0000 (16:44 +0200)]
text: font: correctly measure pango fonts

We need to actually increase the character count, otherwise, we will never
have a measurement set.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agovte: add CHA CSI
David Herrmann [Tue, 31 Jul 2012 12:57:47 +0000 (14:57 +0200)]
vte: add CHA CSI

The CHA CSI is used to move the cursor horizontally but keep the vertical
position.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agovte: add VPA/VPR CSIs
David Herrmann [Tue, 31 Jul 2012 12:57:04 +0000 (14:57 +0200)]
vte: add VPA/VPR CSIs

VPA and VPR are used to change the current line but keep the column. One
does an absolute positioning and one a relative positioning.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agovte: add SU/SD CSIs
David Herrmann [Tue, 31 Jul 2012 12:56:11 +0000 (14:56 +0200)]
vte: add SU/SD CSIs

SU and SD are used to scroll-up and scroll-down the visible buffer.
Margins are kept and the cursor position does not change. This is a valid
vt510 CSI.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoconsole: add *_console_scroll_up()/_down() helpers
David Herrmann [Tue, 31 Jul 2012 12:54:58 +0000 (14:54 +0200)]
console: add *_console_scroll_up()/_down() helpers

Xterm supports CSIs which simply move the visible buffer up/down so we
need these helpers to perform such operations from the VTE layer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: video: add blend() helper
David Herrmann [Tue, 31 Jul 2012 12:24:45 +0000 (14:24 +0200)]
uterm: video: add blend() helper

When drawing single glyphs we often have the glyph as alpha-only buffer so
we can draw it with any color we want. blit() requires a full image that
can be copied, so the new blend() helper is introduced which takes a
foreground and background color and blends in an image. Only plain-alpha
buffers are currently supported.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: video: fix blit() and fill() height adjustments
David Herrmann [Tue, 31 Jul 2012 11:35:18 +0000 (13:35 +0200)]
uterm: video: fix blit() and fill() height adjustments

Whoops, we missed the last line for all blit()/fill() operations. Fix the
decrement to correctly count as many lines as given.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: video: remove unused UTERM_FORMAT_MONO
David Herrmann [Tue, 31 Jul 2012 11:12:05 +0000 (13:12 +0200)]
uterm: video: remove unused UTERM_FORMAT_MONO

This format is not used, neither implemented, so it is safe to remove the
constant.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: video: remove fbdev_display_map() orphan
David Herrmann [Tue, 31 Jul 2012 08:32:43 +0000 (10:32 +0200)]
uterm: video: remove fbdev_display_map() orphan

The dummy fbdev backend included this function to allow outside access to
the framebuffer. This has for long been replaced with blit() and fill()
helpers and it was never actually implemented. Hence, remove the helper
function.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotest_output: add blitting support
David Herrmann [Tue, 31 Jul 2012 08:31:40 +0000 (10:31 +0200)]
test_output: add blitting support

When opengl rendering is not available on the target device, we now fall
back to software rendering. Instead of drawing a nice gradient we now draw
a white screen to the target device to avoid heavy calculations.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: video: add fill() helper
David Herrmann [Tue, 31 Jul 2012 08:29:52 +0000 (10:29 +0200)]
uterm: video: add fill() helper

When using unaccelerated video we want to be able to fill a region of the
target framebuffer with a solid color. Hence, this adds the fill() helper
function with similar semantics to blit() but it uses a solid RGB color
value to fill in the framebuffers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: video: change blit'ting logic
David Herrmann [Tue, 31 Jul 2012 08:22:39 +0000 (10:22 +0200)]
uterm: video: change blit'ting logic

Instead of passing width/height separately, we now use the values from the
buffer object. The caller has to manipulate the buffer object to change
these values. In fact, they can simply create a buffer object on the stack
with the same values copied from the real buffer and just adjust the
offset, width, height and stride. With the help of the stride value, it is
possible to even shrink the buffer horizontally.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotest_input: fix compilation for kbd_keysym_to_string()
David Herrmann [Tue, 31 Jul 2012 08:01:32 +0000 (10:01 +0200)]
test_input: fix compilation for kbd_keysym_to_string()

Since we moved to a runtime backend system for the input subsystem, we
cannot access the internal keysym_to_string() helpers anymore. Hence, use
the recently introduced uterm-input forwarding helper.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agouterm: input: add uterm_input_keysym_to_string()
David Herrmann [Tue, 31 Jul 2012 08:00:03 +0000 (10:00 +0200)]
uterm: input: add uterm_input_keysym_to_string()

There is no much gain from having an internal kbd_desc_keysym_to_string()
function if we cannot get access to the kbd_desc object. Therefore, add a
forward helper to uterm_input() which forwards the call to its internal
kbd_desc object. This allows outside access to the keysym_to_string()
function.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: font: add pango font backend
David Herrmann [Mon, 30 Jul 2012 15:44:02 +0000 (17:44 +0200)]
text: font: add pango font backend

The pango font backend is similar to the currently used older backend but
provides the new API. It is modular so we can disable it if not needed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: font: replace x/y offsets with baseline attribute
David Herrmann [Mon, 30 Jul 2012 15:42:21 +0000 (17:42 +0200)]
text: font: replace x/y offsets with baseline attribute

When rendering underlines we need the baseline attribute. Therefore,
replace the unused x/y offsets with a baseline attribute.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agobuild: add text-subsystem to build-sources
David Herrmann [Mon, 30 Jul 2012 09:09:57 +0000 (11:09 +0200)]
build: add text-subsystem to build-sources

This finally adds the new font renderers to the build-sources so they are
actually built.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agoexternal: htable: remove config.h inclusion
David Herrmann [Mon, 30 Jul 2012 09:08:55 +0000 (11:08 +0200)]
external: htable: remove config.h inclusion

There is no need to include config.h manually so remove this to avoid
compilation errors when compiling external applications.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: font: Add 8x16 font
David Herrmann [Sat, 28 Jul 2012 14:40:22 +0000 (16:40 +0200)]
text: font: Add 8x16 font

The 8x16 font is a static in-memory font that can be used as safe
fallback. It does not allow scaling or other font decorations so it's
really just for very basic text-layouts.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext: font: add x/y offsets for glyphs
David Herrmann [Sat, 28 Jul 2012 14:37:22 +0000 (16:37 +0200)]
text: font: add x/y offsets for glyphs

A single glyph might be bigger/smaller than the other glyphs so allow them
to be positioned. As we are not interested in details like baselines, we
simply use an x/y offset.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
12 years agotext_font: add new font renderer subsystem
David Herrmann [Sat, 28 Jul 2012 11:12:54 +0000 (13:12 +0200)]
text_font: add new font renderer subsystem

When running as emergency console, we must correctly deal with missing
libraries. Therefore, our font renderers must be modular so if freetype2
is not found we must be able to load another font. Therefore, this
introduces a new font-subsystem which can add/remove font-renderers
on-the-fly.

The real font-renderer backends will follow. This only provides the
modular infrastructure.

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