518 Commits

Author SHA1 Message Date
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
David Herrmann
815fbe6482 vte: update TODO items
Both flags have been implemented recently so remove the TODO flag in the
comments.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 19:03:34 +02:00
David Herrmann
624d5e0a48 console/vte: draw cursor
If HIDE_CURSOR mode is not set, we draw the cursor at the current
position.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 19:02:17 +02:00
David Herrmann
c1e7a29587 vte: set color to white on cell reset
For the same reason as we reset it to white on cell creation we need to
reset it to white on cell reset. Otherwise we have odd artifacts in
reverse video mode.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 18:58:52 +02:00
David Herrmann
e63491a013 vte: correctly reset console flags on soft reset
We didn't reset the console flags on soft reset, however, this is required
to correctly synchronize the flags between vte and console.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 18:53:43 +02:00
David Herrmann
f311a506dd console: reset font color to white by default
Reset font color to white for new cells. This allows us to draw reversed
cells that are not occupied by any value. Otherwise, these cells would be
still black if reversed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 18:52:20 +02:00
David Herrmann
d17342982b font: draw backgrounds
The pango backend now correctly draws colored or uncolored backgrounds.
This is needed to support drawing cursors.

We currently do not optimize this for performance. In fact, this reduces
performance a lot and we could avoid drawing backgrounds if we cleared the
background to the same color before. However, this also means we currently
could move drawing the background into the console backend again. The
transparency feature is awful, anyway and I don't see any reason
supporting it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 18:48:59 +02:00
David Herrmann
7129a9038c terminal/vte/console: support inverse-screen-mode
In inverse screen mode we switch background and foreground colors. As our
console layer supports transparent backgrounds, we have to do this in the
terminal layer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 18:19:49 +02:00
David Herrmann
2630ee585b console: allow retrieving console flags
This adds a new function that allows external subsystems to retrieve the
current flags of the console.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 18:19:03 +02:00
David Herrmann
320b838644 vte: implement origin mode
Convert the old relative-addressing mode of the console layer into origin
mode flag.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 18:00:06 +02:00
David Herrmann
cce9a5df15 console: allow setting/resetting flags
Instead of writing a function for each mode we now accept flags for the
console object. For now the flags are unused but other flags will be
added.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 17:59:37 +02:00
David Herrmann
6cd591a912 vte: implement local echo mode
If SEND_RECEIVE_MODE is not set, we have to echo all data we send out.
That is, all escape sequences and all characters are directly interpreted
by us. To avoid recursion, we use a simply protection. However, some
escape sequences don't make sense in echo mode but we don't care here, as
this is a problem of the application/client, not us.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 17:44:12 +02:00
David Herrmann
330ae6de09 vte: add ESC+c hard-reset TODO item
ESC+c is a hard-reset and now marked as TODO item.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 17:43:36 +02:00
David Herrmann
230db0eebe vte: ignore unset csi parameters in SM/RM
When reading Setmode/Resetmode parameters, we should ignore all unset
parameters instead of printing a warning.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-30 17:24:49 +02:00
David Herrmann
843bcd3f8a vte: fix up comments
Fix up trivial comments. Remove already realized TODO items and add some
additional TODOs.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 17:16:18 +02:00
David Herrmann
addaa40562 vte: add auto-wrap support
VT510 manual says auto-wrap is disabled by default but most applications
(including bash) expect it to be on, therefore we enable it by default.

The console layer already supported it but the vte layer wasn't hooked up.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 17:07:53 +02:00
David Herrmann
860e7ff509 console: support INSERT mode
When INSERT mode is enabled, we move all following characters to the right
and drop all characters that are moved beyond the margin.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 16:57:04 +02:00
David Herrmann
5f8ca1fd78 vte: set default flags on soft-reset
Instead of clearing all flags we set the default flags now. They are
defined by the VT220 to be set this way on soft-reset.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 16:20:22 +02:00
David Herrmann
e39883610e vte: fix indentation of do_csi()
Use correct indentation for switch/case blocks.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 16:06:03 +02:00
David Herrmann
8f9270822c vte: fix up SM/RM modes
The ANSI and DEC modes overlap so fix up parsing of flags.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 16:05:54 +02:00
David Herrmann
5b84906662 vte: declare all available modes
This adds dummy modes for all available DEC/ANSI modes. This does not
actually implement them but adds support for SM/RM CSI sequences.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 15:17:17 +02:00
David Herrmann
771ca42c16 vte: implement DECKPAM and DECKPNM
Both either set or reset the keypad application mode.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 14:39:05 +02:00
David Herrmann
cc3d8b22a4 vte: implement SM/RM
SM/RM - SetMode/ResetMode are used to explicitely set terminal modes. DEC
private modes and ANSI modes are separated as defined by VT220.

We currently only parse modes that we actually support. Further modes may
follow.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 14:35:49 +02:00
David Herrmann
25b5a7583c vte: implement S7C1T and S8C1T
Both escape sequences are used to change the C1 escape character mode from
using 8bit or 7bit escape codes/sequences.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 14:19:52 +02:00
David Herrmann
a7a51fcb80 vte: set FLAG_USE_C1 when C1-8bit mode is requested
We currently do not support sending C1 controls as 8bit characters because
this doesn't make any sense with UTF-8. However, in 7bit/8bit
compatibility mode the client can request this. As nearly all clients are
backwards compatible to VT100 they also support C1 controls as 7bit
sequences, though, so there is really no time pressure to implement
FLAG_USE_C1.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 14:14:38 +02:00
David Herrmann
71db8be57c vte: implement charset shift in/out
This allows changing GL and GR to the values set in G0-G3. GL can also be
set temporarily, GR currently does not have such a mode.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 14:08:28 +02:00
David Herrmann
5ac6f8c211 vte: trivial: fix switch indentation
We use kernel-style switch-case indentation.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 13:59:19 +02:00
David Herrmann
a2e1ea7388 vte: support designating charsets
With ESC {int} {final} you can designate G0-G3. If no {int} is given, we
fall back to the default escape sequences that replace the C1 set.
However, the user might designate other sets manually so we ignore all
escape sequences that have intermediates set.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 13:52:23 +02:00
David Herrmann
239e7697bb vte: collect csi flags +, ( and )
All three flags are most often used with basic escape sequences and not
with CSI sequences, however, we treat them generic here to avoid more
complexity.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 13:31:33 +02:00
David Herrmann
2ac1aad8c9 vte: support temporary charsets and g0-g3
Temporary charsets are only used for the next graphics character that is
displayed. After that, the VTE returns to the previous charset. On
soft-reset we also reset these temporary slots.

This also adds the g0-g3 backend slots that can be set by the client and
allow mapping of arbitrary other charsets into gl/gr/glr/grt.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 13:23:22 +02:00
David Herrmann
52f55d50c8 vte: always perform soft reset on DECSCL
All DECSCL modes automatically perform a soft reset.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-29 13:18:14 +02:00