74 Commits

Author SHA1 Message Date
David Herrmann
e20283217b tests: make all tests use the new conf-parsers
This allows the tests to have their own command-line parsers. Finally!

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 22:43:13 +02:00
David Herrmann
ea62198b6e test_output: always use blitting backend
This removes the currently non-working OpenGL test and always uses the
blitting functions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 13:21:15 +02:00
David Herrmann
023fb41bb4 test_output: add blitting support
When opengl rendering is not available on the target device, we now fall
back to software rendering. Instead of drawing a nice gradient we now draw
a white screen to the target device to avoid heavy calculations.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-31 10:31:40 +02:00
David Herrmann
20e0e69253 test_input: fix compilation for kbd_keysym_to_string()
Since we moved to a runtime backend system for the input subsystem, we
cannot access the internal keysym_to_string() helpers anymore. Hence, use
the recently introduced uterm-input forwarding helper.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-31 10:01:32 +02:00
David Herrmann
8256ef6686 tests: fix tests to compile again
Whoops, I totally forgot about them. Fix the headers to be compatible with
eloop again.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-07 13:45:29 +02:00
David Herrmann
51bfe9d107 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>
2012-05-27 16:41:19 +02:00
Ran Benita
06885d2dd6 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>
2012-05-26 14:49:06 +02:00
David Herrmann
14ab49d985 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>
2012-05-26 07:24:47 +02:00
David Herrmann
bb1eee8a0f test_output: explicitely activate GL context
We now support multiple GL contexts in uterm so we need to explicitely
enable them before using them.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-17 16:31:38 +02:00
David Herrmann
efcc519458 test_output: fix build failure
Use new uterm_video constructor. This requires hard-coding the DRM card
but this is needed until we use the uterm_monitor interface.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 22:49:29 +02:00
David Herrmann
3acc23c932 test_input: use new input API
Use new uterm_monitor and input API instead.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 22:48:15 +02:00
David Herrmann
3c6d3ed468 test_input: use new test_include.h infrastructure
test_input compiles again and uses the same helpers as the other tests do.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-22 17:07:11 +02:00
David Herrmann
508a3be363 tests: remove unneeded tests
test_buffer and test_terminal no longer compile and are not needed so
remove them.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-22 16:57:45 +02:00
David Herrmann
1081c76274 test_vt: use new test_include.h code
test_vt now compiles again and uses the new infrastructure.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-22 16:51:28 +02:00
David Herrmann
a34a107723 test_console: remove
This test doesn't compile and is no longer needed. We can now use the
kmscon program or test_terminal for the same functionality.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-22 16:42:25 +02:00
David Herrmann
f307f145a8 test_output: always enable all outputs
Instead of accepting a list of outputs we now enable all outputs when
testing the video subsystem.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-14 19:54:45 +02:00
David Herrmann
24f189a31a test_output: run eloop for 5s instead of sleep()
The new eloop implementation allows to run the eloop for a fixed amount of
time. Use this instead of sleeping for 5s which would prevent us from
catching signals as the eloop blocks them in favor of signalfd.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-14 19:49:36 +02:00
David Herrmann
7a27de465b test_output: use new test_include.h header
The test_include.h header now provides the basic initialization that will
later be used in all other tests. This allows us to use the same
program-parameters that kmscon uses and makes sure everything is
initialized properly before we run the tests.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-14 19:45:11 +02:00
David Herrmann
b56ec68a91 test_output: remove signal handler
It will be replaced by the event loop signal handler.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-14 19:35:12 +02:00
David Herrmann
c9ea08d9b5 unicode: use static global symbol table
A symbol table should never be created twice therefore we can make it
static and global. We add locks so it is totally thread-safe, too.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-29 16:17:55 +02:00
David Herrmann
6072a4ea53 test_terminal: parse command line arguments
Parse command line arguments so the input subsystem recognizes the XKB
values.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 13:41:30 +01:00
David Herrmann
cfca84f250 vt: fix callback enum type
We should use the enum type instead of plain "int" to be more verbose
here.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-23 16:42:04 +01:00
David Herrmann
096f0cadc7 Move to new uterm infrastructure
This fixes all compositor/output/context/etc. uses and replaces them by
the new uterm API.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-23 14:18:50 +01:00
David Herrmann
1dd7198216 test_output: use new uterm/log/etc. subsystems
Convert the test_output test to use the new subsystems.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-23 13:35:02 +01:00
David Herrmann
4790d9f7ab eloop: move prefix to "ev_" instead of "kmscon_"
The long "kmscon_" prefix is horrible so move everything to "ev_" now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-20 19:08:29 +01:00
Ran Benita
d8cf293c94 build: implicitly include config.h
config.h is meant to be around in all files, as it contains stuff like
_GNU_SOURCE, NDEBUG and HAVE_*.

Make these definitions available without needing to #include config.h
every single time.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-20 19:00:16 +01:00
David Herrmann
2b8caca91c console: remove *_buffer_newline()
This function is no longer needed as we now have proper scrolling
functions. This also adjusts the buffer tests to be more appropriate.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-02-04 14:34:33 +01:00
David Herrmann
ff408d6fb9 test_buffer: add margin tests
Modify the buffer test to add margin tests.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-02-03 18:43:56 +01:00
David Herrmann
af3a1f3e50 console: move kmscon_console_rotate to *_newline
We do no rotation so rename the function to the more appropriate name
kmscon_console_newline.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-02-02 17:01:54 +01:00
David Herrmann
2ddd47e858 test_buffer: add utf8 state machine test
Add trivial test to show how to use the utf8 state machine.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-29 14:21:19 +01:00
David Herrmann
79e1ada7e5 vte: handle keyboard input (stub)
Make the vte subsystem handle the keyboard input instead of doing this
inside of test_terminal.

The handling is just a stub function. No actual keys are parsed yet.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-28 22:14:20 +01:00
David Herrmann
da0623c260 terminal, pty: pass eloop reference on obj creation
There is no reason to pass the eloop reference late at terminal/pty
open. If we pass it early on object creation we will always have a valid
reference and can remove several code paths.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-28 13:56:13 +01:00
David Herrmann
bd09f38a4d log: move log_warning to log_warn
log_warn is much shorter and we already use log_err instead of log_error
so this is more consistent now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-24 15:29:55 +01:00
Ran Benita
5cc190d947 test_terminal: wait on children to avoid zombies
Unfortunately, there is no clean way I see to hook this up from the pty
object. We can (and will) have more than one pty object opened at a
time, but the semantics of signalfd make it impossible to deliver each
SIGCHLD to its rightful owner without complicating things.

[ From what I tested:
 - If you have two signalfd's listening to the same signal, they will be
   dispatched in some round-robin manner.
 - Also, if more than one child exits before we read signalfd (possibly
   beloging to different terminals), they will be compressed to one
    event. ]

We therefore need to do the reaping from a central location, and need to
remember to copy this snippet over to main.c in the future.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-24 15:06:51 +01:00
Ran Benita
6ebc7c1892 terminal: use new pty object
Add a new terminal_open/terminal_close methods to correspond to the pty
ones, and notify when the terminal is closed.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-24 15:04:06 +01:00
Ran Benita
582ee16d31 test_input: simplify and drop xkbcommon dependency
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-23 13:51:50 +01:00
David Herrmann
5a3801386a font: rewrite font backend
We now properly draw fonts with OpenGL. We now use FreeType2 instead of
pango to avoid big dependencies.

We also add a DejaVu font so we currently don't have to deal with font
selection.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-22 22:44:12 +01:00
David Herrmann
e5f5c2729a font: require compositor reference
To avoid cairo dependencies we now take a compositor reference in the
font backend so fonts can be drawn with GL textures instead of cairo.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-22 13:51:23 +01:00
David Herrmann
7085084b1d context: use GL_TRIANGLES instead of GL_QUADS
GL_QUADS may actually be not supported on some embedded platforms so we
use GL_TRIANGLES.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-20 16:11:30 +01:00
David Herrmann
83cec439c6 console: use new drawing pipeline
Instead of drawing with fixed-function GL pipeline we now use our own
shader for texture drawing. This also fixes test_console to no longer
depend on GL.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-20 15:45:58 +01:00
David Herrmann
05a1747f00 console: take reference of compositor
To switch to the new drawing subsystem we need a reference to a valid
compositor object so we can retrieve the GL context.
This also applies to the terminal object.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-18 18:09:08 +01:00
David Herrmann
cabde245df test_output: use new drawing pipeline
This converts the output test function to use the new kmscon_context for
drawing operations so we no longer depend directly on GL.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-18 16:26:57 +01:00
Ran Benita
01e469b9ec test_console: fix use-after-free
Here's how it goes:
1. stdin reaches EOF, kmscon_eloop_rm_fd is called on stdin_fd.
2. The fd object is freed, the memory is reused in the meantime.
3. rm_fd is called again in destroy_eloop.
4. con->stdin_fd points to garbage and we get a segmentation fault.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-09 20:20:58 +01:00
David Herrmann
c203b3a83d 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>
2012-01-01 18:27:09 +01:00
David Herrmann
a7128cc683 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>
2012-01-01 17:43:57 +01:00
David Herrmann
b3ce42bc63 test_buffer: add kmscon_symbol_t test
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-01-01 16:52:30 +01:00
David Herrmann
117d7ddbcd 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>
2011-12-31 17:38:46 +01:00
Ran Benita
8d28790ba4 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>
2011-12-31 16:53:54 +01:00
Ran Benita
7c9fb7bf29 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>
2011-12-31 16:52:22 +01:00
Ran Benita
c3912b23a2 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>
2011-12-31 16:50:52 +01:00