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>
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>
"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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The "static" library does not have any dependencies. To avoid compilation
errors, remove this inclusion.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
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>
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>
The GNU Unifont project provides a bitmap font with a fixed 8x16/16x16
size. The source is encoded as simple hex-file.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This document contains several special Unicode characters which can be
used to test the terminal font-engine/UTF-8-engine.
Written-by: Theodore Kotz <ted@kotz.us>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
There were 3 problems with previous version:
- it didn't take into account libgbm cflags (fatal error: gbm.h: No such file or directory)
- it was vulnerable to gbm.h include bugs (gbm.h:259:50: error: unknown type name 'size_t')
- it was checked even when libgbm was not detected
Fix it.
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Defining *_la_CPPFLAGS var in "if...endif" block breaks generation
of Makefile.in - automake assumes it's defined unconditionally and
uses it for building objects.
configure.ac clears all variables if each dependency is disabled so we can
include it unconditionally.
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
These messages should have never been committed, oops. Remove them as they
are really not needed.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Mesa 8.1-devel/9.0-devel stopped exposing EGL_KHR_surfaceless_opengl because
it never actually existed and started exposing EGL_KHR_surfaceless_context.
Check that in addition to EGL_KHR_surfaceless_opengl.
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b50703aea55450e04bcd8154335774786e0f253b
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
CC src/static_gl_math.lo
In file included from src/static_gl_math.c:35:0:
src/static_gl.h:36:23: fatal error: GLES2/gl2.h: No such file or directory
CC src/static_gl_shader.lo
src/static_gl_shader.c:36:23: fatal error: GLES2/gl2.h: No such file or directory
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of redrawing on change, we now use a framerate-timer which
redraws the screen. This timer stays active for 1s after the last redraw
so we do not enable/disable the timer while the console is under heavy
work-load. This still needs to be benchmarked but it seems to work nicely.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
If there is plenty data available, we should read all of it before
returning. Otherwise, we might spend too much time letting the other
subsystems perform actions. This can have the effect, that we render after
each read() on the pty if a redraw takes more time than a single frame.
This is definitely not what we want.
To avoid staying here too long we use a hard-coded maximum. Otherwise, if
the vte layer takes longer than the pty-end writes data to us, we might
stay here forever. This is very unlikely as the VTE layer as no immediate
side-effects that make long computations, but we use it to be on the safe
side.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>