platform/upstream/kmscon.git
11 years agoterminal: don't include tsm_unicode.h
David Herrmann [Tue, 18 Sep 2012 11:47:19 +0000 (13:47 +0200)]
terminal: don't include tsm_unicode.h

This is not needed. And we want to avoid any dependencies to this layer
wherever possible.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agotext: pass symbol-data directly into text layer
David Herrmann [Tue, 18 Sep 2012 11:42:22 +0000 (13:42 +0200)]
text: pass symbol-data directly into text layer

Instead of converting symbols into UCS4 string in each backend, we now
pass the whole data from the console layer into the renderers.

This makes all renderers indepedent of any recently introduced
symbol-tables and they can be implemented inside of TSM without exporting
them. However, we still need to pass the IDs to the text layer. The text
layer must not use them for anything but identification. Moreover, it must
never assume that they are valid tsm_symbol_t values.
We do this so the backends can still have fast hashtable lookups rather
than allocating big keys containing the UCS4 string+length and using these
for lookups.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agotsm: unicode: add helper for ucs4->u8 string conversions
David Herrmann [Tue, 18 Sep 2012 11:41:17 +0000 (13:41 +0200)]
tsm: unicode: add helper for ucs4->u8 string conversions

This small helper allocates a string big enough to hold the whole u8
string. This should be used for short and temporary strings only! It
allocates way to much memory for bigger or long-living strings.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agobuild: make xkbcommon built-time dependency
David Herrmann [Tue, 18 Sep 2012 10:25:12 +0000 (12:25 +0200)]
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>
11 years agotsm: unicode: fix error-path in tsm_symbol_append()
David Herrmann [Tue, 18 Sep 2012 10:17:41 +0000 (12:17 +0200)]
tsm: unicode: fix error-path in tsm_symbol_append()

We never checked the memory helpers for errors because they used to be
from glib. However, with our own helpers we need to check for errors to be
sure.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoshl: hashtable: add shl_hashtable_remove() helper
David Herrmann [Tue, 18 Sep 2012 10:14:53 +0000 (12:14 +0200)]
shl: hashtable: add shl_hashtable_remove() helper

This adds a helper that removes entries from a hashtable. This hasn't been
needed, yet, so we never provided it. However, the new unicode-helpers
will need it for proper error recovery.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agotsm: unicode: add symbol-table helpers
David Herrmann [Tue, 18 Sep 2012 10:03:17 +0000 (12:03 +0200)]
tsm: unicode: add symbol-table helpers

Add three helpers to create and manage symbol-tables. Also fix internal
default-table to use them.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agotsm: unicode: merge tsm_symbol_get() into table__get()
David Herrmann [Tue, 18 Sep 2012 09:48:02 +0000 (11:48 +0200)]
tsm: unicode: merge tsm_symbol_get() into table__get()

We do not do locking in tsm anymore so we can remove the table__get()
helper.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agotsm: unicode: export tsm_ucs4_to_utf8()
David Herrmann [Tue, 18 Sep 2012 09:37:59 +0000 (11:37 +0200)]
tsm: unicode: export tsm_ucs4_to_utf8()

This helper function may be useful to other external code and allows us to
always return UCS4 strings. Other code can then use this helper to convert
it into UTF8.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agotsm: unicode: add symbol-table contexts
David Herrmann [Tue, 18 Sep 2012 09:30:38 +0000 (11:30 +0200)]
tsm: unicode: add symbol-table contexts

We should avoid any global state in shared libraries. As the TSM code is
becoming a shared library, we definitely need contexts for symbol tables.
However, we don't want to fix up all code now so we use a default table
NULL instead.

This can be fixed later but is ok for now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agotsm: unicode: remove log_* calls
David Herrmann [Tue, 18 Sep 2012 09:04:50 +0000 (11:04 +0200)]
tsm: unicode: remove log_* calls

The logging-layer is not a dependency of TSM so we cannot use it. It is
also not needed anymore, as the unicode-layer is working pretty well.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agotsm: move unicode.[ch] to tsm_unicode.[ch]
David Herrmann [Tue, 18 Sep 2012 08:54:06 +0000 (10:54 +0200)]
tsm: move unicode.[ch] to tsm_unicode.[ch]

All TSM related files will get the tsm_* prefix so move unicode headers
and sources.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agobuild: move all remaining static_* files to kmscon-core/uterm
David Herrmann [Tue, 18 Sep 2012 08:45:53 +0000 (10:45 +0200)]
build: move all remaining static_* files to kmscon-core/uterm

There is absolutely no need to use kmscon-static anymore so move it into
kmscon-core/uterm as it is used by kmscon-core and libuterm exclusively.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoshl: move kmscon_hook_* to shl
David Herrmann [Tue, 18 Sep 2012 08:36:37 +0000 (10:36 +0200)]
shl: move kmscon_hook_* to shl

This is the last static helper that is moved so as a next step we should
get rid of the "static" library entirely.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agomain: change default font size to 12
David Herrmann [Tue, 18 Sep 2012 07:54:08 +0000 (09:54 +0200)]
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>
11 years agomain: add --font-dpi option
David Herrmann [Tue, 18 Sep 2012 07:50:52 +0000 (09:50 +0200)]
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>
11 years agovte: implement Shift+F4-F20
David Herrmann [Tue, 18 Sep 2012 07:44:27 +0000 (09:44 +0200)]
vte: implement Shift+F4-F20

If Shift is hold while F4 to F20 is pressed, a second parameter is added
to the sent CSI sequence. Implement this according to all other major
terminal emulators. This is no official DEC feature, though.

Thanks to "Etam" for reporting this!

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agovte: fix OSC parser to stop on BEL characters
David Herrmann [Tue, 18 Sep 2012 07:20:31 +0000 (09:20 +0200)]
vte: fix OSC parser to stop on BEL characters

No DEC-VT-manual seems to describe this feature, however, nearly all
terminal emulators stop parsing OSC strings when receiving a BEL
character. So add this to the normal ST character to terminate OSC
strings.

Many thanks to Ran Benita for reporting and investigating into this.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoshl: move llog to shl
David Herrmann [Tue, 18 Sep 2012 07:18:50 +0000 (09:18 +0200)]
shl: move llog to shl

We might argue whether llog should be kept separate, however, shl is a
loose pile of headers and sources so pushing llog into it seems
reasonable.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agovte: send escape sequence when ALT key is held
David Herrmann [Sun, 16 Sep 2012 15:30:03 +0000 (17:30 +0200)]
vte: send escape sequence when ALT key is held

XTerm's altSendsEscape resource controls whether an escape character is
prepended to any output that is generated by keyboard input. We enable it
by default now.

Keyboard handling becomes kind of ugly now in the VTE layer. We should
definitely change this into some kind of lookup table or a more
sophisticated switch() handler in vte_input.c or similar.

Thanks to Tobias Wolf, "Etam" and Ran Benita for reporting this to the
bug-tracker and figuring out how this is correctly handled.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoshl: move timer to shl_timer_*
David Herrmann [Sun, 16 Sep 2012 15:08:21 +0000 (17:08 +0200)]
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>
11 years agoshl: move kmscon_ring_* to shl
David Herrmann [Sun, 16 Sep 2012 07:23:35 +0000 (09:23 +0200)]
shl: move kmscon_ring_* to shl

The ring implementation is only used in one place so move it into SHL to
avoid linking it into all other libraries and applications.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoshl: move kmscon_hashtable to shl
David Herrmann [Sun, 16 Sep 2012 07:13:30 +0000 (09:13 +0200)]
shl: move kmscon_hashtable to shl

This moves the whole hashtable implementation into the SHL library. Now we
can link it only to the applications that really use it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoshl: move kmscon_array_* to shl_array_*
David Herrmann [Sun, 16 Sep 2012 06:51:26 +0000 (08:51 +0200)]
shl: move kmscon_array_* to shl_array_*

This moves all array code into the SHL library and fixes all users.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoshl: move dlist to shl_dlist.h
David Herrmann [Sat, 15 Sep 2012 17:48:38 +0000 (19:48 +0200)]
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>
11 years agoshl: move dlist implementation to shl_dlist_*
David Herrmann [Sat, 15 Sep 2012 17:10:37 +0000 (19:10 +0200)]
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>
11 years agounicode: move KMSCON_UCS4_MAXLEN to TSM_UCS4_MAXLEN
David Herrmann [Fri, 14 Sep 2012 16:31:18 +0000 (18:31 +0200)]
unicode: move KMSCON_UCS4_MAXLEN to TSM_UCS4_MAXLEN

We want to get rid of all non-static kmscon dependencies in TSM so move
this constant.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agounicode: remove KMSCON_UCS4_MAX
David Herrmann [Fri, 14 Sep 2012 16:29:07 +0000 (18:29 +0200)]
unicode: remove KMSCON_UCS4_MAX

We have TSM_UCS4_MAX so use it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agounicode: move kmscon_symbol* to tsm_symbol*
David Herrmann [Fri, 14 Sep 2012 16:26:43 +0000 (18:26 +0200)]
unicode: move kmscon_symbol* to tsm_symbol*

All the unicode helpers are move to TSM so move the symbols, too.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agounicode: inline locking helpers
David Herrmann [Fri, 14 Sep 2012 16:21:37 +0000 (18:21 +0200)]
unicode: inline locking helpers

There is really no need to use these helper functions. Just directly call
the pthread locks.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agounicode: update comments
David Herrmann [Fri, 14 Sep 2012 16:19:15 +0000 (18:19 +0200)]
unicode: update comments

Update all the introduction and documentation comments. Also remove an old
TODO item regarding glib.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agounicode: add description of UTF8-state-machine
David Herrmann [Fri, 14 Sep 2012 16:01:34 +0000 (18:01 +0200)]
unicode: add description of UTF8-state-machine

A short comment on how the UTF8 state machine works and why it does not do
any sophisticated error recovery.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agounicode: add UCS4 constants
David Herrmann [Fri, 14 Sep 2012 16:00:59 +0000 (18:00 +0200)]
unicode: add UCS4 constants

Four helpers that define maximum UCS4 values, invalid values and a
replacement character for unknown values.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agounicode: rename kmscon_utf8_* to tsm_utf8_*
David Herrmann [Fri, 14 Sep 2012 15:18:51 +0000 (17:18 +0200)]
unicode: rename kmscon_utf8_* to tsm_utf8_*

All terminal-emulation code is moved into a new library called "TSM -
Terminal State Machine". So we rename everything to have a separate
namespace.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agouterm: video: add *_display_fake_blend(v) requests
David Herrmann [Wed, 12 Sep 2012 13:23:15 +0000 (15:23 +0200)]
uterm: video: add *_display_fake_blend(v) requests

Instead of requiring to use uterm_screen objects we now add a
fake_blendv() request directly to the display object. We rename it to
"fake_blend" instead of just "blend" so we can later implement real
blending.

This reuses the existing infrastructure. But the fake_blendv is the way to
go so we rename the existing functions to "fake_*" either.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agouterm: add *_swap() and *_use() helpers for displays
David Herrmann [Wed, 12 Sep 2012 13:00:28 +0000 (15:00 +0200)]
uterm: add *_swap() and *_use() helpers for displays

Instead of requiring to use a uterm_screen object we now also add these
helpers to the display directly. This allows to use libuterm without any
screens, which is often useful if no virtual screen are needed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agouterm: video: be more verbose when reading DRM properties
David Herrmann [Wed, 12 Sep 2012 11:40:19 +0000 (13:40 +0200)]
uterm: video: be more verbose when reading DRM properties

The user should be notified what went wrong when DRM properties couldn't
been read. There are also pending patches on the dri-devel ML that fix
reading properties without DRM-master.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agouterm: video: dumb: be more verbose when destroying buffers
David Herrmann [Tue, 11 Sep 2012 18:18:29 +0000 (20:18 +0200)]
uterm: video: dumb: be more verbose when destroying buffers

This call may fail with recent kernel versions as DRM_MASTER is required.
Therefore, print more information so we know what went wrong.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agobuild: fix missing header includes
David Herrmann [Tue, 11 Sep 2012 17:37:35 +0000 (19:37 +0200)]
build: fix missing header includes

"make distcheck" fails as we aren't declaring the headers correctly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agouterm: move uterm_vt to the end
David Herrmann [Tue, 11 Sep 2012 17:33:58 +0000 (19:33 +0200)]
uterm: move uterm_vt to the end

Move uterm_vt to the end of the file to avoid forward declaration of
uterm_input.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agouterm: add uterm_keysyms.h
David Herrmann [Tue, 11 Sep 2012 17:30:26 +0000 (19:30 +0200)]
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>
11 years agouterm: move uterm_internal.h to uterm_input.h
David Herrmann [Tue, 11 Sep 2012 17:16:54 +0000 (19:16 +0200)]
uterm: move uterm_internal.h to uterm_input.h

uterm_internal.h contains only input related content so we can rename it
and remove all the inclusions where it is not needed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agouterm: move internal video-helpers to uterm_video.h
David Herrmann [Tue, 11 Sep 2012 17:11:01 +0000 (19:11 +0200)]
uterm: move internal video-helpers to uterm_video.h

This splits off all video related helpers of the big internal
uterm_internal.h header into uterm_video.h.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agofakevt: remove unused tool
David Herrmann [Tue, 11 Sep 2012 17:03:29 +0000 (19:03 +0200)]
fakevt: remove unused tool

The fakevt tool is no longer used. The same functionality was integrated
into kmscon with the fake-VT uterm_vt backend.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agogenshader: avoid generating source file during configuration
David Herrmann [Tue, 11 Sep 2012 16:46:28 +0000 (18:46 +0200)]
genshader: avoid generating source file during configuration

There is no need to make genshader being generated by configure, anymore.
We used to use @srcdir@ but this was not embedded into Makefile.am. Hence,
we can avoid this and make it build normally.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agobuild: fix gbm_bo_get_stride() upstream bug
David Herrmann [Tue, 11 Sep 2012 16:41:30 +0000 (18:41 +0200)]
build: fix gbm_bo_get_stride() upstream bug

libkms doesn't link to libdrm so our current check for gbm_bo_get_stride()
fails. This has been fixed upstream but distributions still need to pick
it up. Therefore, we simply add the drm libs to our checks. They are
available at this point, anyway.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agobuild: add uterm pkg-config file
David Herrmann [Tue, 11 Sep 2012 16:01:32 +0000 (18:01 +0200)]
build: add uterm pkg-config file

We intend to make libuterm independent of kmscon so it can be used by
other projects. Therefore, add a pkg-config file for easier integration
into other build systems.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agobuild: reorder makefile
David Herrmann [Tue, 11 Sep 2012 15:59:45 +0000 (17:59 +0200)]
build: reorder makefile

This moves the independent libraries to the top as they can be built
without kmscon, too.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoexternal: add xkbcommon-keysyms.h
David Herrmann [Tue, 11 Sep 2012 15:31:46 +0000 (17:31 +0200)]
external: add xkbcommon-keysyms.h

If libxkbcommon is not available on the current platform, we still want to
be able to use the keysyms. We currently do this by depending on xproto
but this is ugly and we want to avoid this.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoeloop: add pkg-config file
David Herrmann [Tue, 11 Sep 2012 14:54:49 +0000 (16:54 +0200)]
eloop: add pkg-config file

The pkg-config file allows other users of libeloop to more easily
configure build-time options for eloop.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoeloop: add pre-cbs
David Herrmann [Tue, 11 Sep 2012 14:37:30 +0000 (16:37 +0200)]
eloop: add pre-cbs

pre-cbs are similar to post-cbs but they are called _before_ the actual
dispatching takes place. It can be used to perform any actions before
going to sleep.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoeloop: call post-cbs on errors during dispatch
David Herrmann [Tue, 11 Sep 2012 14:36:41 +0000 (16:36 +0200)]
eloop: call post-cbs on errors during dispatch

If the dispatch files or is skipped for whatever reason, we should
nevertheless call the post-cbs to avoid any integration errors.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoeloop: fix unregistering post-cbs
David Herrmann [Tue, 11 Sep 2012 14:34:56 +0000 (16:34 +0200)]
eloop: fix unregistering post-cbs

This is obviously a copy/paste error. This fixes the unregistering to
correctly work now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoeloop: fix registering post-cb hooks
David Herrmann [Sun, 9 Sep 2012 15:36:14 +0000 (17:36 +0200)]
eloop: fix registering post-cb hooks

We actually have to register the hook-helper before we can add any hooks.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoeloop: improve idle-source logic
David Herrmann [Sun, 9 Sep 2012 14:49:31 +0000 (16:49 +0200)]
eloop: improve idle-source logic

Instead of using an ev_counter object internally, we now directly create a
new eventfd object. This avoids adding/removing the fd from the epoll-set
constantly when adding/removing idle sources. This should increase
idle-source speed considerably.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agollog: add "d"irect variants
David Herrmann [Sun, 9 Sep 2012 14:42:34 +0000 (16:42 +0200)]
llog: add "d"irect variants

The "d" variants of the log functions take a direct pointer to the llog
helper instead of the parent. This is sometimes used when we have no
parent but still want to log errors.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoeloop: add post-dispatch hook
David Herrmann [Sun, 9 Sep 2012 14:14:50 +0000 (16:14 +0200)]
eloop: add post-dispatch hook

When integrating other event-sources or event-loops into eloop which do
not provide FD-abstractions, we often want to check for specific
conditions before returning from the dispatch-callback or going to sleep.
Therefore, you can now register a post-dispatch-cb and check whether your
alien event source is firing. If it is, simply push an idle-source into
the event-loop and it will fire during the next dispatch without going to
sleep.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoeloop: add ev_eloop_get_fd()
David Herrmann [Sun, 9 Sep 2012 13:01:32 +0000 (15:01 +0200)]
eloop: add ev_eloop_get_fd()

This new helper allows retrieving a single file descriptor which
represents the whole event loop. This is very useful if you want to use
your own event loop in combination with libeloop.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoRelease kmscon-4
David Herrmann [Sat, 8 Sep 2012 14:21:45 +0000 (16:21 +0200)]
Release kmscon-4

This is the first public release. Most major features are implemented and
kmscon works reliably. I use it for real work since several weeks now so I
consider it stable.
Anyway, there is still much to do. The TODO list is long...

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agobuild: fix distcheck errors
David Herrmann [Sat, 8 Sep 2012 14:21:09 +0000 (16:21 +0200)]
build: fix distcheck errors

Correctly include everything in the distribution so distcheck and dist
really work.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agodocs: remove gtkdoc
David Herrmann [Sat, 8 Sep 2012 14:19:49 +0000 (16:19 +0200)]
docs: remove gtkdoc

This never really worked and was horrible to maintain. We need to find
something else for documentation, but we will probably have to do it with
a separate XML file without any generator.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agobuild: fix dbus-loop build
David Herrmann [Sat, 8 Sep 2012 14:18:19 +0000 (16:18 +0200)]
build: fix dbus-loop build

We need to include everything in the distribution and fix the
include-path, otherwise, we might get "distcheck" errors.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agolog: add log_dummyf() helper
David Herrmann [Sat, 8 Sep 2012 14:17:04 +0000 (16:17 +0200)]
log: add log_dummyf() helper

Instead of doing nothing we now pass everything to log_dummyf() if a
logging macro is not enabled. This silences all the "unused variable"
warnings which are really annoying.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoUpdate NEWS file
David Herrmann [Sat, 8 Sep 2012 13:36:23 +0000 (15:36 +0200)]
Update NEWS file

Add all new functionality to the NEWS file as "kmscon-4" entry.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agouterm: vt: be more verbose on errors
David Herrmann [Sat, 8 Sep 2012 13:36:02 +0000 (15:36 +0200)]
uterm: vt: be more verbose on errors

Print more information when VT allocation fails.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agomain: change default font-size to 15
Marcin Slusarz [Sat, 8 Sep 2012 12:57:54 +0000 (14:57 +0200)]
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>
11 years agomain: change default TERM to xterm-256color
David Herrmann [Sat, 8 Sep 2012 12:53:49 +0000 (14:53 +0200)]
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>
11 years agovte: separate color-codes from RGB values
David Herrmann [Sat, 8 Sep 2012 12:48:21 +0000 (14:48 +0200)]
vte: separate color-codes from RGB values

We need to know whether a current attribute was created with a specific
RGB value or whether a vt-color-code was used. This is, because several
affects have to be applied when color-codes are used. For instance, bold
colors are always brightened to simulate "bold".

Therefore, two new fields are added which contain the color-code or -1 if
an RGB value is used. All of this is always applied internally of the VTE
layer so other layers (like the console layer) can be sure, that the RGB
value is always correct and use it.
But the VTE layer needs to keep track of the color-codes so we put them
into the attribute structure.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agovte: make independent of uterm
David Herrmann [Sat, 8 Sep 2012 12:20:53 +0000 (14:20 +0200)]
vte: make independent of uterm

Remove the last reference to uterm structures so we can put the vte layer
into a separate library without any dependency to rendering
infrastructure.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoconsole: make independent of text drawing layer
David Herrmann [Sat, 8 Sep 2012 12:09:09 +0000 (14:09 +0200)]
console: make independent of text drawing layer

We finally want to get rid of any dependencies in the vte/console layer so
we can split it out into a separate library.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoconsole: rename font_char_attr to kmscon_console_attr
David Herrmann [Sat, 8 Sep 2012 11:37:02 +0000 (13:37 +0200)]
console: rename font_char_attr to kmscon_console_attr

This removes this legacy name and also moves the attribute structure into
the console subsystem where it belongs. This currently creates circular
dependencies between text and console layers but we can ignore that for
now and fix it later.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agovte: implement bce-mode (background color erase mode)
David Herrmann [Sat, 8 Sep 2012 10:56:37 +0000 (12:56 +0200)]
vte: implement bce-mode (background color erase mode)

BCE is implemented by all major terminal emulators and activated by
default. If used, then every erase/insert/scroll/delete operation will
redraw the background of the erased/new characters with the current
background color instead of the default background color.

There is currently no way to control this behavior from an application so
you cannot turn it off. However, every terminfo based application can read
whether it is activated from the terminfo database.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agotext: font: pango: fix width calculation off by one
David Herrmann [Fri, 7 Sep 2012 12:04:32 +0000 (14:04 +0200)]
text: font: pango: fix width calculation off by one

When using small glyphs, the pango text renderer used to cut off a pixel
of each glyph. This is due to incorrect rounding in width calculation. To
avoid this, we simply increase each glyph by 1 so it will always have
enough space for the whole data.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoterminal: make shortcuts configurable via command-line
David Herrmann [Wed, 5 Sep 2012 17:50:41 +0000 (19:50 +0200)]
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>
11 years agouterm: input: uxkb: fix compile error in string_to_keysym()
David Herrmann [Wed, 5 Sep 2012 17:50:00 +0000 (19:50 +0200)]
uterm: input: uxkb: fix compile error in string_to_keysym()

Damnit, already pushed and not noticed this bug. Anyway, this fixes the
obvious typo in uxkb module.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agouterm: input: include keysym file from main header
David Herrmann [Wed, 5 Sep 2012 17:47:41 +0000 (19:47 +0200)]
uterm: input: include keysym file from main header

We still depend on xproto during compile time as we need the keysym
definitions. We could simply copy the keysym file but I really want to
wait until xkbcommon is finally released as it includes a keysym header,
too. Then we can simply depend on xkbcommon during build.

However, as we still need a way to perform the other conversion: string to
keysym, we need some hashtable anyway. So we can then also copy the keysym
definitions, too.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoconf: add "grab" config data-type
David Herrmann [Wed, 5 Sep 2012 12:07:03 +0000 (14:07 +0200)]
conf: add "grab" config data-type

Grabs are used to specify keyboard shortcuts so they do not have to be
hardcoded into the binary.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agouterm: input: add string_to_keysym() helper
David Herrmann [Wed, 5 Sep 2012 12:04:05 +0000 (14:04 +0200)]
uterm: input: add string_to_keysym() helper

This new helper can be used to convert a string description of a keysym
into a real keysym. This is required to allow users to configure keyboard
shortcuts and more.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agodocs: add xkbcommon build instructions to README
ysangkok [Fri, 31 Aug 2012 11:27:29 +0000 (14:27 +0300)]
docs: add xkbcommon build instructions to README

libxkbcommon still has no public release so most distributions do not ship
it. This adds short build-instructions for people who still want to test
it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agobuild: make eloop independent of libkmscon-static
David Herrmann [Tue, 4 Sep 2012 17:10:28 +0000 (19:10 +0200)]
build: make eloop independent of libkmscon-static

This removes the nasty dependency to libkmscon-static for libeloop.
Otherwise, we might end up with GLESv2 dependencies here which is really
not what we want.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agostatic: move hook into separate independent header
David Herrmann [Tue, 4 Sep 2012 17:05:45 +0000 (19:05 +0200)]
static: move hook into separate independent header

This makes the hook implementation independent of any other code or header
so you do not have to link to libkmscon-static when using it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agostatic: move dlist into separate independent header
David Herrmann [Tue, 4 Sep 2012 16:55:08 +0000 (18:55 +0200)]
static: move dlist into separate independent header

This creates a new header static_dlist.h which is independent of any other
code. It can be included by other libraries/applications without the need
of linkin to libkmscon-static which reduces a lot overhead.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agoterminal: print debug warning when skipping frames
David Herrmann [Tue, 4 Sep 2012 16:42:31 +0000 (18:42 +0200)]
terminal: print debug warning when skipping frames

If the CPU is too slow to render the console in a decent speed and we have
to skip frames, then we should print warnings if debug mode is on.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agomain: make bbulk renderer the default
David Herrmann [Tue, 4 Sep 2012 16:21:29 +0000 (18:21 +0200)]
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>
11 years agoconsole: add --render-timing parameter
David Herrmann [Tue, 4 Sep 2012 16:16:38 +0000 (18:16 +0200)]
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>
11 years agoconsole: free tab ruler on init-failure
David Herrmann [Tue, 4 Sep 2012 16:07:32 +0000 (18:07 +0200)]
console: free tab ruler on init-failure

When console initialization fails, we need to free the tab-ruler if it was
allocated.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agotext: add bbulk renderer
David Herrmann [Tue, 4 Sep 2012 15:58:37 +0000 (17:58 +0200)]
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>
11 years agouterm: video: greatly enhance performance by special casing
David Herrmann [Tue, 4 Sep 2012 15:54:22 +0000 (17:54 +0200)]
uterm: video: greatly enhance performance by special casing

If we special-case the "src == 0" and "src == 0xff" cases, then we can
avoid all the heavy calculations most of the time. This reduces rendering
time by like 50%.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agodocs: add some pixman-rendering comments
David Herrmann [Tue, 4 Sep 2012 15:37:14 +0000 (17:37 +0200)]
docs: add some pixman-rendering comments

We didn't use pixman for rendering in kmscon. This documents shows some
code how we could do it but also explains why this would not improve
performance.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agopty: improve application data read-path
David Herrmann [Fri, 31 Aug 2012 18:19:55 +0000 (20:19 +0200)]
pty: improve application data read-path

The kernel tty buffer is actually too small to buffer data for 20ms, which
is the time a frame may take in kmscon so we can still get 50 fps.
However, profiling showed that we often read multiple times from the pty.
We can optimize this by increasing the buffer to match the tty internal
buffer.

The kernel internal buffering is currently the only performance slowdown
that we have. That is, the data an application writes while we do a single
rendering is more than the kernel can buffer. Therefore, the application
waits until we read from the pty again. We then wait with redrawing until
the next vblank.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agouterm: video: add vectorized blending
David Herrmann [Thu, 30 Aug 2012 22:00:07 +0000 (00:00 +0200)]
uterm: video: add vectorized blending

Vectorized blending allows pushing multiple blending-requests to the video
hardware at once. This can speed up rendering on 2D devices a lot.
However, the gl-rendering is really just for completeness and shouldn't be
used if performance matters.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agouterm: video: drm: fix running without gles2 stride support
David Herrmann [Thu, 30 Aug 2012 20:29:12 +0000 (22:29 +0200)]
uterm: video: drm: fix running without gles2 stride support

Similar to the gltex renderer we need to work around the missing stride
support in plain gles2. Most drivers provide it but we cannot rely on it.
Therefore, we simply allocate a temporary buffer for it. This horribly
breaks performance, but the 2D blitting via DRM was never fast, anyway.
Don't use it except for testing and debugging.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agotest_vt: fix using correct uterm API
David Herrmann [Wed, 29 Aug 2012 15:59:21 +0000 (17:59 +0200)]
test_vt: fix using correct uterm API

This still uses the old VT API which now fails as we added a new
parameter. As a side-effect, this test will not work if used on a VT-less
system or on a seat without VTs. But we actually don't care, yet, as any
other VT-replacement isn't really production-ready, yet.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agouterm: video: improve blitting performance
David Herrmann [Wed, 29 Aug 2012 15:56:38 +0000 (17:56 +0200)]
uterm: video: improve blitting performance

Turns out gcc didn't optimize this trivial math so we do it by hand. This
reduces the number of divisions per color to 1. This increases performance
by like 15%.

As a second optimization, we replace the division with a left shift, that
is, we divide by 256. Technically, this is wrong as we will get slightly
incorrect results. However, this is hardly noticible by human eye so we
can safely use it. This increases performance by like 20% again.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agomisc: add timer infrastructure
David Herrmann [Wed, 29 Aug 2012 15:54:16 +0000 (17:54 +0200)]
misc: add timer infrastructure

Timers can be used to measure time-delays with microsecond resolution.
This is heavily used for performance-tests and to improve rendering
performance.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agobuild: add GLES2-libraries to kmscon-static
David Herrmann [Wed, 29 Aug 2012 15:51:53 +0000 (17:51 +0200)]
build: add GLES2-libraries to kmscon-static

kmscon-static needs these to build properly. Currently, they are pulled in
via uterm but if it is used without uterm the build will fail.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agomain: add --render-engine option
David Herrmann [Tue, 28 Aug 2012 08:41:33 +0000 (10:41 +0200)]
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>
11 years agogl: shader: do not include uterm.h
David Herrmann [Sun, 26 Aug 2012 16:18:33 +0000 (18:18 +0200)]
gl: shader: do not include uterm.h

The "static" library does not have any dependencies. To avoid compilation
errors, remove this inclusion.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
11 years agotext: font: add unifont backend
Ted Kotz [Sat, 25 Aug 2012 13:49:44 +0000 (15:49 +0200)]
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>
11 years agotext: font: unifont: add genunifont generator
David Herrmann [Sat, 25 Aug 2012 13:36:55 +0000 (15:36 +0200)]
text: font: unifont: add genunifont generator

This new generator converts the unifont hex-encoded data into a C-source
file which then can be compiled statically into the kmscon binary. Please
note that the resulting source file is bigger than 100MB and can take
quite a while to compile.

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