548 Commits

Author SHA1 Message Date
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
David Herrmann
036ace6227 terminal: create shader only when OpenGL is available
If the video backend does not provide an OpenGL context, there is no need
to create the gl shaders. We then use the 2D blitting functions instead.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 10:27:46 +02:00
David Herrmann
6f76f97e96 terminal: add debug message when removing display
This can help a lot when debugging displays that are registered multiple
times with a terminal object.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 10:27:07 +02:00
David Herrmann
10cb9fdee0 uterm: video_fbdev: fix debug statements
Remove blitting debug statements as it is working fine now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 01:09:40 +02:00
David Herrmann
66e9befde7 uterm: add internal header for blitting support
Whoops, forgot to add it in the fbdev commit. Pushing it now so it works
again.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 01:07:01 +02:00
David Herrmann
771a85a482 uterm: video_drm: set .blit to NULL
We do not support blitting via drm (yet) so set it to NULL explicitely.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 01:06:16 +02:00
David Herrmann
66b7cce2cf uterm: video_fbdev: make double-buffering optional
This makes double-buffering optional as not all drivers provide this. In
fact, only very few drivers implement this. Furthermore, this also adds a
fake display-mode that is used instead of NULL. Otherwise, the screen
object might not work as expected.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 01:04:50 +02:00
David Herrmann
749f653e66 uterm: video: add blitting support
All backends that do not provide OpenGL contexts can not implement buffer
blitting so we can at least draw rectangular areas to the framebuffer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 01:03:56 +02:00
David Herrmann
eec3f2ad85 uterm: add WAKEUP and SLEEP signals
Notify all listeners when going to sleep or waking up. This allows saving
energy in the listeners by not redrawing the screen while being asleep.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 01:01:47 +02:00
David Herrmann
c8fbc14425 uterm: video_fbdev: save stride on open
Copy stride into the fbdev structure so we can use it throughout the code.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-23 22:54:52 +02:00
David Herrmann
8c64daa5df uterm: video_fbdev: test whether bpp is power of 8
I have never seen something different but lets be sure here and test for
modulo-8.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-23 22:52:24 +02:00
David Herrmann
f7e6e1b19b uterm: video_fbdev: remove double check
There is no need to check this twice so move it beyond the last vinfo
modification.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-23 22:46:42 +02:00
David Herrmann
ec46dc2909 uterm: video_fbdev: discard non-xrgb32 devices
We discard all non-xrgb32 devices for simplicity reasons for now. We
definitely need to support other devices in future but that makes the
backend unnecessarily complex at the beginning so avoid it.

This also moves the resolution-change to the beginning and duplicates the
tests so we can be totally sure that everything is right after setting the
correct values.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-23 22:39:48 +02:00
David Herrmann
0ca1256ed5 uterm: video: return -EOPNOTSUPP when opengl is not supported
When the backend does not implement display_use() then we return an error
instead of success to notify the application that it should use blitting
instead.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-23 22:04:06 +02:00
David Herrmann
59f4e84519 uterm: video_fbdev: remove display_use()
fbdev does not support OpenGL contexts so there is no need to implement
this function. Instead, we will provide blitting support later.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-23 21:56:43 +02:00
David Herrmann
ac2ad45270 build: add gtk-doc
This adds gtk-doc documentation builds to kmscon. All documentation is
build in a central place due to gtk-doc restrictions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-23 20:09:19 +02:00
David Herrmann
163a9c9424 eloop: turn comment into non-gtkdoc comment
This comment does not use gtk-doc syntax so remove the extra *.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-23 20:06:44 +02:00
David Herrmann
a36b66cc77 uterm: add fbdev video backend
This adds a fully working fbdev backend to the uterm library. This allows
us to create our rendering pipeline on any linux machine.

The fbdev backend is not yet hooked up into kmscon. There are still some
remaining issues as we do not have OpenGL on fbdev if EGL is not compiled
with fbdev backend (which is usually not).

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-23 18:24:44 +02:00
David Herrmann
b0c19c5c42 console: rewrite console layer
This is a rewrite of the whole console layer so we can remove the
kmscon_buffer object to speed up the console.

This removes the split between the scroll region and the two margins so we
can resize margins in O(1). This also correctly merges the remaining
console modes so vte does not have to track them.

Btw. vim runs smoothly on kmscon with this console layer now (finally!).

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-17 15:53:33 +02:00
David Herrmann
6081905edf fblog: add kernel patches for fblog driver
The fblog drivers provides a replacement for fbcon and prints all kernel
log messages to all available framebuffer devices.

As long as the driver is not upstream, I will keep it here for reference.
See linux-serial@vger.kernel.org for discussion.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-17 00:29:04 +02:00
David Herrmann
cdc7834ba4 vte: allow setting margins
Support changing margin size of the terminal.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 20:49:39 +02:00
David Herrmann
3e6d31e958 vte: fix HUP/HVP positioning bug
We mixed up X/Y coordinates. HUP and HVP send them reversed as often used
in terminals. Anyway, now it works correctly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 20:48:22 +02:00
David Herrmann
469b5c6d7c vte: more verbose SM/RM debug messages
When we receive an unknown SM/RM message, be more verbose about what
exactly was received on the log output.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 20:47:40 +02:00
David Herrmann
7f8788ddc1 vte: add DA support
Send Device attributes as VT220.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 20:41:18 +02:00
David Herrmann
c6f2573499 conf: set TERM by default to vt220
vt220 seems to be the best alternative to "xterm" and should work with
every application.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 20:29:29 +02:00
David Herrmann
f076416fee vte: support cursor positioning CSI
Most of the CSIs for cursor movement are already implemented but HVP and
CUP are missing. This adds both CSI handlers to the VTE layer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 19:42:11 +02:00