821 Commits

Author SHA1 Message Date
David Herrmann
6ab227acbd 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>
2012-09-11 18:41:30 +02:00
David Herrmann
a5b4f7df9b 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>
2012-09-11 18:08:00 +02:00
David Herrmann
12db259e6f 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>
2012-09-11 17:59:45 +02:00
David Herrmann
9160194946 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>
2012-09-11 17:31:46 +02:00
David Herrmann
cea022d36e 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>
2012-09-11 16:54:49 +02:00
David Herrmann
246595ab5a 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>
2012-09-11 16:37:30 +02:00
David Herrmann
2534b99d9a 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>
2012-09-11 16:36:41 +02:00
David Herrmann
de9111b40a 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>
2012-09-11 16:34:56 +02:00
David Herrmann
962dfd8bea 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>
2012-09-09 17:36:14 +02:00
David Herrmann
2f6b6a3d07 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>
2012-09-09 16:49:31 +02:00
David Herrmann
9dc589561b 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>
2012-09-09 16:42:34 +02:00
David Herrmann
cf318f710e 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>
2012-09-09 16:14:50 +02:00
David Herrmann
014c468829 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>
2012-09-09 15:01:32 +02:00
David Herrmann
eceaa5ecb8 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>
kmscon-4
2012-09-08 16:21:45 +02:00
David Herrmann
6fb1e5d7b4 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>
2012-09-08 16:21:09 +02:00
David Herrmann
16e292830d 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>
2012-09-08 16:19:49 +02:00
David Herrmann
d84ed347bf 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>
2012-09-08 16:18:19 +02:00
David Herrmann
667f5d16f6 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>
2012-09-08 16:17:04 +02:00
David Herrmann
f8a352f316 Update NEWS file
Add all new functionality to the NEWS file as "kmscon-4" entry.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-08 15:36:23 +02:00
David Herrmann
5d7bdd3584 uterm: vt: be more verbose on errors
Print more information when VT allocation fails.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-08 15:36:02 +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
c3528f1a42 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>
2012-09-08 14:48:21 +02:00
David Herrmann
71b8cfe93c 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>
2012-09-08 14:20:53 +02:00
David Herrmann
0d43751e88 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>
2012-09-08 14:09:09 +02:00
David Herrmann
4250cffd6c 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>
2012-09-08 13:37:02 +02:00
David Herrmann
52c57a51b6 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>
2012-09-08 12:56:37 +02:00
David Herrmann
5da8d6297c 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>
2012-09-07 14:04:32 +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
3baeb6f04a 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>
2012-09-05 19:50:00 +02:00
David Herrmann
2a05b978d3 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>
2012-09-05 19:47:41 +02:00
David Herrmann
2d3166a847 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>
2012-09-05 14:07:03 +02:00
David Herrmann
7ff4426bc3 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>
2012-09-05 14:04:05 +02:00
ysangkok
9754f71c16 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>
2012-09-04 22:12:57 +02:00
David Herrmann
174722b400 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>
2012-09-04 19:10:28 +02:00
David Herrmann
700b12b89d 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>
2012-09-04 19:05:45 +02:00
David Herrmann
5c3bad843c 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>
2012-09-04 18:55:08 +02:00
David Herrmann
facb99b913 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>
2012-09-04 18:42:31 +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
79a07358a9 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>
2012-09-04 18:07:32 +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
720d8d8dfd 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>
2012-09-04 17:56:03 +02:00
David Herrmann
816dcfb148 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>
2012-09-04 17:37:14 +02:00
David Herrmann
69bde6077e 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>
2012-08-31 20:19:55 +02:00
David Herrmann
3386aa955b 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>
2012-08-31 00:00:07 +02:00
David Herrmann
107581b7e4 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>
2012-08-30 23:57:18 +02:00
David Herrmann
fc913dd238 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>
2012-08-29 17:59:21 +02:00
David Herrmann
efce8e1747 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>
2012-08-29 17:56:38 +02:00
David Herrmann
c0047d701a 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>
2012-08-29 17:54:16 +02:00