David Herrmann [Sun, 1 Jan 2012 22:26:10 +0000 (23:26 +0100)]
Avoid installing doc files with "make install"
Move all documentation into EXTRA_DIST, otherwise it gets installed systemwide.
And probably no one is interested in having the README installed in the system.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 22:19:40 +0000 (23:19 +0100)]
configure: fix debug option NDEBUG definition
We currently define NDEBUG only if --<set>-debug is not specified at all. That
is, --disable-debug currently has almost no effect.
This fixes this bug and also corrects a wrong parenthesis.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 22:11:48 +0000 (23:11 +0100)]
font: add unfinished freetype backend
This is a first attempt of a freetype2 backend for the font drawing functions.
This avoids the heavy pango/cairo dependencies, although, we might lose
important font handling that pango does for us like correctly drawing combined
characters.
This is still a stub implementation. The drawing operations are not supported,
yet. Use --enable-pango during configure to enable the still working pango
backend.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 22:04:13 +0000 (23:04 +0100)]
Update TODO
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 17:27:09 +0000 (18:27 +0100)]
font: move font handling into new subsystem
We use a new font factory which is used to create a new font. It will later also
be used to cache fonts and select proper system fonts.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 16:45:57 +0000 (17:45 +0100)]
Remove kmscon_char implementation
It was superceded by kmscon_symbol_t and is no longer used.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 16:43:57 +0000 (17:43 +0100)]
Adjust all code to use new kmscon_symbol_t
This is a big performance boost and reduces the code size quite a bit.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 16:42:57 +0000 (17:42 +0100)]
unicode: provide utf8 converter
Allow converting a ucs4 string into a utf8 string. Also export the default
symbol so other subsystems may use it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 15:52:30 +0000 (16:52 +0100)]
test_buffer: add kmscon_symbol_t test
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 1 Jan 2012 15:47:06 +0000 (16:47 +0100)]
Add faster kmscon_char replacement
Instead of allocating big buffers with kmscon_char's for every character we now
reduce a single character to an integer. This integer is either the Unicode
codepoint or an ID to an internally allocated string.
The so called kmscon_symbol_t integer can now be used as if it were a classic
"char" value without bothering with combining marks etc.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 16:38:46 +0000 (17:38 +0100)]
test_terminal: add experimental input support
Add input subsystem to terminal test app. This currently allows to actually
"write" to the console. There is still much to do to convert the input to proper
data but basic alphanumeric characters work for now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 16:38:17 +0000 (17:38 +0100)]
console: add UCS4 to UTF8 conversion
Allow to create new kmscon_char objects with UCS4 input.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 30 Dec 2011 21:08:42 +0000 (23:08 +0200)]
Update TODO regarding input subsystem
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 30 Dec 2011 20:48:46 +0000 (22:48 +0200)]
input: define our own modifiers
Just a direct mapping to X modifiers for now (= Shift, Control,
Lock, Mod1-5).
This gives us more flexibility to adapt it to our needs in the future.
Also we don't have to include libxkbcommon headers just for the modifier
definitions.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 30 Dec 2011 20:00:07 +0000 (22:00 +0200)]
input: don't use 0 to signal lack of unicode value
0 is actually a valid unicode value, so instead we use
KMSCON_INPUT_INVALID which is not legal unicode.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 30 Dec 2011 16:46:20 +0000 (18:46 +0200)]
input: shuffle headers and includes
Just some renames/moving/prefixing to conform to the style of the
other files.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 30 Dec 2011 16:06:32 +0000 (18:06 +0200)]
Correctly set Xlib copyright headers
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Thu, 29 Dec 2011 19:46:56 +0000 (21:46 +0200)]
xkb: fix group wrapping
- Use the number of groups we actually have instead of the maximum
number of groups, when wrapping according to group_wrap control.
- Be careful with negative relative group actions. The group fields of
xkb_state are all unsigned (and have a weird FIXME..), so don't use
them directly.
- Add the grp:ctrl_shift_toggle option to the rmlvo set to also test
locking the previous group (i.e. a negative relative group action).
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Wed, 28 Dec 2011 20:05:47 +0000 (22:05 +0200)]
xkb: refactor keysym compat_init into a separate function
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Wed, 28 Dec 2011 19:43:55 +0000 (21:43 +0200)]
input: fix formatting
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 15:24:14 +0000 (16:24 +0100)]
input: fix open() call parameters
Third argument of open() is for file creation flags and nor for file open flags.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Wed, 28 Dec 2011 09:55:50 +0000 (11:55 +0200)]
xkb: latches were not always released correctly
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Wed, 28 Dec 2011 09:55:11 +0000 (11:55 +0200)]
xkb: filter unwanted repeats
We can disable repeats globally or per-key. Also any modifier
keys should not repeat.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 27 Dec 2011 21:07:26 +0000 (23:07 +0200)]
xkb: comment out LevelOneOnly handling
Stuff like grp:ctrl_shift_toggle didn't work because of it.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 27 Dec 2011 15:28:16 +0000 (17:28 +0200)]
input: use libxkbcommon to convert input events
This commit introduces a new kmscon_input_event structure which is
delivered to the input consumer. The information provided is
- The evdev scancode (=physical keyboard key).
- The X keysym (a symbol representing what the typist really intended).
- The active modifiers (e.g. Shift, Control..)
- The unicode (UCS-4) value, when it makes sense.
To achieve this we add two dependencies:
- libxkbcommon (this entails xproto and kbproto, but shouldn't bring any of
big X dependencies)
- A function to translate keysyms to unicode values (taken from xlib,
copied in-tree).
libxkbcommon is not an all-around solution, and requires various degrees
of supporting code, depending on how much we wish to support. This
commit implements the common, basic uses:
- Choosing layouts, variants and options
- Switching groups
- Switching shift-levels
- Setting modifiers
Though some stuff is missing. Further information in the comments.
test_input.c is updated to use the new input event interface. You can
change the layouts in input.c:init_input() and see what works and what
doesn't.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 11:46:15 +0000 (12:46 +0100)]
Add Ran Benita to authors list
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 11:44:10 +0000 (12:44 +0100)]
input: do not take reference of parent input object
This is currently broken, anyway as we do not unref the object. However, if we
take a reference, then kmscon_input_unref() would never destroy the object as
there are still references. The caller would have to call kmscon_input_sleep()
first to have the desired effect.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 11:39:42 +0000 (12:39 +0100)]
input: silently ignore devices without device-node
We either need to adjust our filters to only receive inputX/eventY events or we
simply ignore all other events silently to avoid useless warnings.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 13 Dec 2011 12:10:01 +0000 (14:10 +0200)]
tests: add test for the input subsystem
It should:
- Capture your keypresses
- Announce when a device is added or removed (with --enable-debug)
- stop/start capturing on SIGQUIT (Ctrl-\)
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 31 Dec 2011 11:04:17 +0000 (12:04 +0100)]
input: rearrange code to avoid forward declarations
The diff may look a bit wild but this mostly fixes coding style issues:
- sort includes alphabetically
- add missing includes
- rearrange structures/functions to avoid forward declarations
- adding "data" user-defineable field to input structure (for callbacks)
- correctly handle errors in device_data_arrived
- remove device_added/device_removed
- merge input_init into constructor
- add some log messages for debugging
- remove devices when wake-up fails
- set cb/data fields on eloop connection, not on initialization
- remove all devices when disconnecting eloop so the eloop is guaranteed to be
not used by the input subsystem after disconnection.
- some error handling fixes
- remove some TODOs which are correctly implemented
- Add O_NONBLOCK when opening the device node (I don't know how it actually
worked without it in the data_arrived callback)
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Tue, 13 Dec 2011 12:00:44 +0000 (14:00 +0200)]
input: add infrastructure for an input subsystem
This does all the boring stuff for an input subsystem:
- Input device discovery using udev
- Input device hotplug (add/remove)
- Reading the evdev data from the devices
- Publishing input events to a callback through the eloop
- Suspending and resuming the input capture
Currently the delivered input events are basically just evdev's
"struct input_event" (type, code, value). More work is required to
have it pass out useful data.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 17:01:00 +0000 (18:01 +0100)]
terminal: add dummy terminal implementation
vte: This adds a dummy VTE subsystem. It will be used to emulate a vt100
terminal based on our console subsystem.
terminal: This ties together several subsystems including the output-, the
console- and the vte-subsystem.
The test_terminal test application can be used to test the terminal. It is
supposed to provide a full vt100 implementation which is displayed on all
available screens.
Most of the functionality here is not implemented yet and only a dummy function.
These will be added in later commits.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 16:13:15 +0000 (17:13 +0100)]
output: add debug and error messages
Print useful debug and error messages to the global log file.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 16:08:01 +0000 (17:08 +0100)]
console: fix debug messages for buffer objects
It doesn't make sense to print the size of new buffer objects as the resize
function does the same. We also currently access uninitialized memory here so it
is useless anyway.
Also move the message of the unref function to be consistent with other objects.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 15:48:20 +0000 (16:48 +0100)]
test_console: fix call to kmscon_comp*_use
We should activate the GL context on initialization to allow other subsystems to
create GL objects.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 15:44:28 +0000 (16:44 +0100)]
test_output: handle kmscon_comp*_use failure
Move the call before the wakeup and also check its return code.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 15:40:49 +0000 (16:40 +0100)]
output: allow kmscon_compositor_use to be called when asleep
There is no reason to prohibit a compositor from activating its GL context while
being asleep. It is even recommended to activate the GL context when being
asleep as there is no other way to initialize other subsystems without an GL
context.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 15:36:48 +0000 (16:36 +0100)]
output: fix dropping master priviledges on wakeup
If wakeup fails we should drop master priviledges again, otherwise we might
break other applications.
Also remove the SetMaster call on compositor initialization. It is redundant and
not needed by us.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 30 Dec 2011 12:47:36 +0000 (13:47 +0100)]
vt: fix race-condition in signal handling
Currently, we set up our VT with SIGUSR1/2 signals and after that the user may
connect the signal handlers to the eloop. However, if we receive a signal in
between, the signal gets lost.
Therefore, this simply merges the kmscon_vt_connect_eloop function into
kmscon_vt_open as there is no obvious reason to split them.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 26 Dec 2011 20:30:37 +0000 (21:30 +0100)]
output: add helper to check whether output is awake
If we have only an output but not the related compositor we currently cannot
figure out whether this output is awake. This adds such a helper function.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 26 Dec 2011 13:46:22 +0000 (14:46 +0100)]
test_console: fix console deinitialization bug
We must not destroy the compositor object if there is still a console using the
GL context. Otherwise we get a SEGFAULT when calling any gl* function.
In future we may need propoper dependencies here. We use reference counts so
this should be easy to implement.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 26 Dec 2011 13:27:03 +0000 (14:27 +0100)]
test_console: copy stdin to console output
Add new fd to eloop that copies stdin to console output.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 26 Dec 2011 13:24:31 +0000 (14:24 +0100)]
console: add newline function
kmscon_console_newline() can be used to produce a newline. Writing \n doesn't
work as this would write \n as character into the cell and not produce a
newline.
The console does not perform any parsing so we provide a separate function.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 26 Dec 2011 12:59:50 +0000 (13:59 +0100)]
Update TODO
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 26 Dec 2011 11:48:36 +0000 (12:48 +0100)]
console: remove +1 font width
This was to avoid rounding errors but seems to be useless now so remove it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 26 Dec 2011 11:45:54 +0000 (12:45 +0100)]
console: calculate width by font
Remove the *_set_res() function entirely. Instead, the *_resize() function now
accepts a height argument which is used as quality hint. Internally, we compute
the texture width by the selected font plus the given height. This simplifies
the API and the internal handling and improves output on non-standard
resolutions or with non-standard fonts.
Until now it was only optimized for my 16x9 output but 5x4 output was quite
garbled.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 26 Dec 2011 11:15:48 +0000 (12:15 +0100)]
console: do not resize buffer if size doesn't change
We shouldn't do anything if buffer_resize is called with the same size. This
also suppresses useless "buffer resized to XxY" debug messages.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 24 Dec 2011 11:46:56 +0000 (12:46 +0100)]
console: measure font width
When creating a new font we automatically measure the average width of a
character. This allows us to draw fonts even on weird resolutions.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 24 Dec 2011 11:30:42 +0000 (12:30 +0100)]
console: do not return NULL in kmscon_char_get_u8
A kmscon_char has always a valid buffer so we can always return a valid pointer.
The user shouldn't use it if length is 0 but it's not our job to prohibit that.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 21 Dec 2011 15:39:51 +0000 (16:39 +0100)]
console: allow resizing the console
Forward resizing requests to the buffer but correctly update our size cache and
the cursor position.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 21 Dec 2011 15:30:06 +0000 (16:30 +0100)]
console: support writing to console
Add kmscon_console_write() to write a character to the current position of the
cursor. The cursor is automatically moved to the next cell.
Also extend the test_console example to use this new function.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 21 Dec 2011 15:07:40 +0000 (16:07 +0100)]
console: correctly resize lines
When resizing lines we shouldn't drop all information. Instead we only
initialize new cells.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 21 Dec 2011 14:44:24 +0000 (15:44 +0100)]
test_buffer: add buffer playground
This test app is used to stress test the buffer implementation and finding bugs
of the scrollback-buffer rotations etc.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 21 Dec 2011 13:19:52 +0000 (14:19 +0100)]
console: rewrite buffer implementation
We now use a proper cache for the current screen and a linked list for the
scrollback buffer. This allows fast rotations and fast access.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 20 Dec 2011 20:40:35 +0000 (21:40 +0100)]
console: remove cairo from header
There is no reason to make all tests/* apps need cairo dependencies. We pass
this parameter internally so we can safely use void*.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 18 Dec 2011 12:49:03 +0000 (13:49 +0100)]
console: correctly set current position in buffer
Our scrollback buffer needs to adjust the current position when being resized or
when a new line is pushed.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 18 Dec 2011 11:58:47 +0000 (12:58 +0100)]
console: use new buffer implementation
Use the new kmscon_buffer in the console subsystem.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 18 Dec 2011 11:23:14 +0000 (12:23 +0100)]
console: remove buffer cache
Unless we benchmark the buffer implementation we shouldn't implement
speedup-hacks. Therefore, remove the buffer-cache and look how it works out.
This simplifies buffer handling alot.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 18 Dec 2011 10:46:08 +0000 (11:46 +0100)]
console: allow resetting of kmscon_char's
Resetting a char should never fail so we provide a separate function that sets a
char to its default value.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 14 Dec 2011 17:09:03 +0000 (18:09 +0100)]
Add config.h.in~ to gitignore
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Mon, 12 Dec 2011 20:37:07 +0000 (22:37 +0200)]
build: set in NDEBUG instead of DEBUG in configure
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sat, 10 Dec 2011 23:56:48 +0000 (01:56 +0200)]
vt: add support for automatic VT switching
Add two functions to enter/leave our VT object. This allows to
implement to expected behavior of automatically switching to the kmscon
when it is running on a new tty, and switching back to the tty we came
from when the program finishes. Presumably this behavior will be
controlled by a config variable or command line argument later on (like
Xorg's -novtswitch).
There's a bit of a subtlety in this because of VT_PROCESS. We need
permission from ourselves to switch in/out of out VT; this is done when
processing SIGUSR[12] in the eloop. We therefore must dispatch the loop
at least once after switching out. The usual case is demonstrated in
test_vt.c.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 14 Dec 2011 14:38:26 +0000 (15:38 +0100)]
Add K_OFF to vt-TODO
See https://github.com/dvdhrm/kmscon/pull/3 for a discussion of K_OFF in the VT
subsystem. We cannot apply it now but we have to reconsider it when the input
subsystem has been written.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Fri, 2 Dec 2011 12:01:12 +0000 (14:01 +0200)]
build: a few fixes to configure script
- Use C99 and gnu extensions.
- Explicitly link against libdrm (more strict linkers like gold would
complain).
- Consistently use *_CPPFLAGS where due.
- Clear the default CFLAGS.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 4 Dec 2011 16:56:43 +0000 (17:56 +0100)]
Console: Add buffer object
The buffer object manages the cells and scrollback buffer. It is optimized for
speed: fast rotations, fast resize, etc.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 3 Dec 2011 17:09:41 +0000 (18:09 +0100)]
Console: Simplify character handling
We add a new helper to initialize a new character directly to avoid two
allocations. This also refactors the character code and simplifies it alot.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 3 Dec 2011 15:49:44 +0000 (16:49 +0100)]
test_console: Use new eloop and VT subsystem
The test_console application now supports VT-switching and monitor-hotplug. New
monitors are detected when switching VTs. Full hotplug-support will be added
later.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 3 Dec 2011 15:39:06 +0000 (16:39 +0100)]
Output: Correctly acquire/release DRM master
If we switch VT, we must release DRM master to allow other applications to
access the DRM. When waking up the compositor we try to acquire the master again
to access the DRM.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 3 Dec 2011 15:38:14 +0000 (16:38 +0100)]
Eloop: Fix function name typo
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 3 Dec 2011 14:14:38 +0000 (15:14 +0100)]
Fix gitignore
We currently ignore all test sources. Restrict the filter to the root directory
so only the binaries are affected.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 3 Dec 2011 14:14:18 +0000 (15:14 +0100)]
Add VT test
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 3 Dec 2011 14:09:10 +0000 (15:09 +0100)]
Eloop: Add debug statements
Add some more debug statements to allow easier eloop monitoring.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 3 Dec 2011 14:08:18 +0000 (15:08 +0100)]
Add VT handling
As long as we are run in a VT we need to correctly handle VT-switches to avoid
blocking the crtc/input.
This is copied from wayland-compositor demos and modified to fit to our needs.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 3 Dec 2011 11:22:36 +0000 (12:22 +0100)]
Eloop: Pass mask argument to fd callbacks
fd-callbacks are pretty useless if we do not pass a mask argument with the
current flags.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 3 Dec 2011 11:04:29 +0000 (12:04 +0100)]
Eloop: Add idle-event support
Idle events are dispatched everytime kmscon_eloop_dispatch() is called. To allow
the callbacks to add/remove/modify all current idle events (including themself),
we need to keep a pointer to the currently dispatched event.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 3 Dec 2011 10:42:41 +0000 (11:42 +0100)]
Add event loop
Add event loop implementation with support for fd's and signal's through
signalfd.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 2 Dec 2011 14:33:52 +0000 (15:33 +0100)]
test_output: Use log API
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 2 Dec 2011 14:27:01 +0000 (15:27 +0100)]
Output: Choose sane default mode
We currently use the first mode in the list if no mode is explicitely specified
by the caller. However, this is most often the lowest available resolution
reported by the kernel.
This patch adds a new pointer to every output which remembers a sane default.
This is currently the first mode reported by the kernel but may later be
optimized to choose a better default mode.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 2 Dec 2011 14:16:14 +0000 (15:16 +0100)]
test_output: Use new log API
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 2 Dec 2011 14:15:05 +0000 (15:15 +0100)]
Add log API
We simply forward all log messages to stderr. We use syslog/prink-like severity
prefixes. Use systemd or alike to forward stderr to syslog, kernel-log or
similar.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 2 Dec 2011 14:10:07 +0000 (15:10 +0100)]
test_output: Catch SIGINT and SIGTERM
Correctly handle SIGINT and SIGTERM. This will also reset the crtc so it won't
stay black if the application is killed.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 2 Dec 2011 13:35:33 +0000 (14:35 +0100)]
test_console: React on SIGINT
Correctly terminate the application on SIGINT so the CRTC gets reset.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 2 Dec 2011 12:31:12 +0000 (13:31 +0100)]
Update documentation about autotools
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 2 Dec 2011 12:23:22 +0000 (13:23 +0100)]
Change license to MIT license
Further commits will need a Signed-off-by line, otherwise I cannot accept them.
MIT license is compatible with GPL so we still can switch to GPL in the future
if we want.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 1 Dec 2011 17:33:49 +0000 (18:33 +0100)]
Console: Fix cell-selection when drawing glyphs
We didn't calculate the correct cell number when drawing a cell. Fix that.
Reported-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 1 Dec 2011 17:20:54 +0000 (18:20 +0100)]
Update TODO
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Mon, 28 Nov 2011 22:27:30 +0000 (00:27 +0200)]
output: save and restore crtc upon (de)activation
The crtc is saved from kmscon_output_activate, and restored from
kmscon_output_deactivate.
This means that when the program exits, the screen is back to what it
was - we don't need to switch back VTs if we started the program from an
fbcon, etc.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 27 Nov 2011 17:09:26 +0000 (19:09 +0200)]
Output: Fix warning -Wall complains about
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Sun, 27 Nov 2011 17:08:36 +0000 (19:08 +0200)]
gitignore: add all the build stuff
Signed-off-by: Ran Benita <ran234@gmail.com>
Ran Benita [Sun, 27 Nov 2011 16:54:53 +0000 (18:54 +0200)]
build: use gnu autotools
This commit adds basic autoconf + automake files to build the project.
It also adds a main.c stub in order to simulate the main binary.
The configure script uses pkg-config to find the libraries. The usual
stuff should work. The only additional option right now is:
./configure --enable-debug [To enable debugging symbols]
The Makefile should also support the standard stuff:
make [To build the kmscon binary]
make check [To build the test_* binaries]
make dist [To create a tarball]
make clean
make install
etc.
To start from a clean tree (e.g. git clean -dfx), do something like the
following:
./autogen.sh
./configure --enable-debug CFLAGS=-O0
make
It all should work well enough for now.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 27 Nov 2011 18:31:26 +0000 (19:31 +0100)]
Add kmscon_console_write() function
This function can be used to change the content of the current cell. It
automatically moves the cursor to the next cell.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 27 Nov 2011 15:10:11 +0000 (16:10 +0100)]
Add kmscon_char_set() helper
This helper allows to copy one char into another.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 27 Nov 2011 14:50:59 +0000 (15:50 +0100)]
Add cursor movement helpers
Add functions to move the cursor of a console.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 Nov 2011 16:59:49 +0000 (17:59 +0100)]
Update TODO
Similar to libvte we could speed up font-drawing by using cairo_scaled_font_t to
bypass pango entirely if a glyph is already in the hash-table.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 Nov 2011 16:54:56 +0000 (17:54 +0100)]
Support glyph string caching
To avoid redrawing the whole layout every time, we now support caching a single
glyph-string if it consists of only one run.
This should speed up drawing considerably. We still support drawing the whole
layout as fall-back method.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 Nov 2011 16:53:45 +0000 (17:53 +0100)]
Fix glyph caching
We need to use memcmp() not memcpy() to compare two kmscon_char's.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 Nov 2011 16:12:17 +0000 (17:12 +0100)]
Calculate font size properly
We set the font size to the absolute size we have per cell instead of using a
fixed font-size.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 Nov 2011 16:04:52 +0000 (17:04 +0100)]
Set console resolution to 800x600 by default
This sets the console resolution to 800x600 on startup. We no longer have a
console with an invalid resolution after startup so we now can start calculating
font sizes properly.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 Nov 2011 15:55:25 +0000 (16:55 +0100)]
Fix test_console
Correctly set locale on startup and sleep for one second after each redraw to
reduce CPU consumption.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 26 Nov 2011 15:54:40 +0000 (16:54 +0100)]
Draw console
Properly draw all cells of a console on redraw.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>