573 Commits

Author SHA1 Message Date
David Herrmann
25b81425ef misc: change hashtable compare function to return bool
It really doesn't make sense to expect an integer here as memcmp() and
friends use an integer, too, but in reversed logic. So use bool to avoid
confusion.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 19:29:33 +02:00
David Herrmann
3a1926b081 misc: remove glib dependency
This adds a new drop-in replacement for the glib hashtable implementation.
The hash table can be found at github: github.com/rustyrussel/ccan

It's licensed under the terms of the LGPL and perfect for our
implementation. Please see COPYING for license information.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 19:13:16 +02:00
David Herrmann
6901c1df1b uterm: monitor: make systemd optional
If systemd is not used for multi-seat support, we simply fake-add seat
"seat0" and avoid looking for the "seat" tag. However, if devices still
use ID_SEAT, we still parse it but all other devices are taken for seat0
by default.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 16:43:09 +02:00
David Herrmann
bca8d9d6d7 Add NEWS file
Whenever we do a release, this file will contain all the major changes as
a short list.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 16:31:54 +02:00
David Herrmann
9c74f6d423 build: remove TODO from DIST_EXTRA
The TODO list was moved to github long ago so remove this dead reference.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 16:18:23 +02:00
David Herrmann
b9ce96941b eloop: fix signal creation
The previous fix incorrectly registered new signals always to the last
found signal which is definitely incorrect. Therefore, we now correctly
traverse the list and register new signals as new signals.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 16:17:04 +02:00
David Herrmann
0467a8fce5 uterm: vt: correctly initialize ret to 0
We need to return "true", not "false" if a mode is unknown. Otherwise, we
will block the VT subsystem.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 16:11:10 +02:00
David Herrmann
6d4fd00d3d build: correctly clear GBM/EGL flags
When building without DRM we should correctly clear the GBM and EGL flags.
Otherwise, we will be linking them either way.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 16:09:24 +02:00
David Herrmann
93b0d3e80c eloop: silence gcc warning
Gcc warns about an uninitialized variable (which technically is correct).
However, there is really no way this can really happen. But to make gcc
happy (and to enhance code readability) we now depend on !sig whether the
list-search was successful.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 15:49:36 +02:00
David Herrmann
3b795bbe6a llog: make debug statements produce real code
Instead of defining them to nothing we now produce real code which
evaluates to "void", though. This allows us to use the macros whereever an
rvalue can be used.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 15:47:11 +02:00
David Herrmann
9e5013f51b uterm: vt: silence gcc warning
We initialize the variable to "true" to silence gcc warnings that we might
get an uninitialized variable (which we really cannot get here).

Anyway, in the future, if the number of types may increase, the correct
way to deal with unknown types is returning "true" so do this by default
now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 15:45:54 +02:00
David Herrmann
6356dae1da vte/console: implement CSI 'M' (DL: delete line)
The 'M' CSI mode is used to delete lines. This implements this mode
similar to the "INSERT LINES" CSI.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 15:35:28 +02:00
David Herrmann
ff91998ad8 vte/console: implement CSI mode L (insert line: IL)
The IL CSI ('L') is used to insert a given number of lines at the current
cursor position. All lines below are moved down.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 15:30:23 +02:00
David Herrmann
6786555d17 build: make opengl optional
This removes the mode where we compiled uterm with OpenGL instead of
OpenGLES2 (it was broken anyway) and makes it fully optional now.

gl_shader.h is no longer compiled if OpenGL is not available and provides
dummy helpers instead.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 14:59:43 +02:00
David Herrmann
901f21457f gl: add wrappers for glClear and glClearColor
This helps us moving opengl dependencies into a single source file so we
can easily disable it.

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

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 14:31:50 +02:00
David Herrmann
de02874bf6 uterm: add dumb-drm backend
Nearly all drm drivers provide a GEM/TTM buffer backend called "dumb
buffers". These buffers can simply be mmap'ped like fbdev device so 2D
acceleration is available. This patch adds a backend to uterm-video that
uses these buffers. It is quite similar to the drm backend but removes all
the egl/gl/gles2 dependencies.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 14:28:26 +02:00
David Herrmann
27dbb3fd0e build: rewrite configure.ac
Remove all obsolete code and make it more readable. Nearly all features
can now be configured. However, the code doesn't work correctly if udev or
systemd is removed. That will be fixed soon, though.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-30 19:52:20 +02:00
David Herrmann
7e7ab9c2e5 uterm: monitor: refactor systemd code
Move all systemd dependencies into local helper functions so we can easily
make them optional.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-30 12:53:23 +02:00
David Herrmann
f8f2c49de5 build: move systemd dependencies to libuterm
We use the sd-login library in uterm exclusively so move the dependecy to
libuterm.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-29 13:00:00 +02:00
David Herrmann
c078bbbe95 build: move vt.[hc] to libuterm
The kmscon VT layer is used in libuterm exclusively so build it as part of
it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-29 12:59:25 +02:00
David Herrmann
651d1ed980 uterm: remove libudev.h includes if not needed
All udev-dependencies are now moved into uterm-monitor. This allows us to
easily make udev optional for hotplug-less systems or emergency setups.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-29 12:49:37 +02:00
David Herrmann
5f3fab4974 build: move uterm into shared library
The uterm code was created to allow other applications to easily build new
user-space terminals for linux machines. Therefore, put it into a separate
library and install the header files correctly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-29 12:47:54 +02:00
David Herrmann
0535af0498 build: move eloop into shared library
We use the eloop code in several other projects so move it into a shared
library to allow code-sharing.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-29 12:37:02 +02:00
Ran Benita
ae7f2a58cb xkb: first get keysyms, then update state
This is the correct order, as specified in xkb_state_update_key header
comment.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-29 12:20:27 +02:00
Ran Benita
23eebad85d xkb: only repeat keys when they're supposed to repeat
Support for this was added upstream, we can use it now. This mostly
means that modifiers won't repeat anymore.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-29 12:20:00 +02:00
Ran Benita
44376b8daf xkb: use unicode conversion from xkbcommon
Support for this was added upstream, so we should avoid keeping the
entire conversion table twice in (readonly) memory. The old files are
still used by the dumb backend.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-29 12:19:26 +02:00
David Herrmann
34357d21c4 build: move external sources into libkmscon-static
Move all external sources into this library so we can use them everyone
but also be sure that we can link them statically. We will need this
guarantee later when adding LGPL stuff to libkmscon-static.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 21:15:08 +02:00
David Herrmann
d2a128f7e1 doc: fix header of gtk-doc makefile
It still used the old name. So convert it to use the more general name as
we are building all documentation into one global document.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 21:11:57 +02:00
David Herrmann
24f3ea8496 build: add comments to Makefile.am
Add more comments to Makefile.am to make it more readable.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 21:11:19 +02:00
David Herrmann
89a9ea36ff build: put static_* files into separate library
We now build all small helpers into a separate small library that can be
linked statically into all our others. That is, we don't need to keep
backwards compatibility or anything inside this library.

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

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

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 18:53:46 +02:00
David Herrmann
bbcdbe61bd llop: add default helpers
We often need to return the same message over and over again with the same
return value. Use default log-messages now instead of ignoring the log.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 18:16:12 +02:00
David Herrmann
b09fb35b09 llog: add direct log helpers
Sometimes, the parent object might not be available so we need to pass in
the log-object directly. Use "d" as prefix for those functions and add
variants for the most oftenly used functions.

If you need more direct variants, add them when you introduce the first
user.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 18:15:14 +02:00
David Herrmann
43eb459cf6 eloop: require llog function in eloop-creation
When creating a new eloop object, we now require an lloop function so we
can perform conditional logging.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 17:57:38 +02:00
David Herrmann
65482ff11c build: set LLOG_ENABLE_DEBUG
Set LLOG_ENABLE_DEBUG if debug mode is used.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 17:55:59 +02:00
David Herrmann
35bea2847b log: add link to llog
Add helper function that can be used as llog backend.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 17:55:26 +02:00
David Herrmann
a8f034fcbe llog: add library log helpers
Libraries must never log unconditionally. Otherwise, applications are
unable to disable logging and can get confused. This header contains
helpers to implement conditional logging on context objects inside of
libraries.

It is compatible to the log interface in kmscon apart from the runtime
configuration.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 17:28:31 +02:00
David Herrmann
89f114c700 log: change severities to be identical to kernel sevs
The kernel defines 8 severities. Lets be compatible to these numbers so
our API will not have to be changes in the future.

This also causes LOG_ALERT to be added. It is not used, yet, but may be in
the future.

We also change the parameter type of severities to "unsigned int". Enum
variables can change types if new enums are added. We don't want that so
use a fixed type.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 17:27:16 +02:00
David Herrmann
37ebf53cd5 vte: set AUTO_WRAP mode on reset for console object
We reset all modes but forget to set them on the console object, too. The
AUTO_WRAP mode is the only mode that matters here, so we can ignore the
other modes.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 12:20:18 +02:00
David Herrmann
10969bdc6e uterm: video_drm: set EGL_DISPLAY correctly
We force EGL_DISPLAY to drm now. Otherwise, we might cause segfaults if
the EGL library tries to use the X11 egl-backend.

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

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

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 11:01:25 +02:00
David Herrmann
2d84eaad38 terminal: redraw on wake-up
The drm video backend does automatically blit the framebuffer on wake-up,
however, the fbdev backend does not. Hence, we automatically redraw on
wake-up in the terminal backend now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 10:53:04 +02:00
David Herrmann
325412bc15 terminal: avoid adding displays multiple times
We now enumerate displays on wake-up so we might end up adding a display
twice. This causes the display to be redrawn twice which is nasty so we
avoid it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 10:52:05 +02:00
David Herrmann
2757f1c691 ui: do not modify callback parameters
Other registered callbacks might get confused if we change the parameters.
Hence, we use a static copy for further actions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 10:50:16 +02:00
David Herrmann
5dfba2f3e7 font: support 2D blitting
If OpenGL is not supported, we now allow 2D blitting into the video
framebuffer as alternative to shaders.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 10:32:42 +02:00
David Herrmann
f7b305bc0a video: return -EOPNOTSUPP in video_use without OpenGL
If OpenGL is not supported, we should _not_ return 0. Otherwise, there is
not convenient way to detect this scenario.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 10:31:34 +02:00
David Herrmann
acbef47c5e ui: enumerate displays on wakeup
We might have missed a display when our handler was not registered, yet.
So enumerate these displays on wakeup so we can be sure that we have all
displays registered with the terminal subsystem.

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

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 10:28:40 +02:00