David Herrmann [Sat, 16 Jun 2012 22:29:04 +0000 (00:29 +0200)]
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>
David Herrmann [Wed, 30 May 2012 18:49:39 +0000 (20:49 +0200)]
vte: allow setting margins
Support changing margin size of the terminal.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 30 May 2012 18:48:22 +0000 (20:48 +0200)]
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>
David Herrmann [Wed, 30 May 2012 18:47:40 +0000 (20:47 +0200)]
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>
David Herrmann [Wed, 30 May 2012 18:37:33 +0000 (20:37 +0200)]
vte: add DA support
Send Device attributes as VT220.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 30 May 2012 18:29:29 +0000 (20:29 +0200)]
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>
David Herrmann [Wed, 30 May 2012 17:42:11 +0000 (19:42 +0200)]
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>
David Herrmann [Wed, 30 May 2012 17:03:34 +0000 (19:03 +0200)]
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>
David Herrmann [Wed, 30 May 2012 17:02:17 +0000 (19:02 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:58:52 +0000 (18:58 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:53:43 +0000 (18:53 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:52:20 +0000 (18:52 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:48:59 +0000 (18:48 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:19:49 +0000 (18:19 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:19:03 +0000 (18:19 +0200)]
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>
David Herrmann [Wed, 30 May 2012 16:00:06 +0000 (18:00 +0200)]
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>
David Herrmann [Wed, 30 May 2012 15:54:31 +0000 (17:54 +0200)]
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>
David Herrmann [Wed, 30 May 2012 15:44:12 +0000 (17:44 +0200)]
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>
David Herrmann [Wed, 30 May 2012 15:43:36 +0000 (17:43 +0200)]
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>
David Herrmann [Wed, 30 May 2012 15:24:49 +0000 (17:24 +0200)]
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>
David Herrmann [Tue, 29 May 2012 15:16:18 +0000 (17:16 +0200)]
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>
David Herrmann [Tue, 29 May 2012 15:07:53 +0000 (17:07 +0200)]
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>
David Herrmann [Tue, 29 May 2012 14:57:04 +0000 (16:57 +0200)]
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>
David Herrmann [Tue, 29 May 2012 14:20:22 +0000 (16:20 +0200)]
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>
David Herrmann [Tue, 29 May 2012 14:06:03 +0000 (16:06 +0200)]
vte: fix indentation of do_csi()
Use correct indentation for switch/case blocks.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 13:27:50 +0000 (15:27 +0200)]
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>
David Herrmann [Tue, 29 May 2012 13:17:17 +0000 (15:17 +0200)]
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>
David Herrmann [Tue, 29 May 2012 12:39:05 +0000 (14:39 +0200)]
vte: implement DECKPAM and DECKPNM
Both either set or reset the keypad application mode.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 12:35:49 +0000 (14:35 +0200)]
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>
David Herrmann [Tue, 29 May 2012 12:19:52 +0000 (14:19 +0200)]
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>
David Herrmann [Tue, 29 May 2012 12:14:38 +0000 (14:14 +0200)]
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>
David Herrmann [Tue, 29 May 2012 12:08:28 +0000 (14:08 +0200)]
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>
David Herrmann [Tue, 29 May 2012 11:59:19 +0000 (13:59 +0200)]
vte: trivial: fix switch indentation
We use kernel-style switch-case indentation.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 11:52:23 +0000 (13:52 +0200)]
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>
David Herrmann [Tue, 29 May 2012 11:31:33 +0000 (13:31 +0200)]
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>
David Herrmann [Tue, 29 May 2012 11:23:22 +0000 (13:23 +0200)]
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>
David Herrmann [Tue, 29 May 2012 11:18:14 +0000 (13:18 +0200)]
vte: always perform soft reset on DECSCL
All DECSCL modes automatically perform a soft reset.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 11:09:38 +0000 (13:09 +0200)]
vte: add support for GL/GR mappings
This allows mapping different charsets into GL/GR.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 11:06:56 +0000 (13:06 +0200)]
vte: perform soft reset on initialization
Instead of copying all that initialization stuff around, we simply perform
a soft reset on initialization.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 10:46:09 +0000 (12:46 +0200)]
vte: handle XK_Find and XK_Select
Even though modern keyboard often do not include such keys, we should
handle them correctly, anyway. For the sake of backwards-compatibility.
This also comes in handy if you define these keys separately. The
functions that are implemented by many applications with these keys are
handy, indeed.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 10:43:58 +0000 (12:43 +0200)]
vte: move long csi-handlers into separate function
Avoid making do_csi() too big. So put long csi-handlers into separate
functions.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 10:40:01 +0000 (12:40 +0200)]
vte: implement DECSTR / soft-reset
On soft-reset, all internal state is reset but the screen data is kept
alive.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 10:37:18 +0000 (12:37 +0200)]
vte: corectly implement DECSCL
We now select the 8bit/7bit modes if the client sends an DECSCL requesting
a conformance level.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 10:30:17 +0000 (12:30 +0200)]
vte: select CSI flags
Correctly select CSI flags like ?, !, > or $ and more. We actually don't
care about the position of these flags as other CSI parameters are just
digits.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 10:16:18 +0000 (12:16 +0200)]
vte: add kmscon_vte_reset()
This performs a soft reset of the VTE state machine. It does not affect
the console that is bound to the VTE, though.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 10:01:23 +0000 (12:01 +0200)]
vte: support 7bit and 8bit modes
In 7bit and 8bit modes we treat incoming characters as single-byte
characters and map them directly to the corresponding value instead of
using the UTF8 state-machine.
This allows using old non-utf8 applications with this VT. However, default
value is still UTF8-mode and you must explicitely request a conformance
level to change that. If you selected such a mode once, you can only
return to UTF8-mode by performing a soft/hard-reset.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 09:39:07 +0000 (11:39 +0200)]
console: add kmscon_console_reset() dummy
This dummy is supposed to hard-reset the console. As the console is far
from finished, we keep it as dummy and implement this later.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 09:13:49 +0000 (11:13 +0200)]
unicode: introduce kmscon_utf8_mach_reset()
Sometimes we need to reset the UTF8 state-machine, for instance when
resetting the VTE. This function simply resets the internal state to
KMSCON_UTF8_START so we start all over on the next input character.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 09:12:21 +0000 (11:12 +0200)]
build: define KMSCON_ENABLE_DEBUG on --enable-debug
We build several internal libraries and to keep the namespaces apart we
also need different debug constants. Therefore, introduce the new
KMSCON_ENABLE_DEBUG constant which is for every debug object in base
kmscon code.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 29 May 2012 08:27:46 +0000 (10:27 +0200)]
vte: add special character sets
Since vt100 (and extended with vt220) you can load different character
sets into GL and GR. As we use UTF-8 as base encoding, we actually do not
need them but have to support it for backwards compatibility. For further
information, see the comments in vte_charsets.c.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 16:09:12 +0000 (18:09 +0200)]
vte: implement DECSCL 'p' CSI
DECSCL is used to select compatibility modes. We do not support the VT100
compatibility mode explicitely or the VT220 mode, however, we always send
7-bit control characters and support escape sequences from both series so
we can safely ignore DECSCL.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 15:58:46 +0000 (17:58 +0200)]
vte: implement NEL
NEL is a shortcut for newline independent of the line-feed/new-line mode.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 15:56:44 +0000 (17:56 +0200)]
vte: implement IND and RI
IND and RI both either move one row up or down and perform scroll up/down
if required.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 15:51:51 +0000 (17:51 +0200)]
vte: explicitely ignore DEL
Add dummy to do_execute() which explicitely ignores the DEL input.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 15:47:51 +0000 (17:47 +0200)]
vte: show reversed question mark on SUB
When receiving SUB we now correctly write a reversed question mark into
the buffer. We still cancel the ongoing escape sequence, this worked even
without this patch.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 14:49:56 +0000 (16:49 +0200)]
vte: remove kmscon_console_backspace()
This function is not needed at all. Instead, we should simply move one
character to the left on incoming backspace. There is no need to handle
auto-wrap on backspace.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 14:48:08 +0000 (16:48 +0200)]
vte: answer with ACK to an ENQ enquiry
Other emulators might ignore this. However, the easiest way to answer to
an enquiry is probably ACK.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 14:38:56 +0000 (16:38 +0200)]
vte: use callback for outgoing messages
VTE now requires a new callback that is called when we want to send
messages to the pty etc. This is needed if we want to send messages as
responses to incoming data. Otherwise, we would have way too much overhead
assembling composed messages.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 13:39:25 +0000 (15:39 +0200)]
vte: add ctrl+0-9 shortcuts
The VT220 defines some additional shortcuts to send escape codes with
ctrl+<num>. Implement these as aliases to the same well-defined shortcuts.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 13:30:17 +0000 (15:30 +0200)]
vte: handle F1-F20 correctly
F1-F4 are mapped to the keypad keys as these keys were not available on
VT220. F5 is special mapped and F6-F20 correspond to the same keys on the
keyboards for VT220.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 13:18:45 +0000 (15:18 +0200)]
vte: handle KeyPad/NumPad keys
This adds handlers for all the special keys on numpads/keypads.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 13:12:10 +0000 (15:12 +0200)]
vte: add line-feed/new-line mode
In line-feed/new-line mode the NL/.. codes generate a CR *and* a NL.
Otherwise, they only generate CRs.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 12:12:30 +0000 (14:12 +0200)]
vte: implement cursor keys
In cursor-key-mode reset we send the normal CSI sequences, again encoded
with C0 codes as C1 codes are nonsense in UTF8. In cursor-key-mode set we
use the SS3 codes instead.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 12:01:22 +0000 (14:01 +0200)]
vte: implement editing keys
Implement the basic editing keys that are used by several applications. We
use the 7bit CSI sequence to avoid UTF8 issues. Otherwise, we would have
to encode the C1 CSI 0x9b as UTF8 character which is also a 2 byte
sequence.
Besides INSERT, DELETE, PAGEUP and PAGEDOWN an VT220 also had SELECT and
FIND keys which we do not implement as they are not present on modern
keyboards.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 28 May 2012 10:37:12 +0000 (12:37 +0200)]
vte/font/console: support basic character attributes
This adds support for colored and bold characters. This also adds the
infrastrucure for background colors and underlined characters, however,
these are not properly implemented, yet.
The color codes are similar to xterm and optimized on black backgrounds.
So they are not too bright or shiny.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 27 May 2012 14:45:27 +0000 (16:45 +0200)]
vte: send correct escape characters on ctrl+KEY input
This adds support for the ctrl+KEY inputs to send escape sequences to the
child process.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 27 May 2012 14:43:26 +0000 (16:43 +0200)]
uterm_input: introduce UTERM_INPUT_HAS_MODS()
This is a convenient macro to check whether a given set of modifiers is
enabled on the given input event.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 27 May 2012 14:41:19 +0000 (16:41 +0200)]
test_input: always print keysym
Print keysym even if we have a UCS4 representation. This makes debugging
keyboard issues much easier. Also increase buffer size to 32 as there are
many symbols longer than 16 characters.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 27 May 2012 13:21:32 +0000 (15:21 +0200)]
vte: print debug message on unknown CSI parameters
Print a debug message if the CSI-K/J parameters are unknown.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 27 May 2012 12:47:11 +0000 (14:47 +0200)]
vte: remove kmscon_vte_bind()
Bind the console at vte creation instead of dynamically during runtime.
There is no need to rebind a console so remove this complexity.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 27 May 2012 10:08:49 +0000 (12:08 +0200)]
main: start ui on each seat
We now have a video device for each seat so we only need to launch the UI
when the video device is registered.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 27 May 2012 10:04:48 +0000 (12:04 +0200)]
uterm_input: fix increasing refcnt
We need to correctly increase the refcnt. We currently increase it only
when it was 0 before due to a very subtle bug as we missed the "return".
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 20 May 2012 14:35:10 +0000 (17:35 +0300)]
xkb: add a TODO note to kbd_dev_reset stub
This is a small regression whereby starting kmscon with e.g. Caps Lock
already on, will not be reflected in the modifier mask. It's not
currently possible with xkbcommon.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 20 May 2012 14:26:10 +0000 (17:26 +0300)]
xkb: produce key events
Use the new API in kbd_dev_process_key.
This introduces a regression whereby repeating key events are sent for
modifier keys. This is a currently a limitation in xkbcommon.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 20 May 2012 13:29:43 +0000 (16:29 +0300)]
xkb: initialize the xkb objects
The new xkb types correspond quite closely to our own types, which now
become thin wrappers.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 20 May 2012 08:53:26 +0000 (11:53 +0300)]
xkb: remove old xkb code and add stubs
The libxkbcommon API as been revamped completely, making all of the
current code redundant and non-working. This commit removes all of the
old xkb_desc handling before using the new API.
After this commit, kmscon will no longer link to against the old
lixkbcommon; please update to a new package or compile from the
"master" branch from:
git://anongit.freedesktop.org/xorg/lib/libxkbcommon
[ This commit also adds a missing kbd_desc_new, which was declared but
not copied over from the old files. ]
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 May 2012 12:58:53 +0000 (14:58 +0200)]
input: remove old input subsystem
We are no longer using the old subsystem, so remove it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 May 2012 12:57:08 +0000 (14:57 +0200)]
Replace old input subsystem with new uterm input
Use the new subsystem now throughout the whole code.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 20 May 2012 15:15:54 +0000 (18:15 +0300)]
kbd: remove "dev" from kbd_dev_keysym_to_string
Both dumb and xkb don't actually need the kbd_dev for that. The dumb
backend already omits the "dev".
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 20 May 2012 15:26:51 +0000 (18:26 +0300)]
monitor: fix small memory leak
The members of the array returned from get_all_seats are strdup'd as
well.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 May 2012 12:39:25 +0000 (14:39 +0200)]
main: remove old session code
We now run a session on each registered seat so we no longer need the old
session code.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 May 2012 12:34:46 +0000 (14:34 +0200)]
main: allocate one VT per seat
Each session needs a virtual terminal where it operates. Therefore,
allocate one VT per seat so we can react on events on that seat.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 May 2012 12:30:38 +0000 (14:30 +0200)]
vt: fix calling wrong callbacks
If we allocate multiple VTs in a single process, then we share the same
signals which are used to acknowledge VT switches. Instead of blindly
calling the user-callbacks, we need to check first which VT is currently
active to forward the signal only if we are the active VT.
Otherwise, all VTs we allocate share a single logical VT.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 May 2012 11:47:23 +0000 (13:47 +0200)]
main: poll video devices on hotplug
When the monitor notifies us about an hoptplug event, then we need to poll
the current video device. Otherwise, we might miss hotplugged monitors.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 May 2012 11:44:36 +0000 (13:44 +0200)]
main: add input device to each seat
Each seat now collects all input devices that are associated to that seat.
When multi-session support is added, then we can even share them between
the sessions.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 May 2012 11:38:23 +0000 (13:38 +0200)]
main: collect one DRM device per seat
We need a single graphics card on a seat to run kmscon. Therefore, wait
for the first DRM device that appears and make it the current graphics
device for the seat. We do not support multiple graphics cards per seat
but this may be added in the future.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 May 2012 11:16:23 +0000 (13:16 +0200)]
main: create vt master object
When running multiple sessions on multiple seats, we need to allocate
multiple VTs, too. Therefore, we now create a VT master connection in the
main application which we can later use to allocate new VTs for each
session.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 May 2012 11:14:20 +0000 (13:14 +0200)]
main: listen for new seats
Allocate new seat objects when a new seat occurs and remove them when a
seat goes away.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 May 2012 11:02:05 +0000 (13:02 +0200)]
main: use uterm_monitor objects
Create a global uterm_monitor object to monitor the system for new seats
and devices.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 May 2012 05:33:34 +0000 (07:33 +0200)]
uterm_vt: fix correctly passing vt data to callbacks
When emulating the VT layer we need to pass our own data to the internal
callbacks. We currently pass the user data which is really useless here.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 May 2012 05:24:47 +0000 (07:24 +0200)]
test_vt: use new uterm vt master
Use uterm vt master to allocate an VT on seat0 for testing purposes.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 25 May 2012 07:45:20 +0000 (09:45 +0200)]
uterm: add VT API
The uterm VT API is designed to support new user-space implementations of
vt-master APIs. If we are on seat0 and CONFIG_VT is enabled, we use the
kernel VT API. In all other cases we currently simply fall back to a
non-op but will implement in the future dbus based APIs or similar to
support VT switching, that is multi-session, on all seats.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 24 May 2012 17:14:51 +0000 (19:14 +0200)]
vt: add kmscon_vt_supported() function
If the kernel has CONFIG_VT disabled we should avoid opening VTs and
instead rely on other mechanisms for virtual terminals.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 20 May 2012 20:54:08 +0000 (22:54 +0200)]
eloop: fix eloop object never being freed
We must _never_ take a reference to ourself in a constructor. Otherwise,
the refcnt will be >1 which means if the user calls *_unref() the object
will not get freed.
Therefore, do not add the counter object used for idle sources directly to
the event loop. Instead, add it when the first idle source is registered
and remove it when the last source is removed. This will slightly slow
down performance of idle-sources. However, the whole eloop is not
optimized for speed, yet, so we don't care for now.
Reported-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 19 May 2012 15:58:08 +0000 (17:58 +0200)]
eloop: add initial gtk-doc comments
Add gtk-doc compatible comments to most of the functions in eloop.c.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 19 May 2012 11:47:55 +0000 (13:47 +0200)]
eloop: dynamically reallocate dispatch cache
We do not maintain event caches so we must make sure that every event
source gets dispatched. If we call epoll_wait() and our buffer gets
filled everytime, then there might be an event source that does not get
dispatched because it is always above the buffer range. Therefore, we now
dynamically increase the cache size when it once gets filled up.
This gets critical if we handle thousands of clients or fds, however, our
use case is limited to some system resources and hence does not suffer
here.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 19 May 2012 11:33:05 +0000 (13:33 +0200)]
eloop: add more comments
Add comments describing each source and the nesting features.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 19 May 2012 11:07:12 +0000 (13:07 +0200)]
eloop: use counter source for idle events
epoll has the great feature that the poll object is an fd itself. However,
if we want to use idle-sources, we couldn't add them to the epoll set.
Now, we use a counter source for all idle sources so if we add a single
event-loop as source to another event loop, the idle sources will get
dispatched correctly. Furthermore, we now longer block after handling idle
sources but instead now correctly run idle sources every next round
without sleeping for fd events in between.
Unregister idle sources to avoid hogging the CPU.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 19 May 2012 11:05:49 +0000 (13:05 +0200)]
eloop: fix not returning new counter object
We forgot to actually store the pointer to the new counter object in the
\out variable. Fix this now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 19 May 2012 10:47:08 +0000 (12:47 +0200)]
eloop: forward timer HUP and I/O errors to caller
Similar to counter callbacks we now call timer callbacks with 0 as
argument on errors and disable the timer source.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>