92 Commits

Author SHA1 Message Date
David Herrmann
80e5a3b4a6 uterm: video: add support for immediate buffer-swaps
Internally, we already support immediate buffer-swaps but this hasn't been
exported in the API. This patch adds an "immediate" argument that causes
the flip to be immediate and not synchronized with vertical-blanks.

Please note that this might block if there is a pending page-flip.
However, this is mostly a delay of 16ms so we can ignore it as this is
acceptable if you want immediate swaps while there is still a
pending-buffer.
You can listen for the UTERM_PAGE_FLIP event if you don't want this
behavior.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-13 16:06:00 +01:00
David Herrmann
5f348ccec7 tests: fix build with new uterm headers
These tests still use uterm.h which builds fine if you have an old uterm
version installed, however, with a new version this will fail horribly.
Hence, fix them to use the new headers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-12 13:40:00 +01:00
David Herrmann
4ceb557ecb kmscon: run only on VT-less seats in listen-mode
If we run in listen mode, we are supposed to take over a seat. If a seat
supports VTs (like kernel VTs or kmscon cdev fake VTs) we assume that
there is some manager for these VTs (the one who created them). Therefore,
there is no need to run kmscon in listen mode on these seats. Instead, you
should run kmscon in default mode on these seats.

We enforce this limitation because if the VT-master on those seats dies
and causes a HUP, they have no way to notify us when they startup again.
Therefore, this kind of setup is broken. Furthermore, no-one would every
want such setups.

Instead use the startup mechanism of the VT/seat-manager to start kmscon
in default mode on those seats.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-12-06 14:18:57 +01:00
David Herrmann
da7219e6de test_output: use uterm_display directly
uterm_screen is scheduled for removal so use the display API directly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-26 17:10:44 +01:00
David Herrmann
70cdfa0313 test_vt: add --switchvt option
This has the same effect as for kmscon but is disabled by default.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-11 11:39:38 +01:00
David Herrmann
7eae29e5cb test_vt: add --vt=<path> option
This new option allows specifying a path to the VT that should be used.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-11 11:37:17 +01:00
David Herrmann
6818fe2d32 test_vt: remove trailing newline in log-message
The log-subsystem adds these automatically so we shouldn't use them.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-11 11:36:38 +01:00
David Herrmann
1f87ee4bff test_vt: use a dummy input-object
We cannot allocate VT objects without an associated input object.
Therefore, allocate a dummy device with no input devices assigned to it
and use it for the test-vt object.

Note that this makes switching from/to this VT via command-line
impossible.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-11 11:35:15 +01:00
David Herrmann
e495126c80 kmscon: add --xkb-model option
This option now allows the user to change the XkbModel from the command
line or configuration file.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 19:00:43 +02:00
David Herrmann
9d2018f521 build: fix "make check" build failures
I forgot again to keep these up to date. The conf-layer updates broke them
horribly. However, we now build them correctly without kmscon-core by
including all required layers directly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:32:43 +02:00
Ran Benita
2843c80c5b xkb: use system defaults instead of "us" for layout
libxkbcommon has a configure option to set the default values for the
RMLVO's (if they are passed as NULL or "" - we use "" so it'd be safe to
print). If they are not specified there, it's just "us" like we currently
do have. But if they are specified, we should most likely defer to it.

We do the same for the model field, instead of hardcoding "evdev". The
rules field remains hardcoded to "evdev", because we rely on it when
doing the evdev scancode-to-keycode +8 mapping.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:06:43 +02:00
David Herrmann
6648029d5f test_input: fix using XKB directly
We removed a lot of helpers from uterm-input because XKB is now a
mandatory dependency. So use it directly from test_input to avoid all the
uterm helpers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-09 13:56:30 +02:00
David Herrmann
c77e3d8c0c test_input: fix compilation with changed input API
We dropped unused modifiers so we have to fix test_input not to print them
out.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-01 14:07:23 +02:00
David Herrmann
c43d1ca722 kmscon: allow paths with --vt=<xy>
The getty variants out there (including agetty) require an relative path
to the /dev directory as argument. This is really odd but we want to be
backwards-compatible to them so we allow this, too.

--vt now accepts:
  * A positive number which is internally converted into /dev/ttyXY
  * A string that does not start with '/' or '.' which is interpreted
    relative to /dev as /dev/%s
  * Everything else is interpreted as path

This option still selects only the TTY on seat0. On all other seats we do
not use controlling TTYs.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-30 19:13:02 +02:00
David Herrmann
e39aa6533f test_vt: fix compilation with new allocation API
We changed the uterm API so we need to fix this test again.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-30 15:15:06 +02:00
David Herrmann
be4cd8edd0 test_key: add small helper for client-side key-input
We sometimes need to test what keys a client receives when specific keys
are pressed. This small helper simply runs in a terminal and receives raw
keyboard input and prints it to stdout with debugging information.

This can definitely be improved with the help of the TSM state-machine to
print more useful information and directly parse the input. However, this
is better than nothing.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-20 13:16:32 +02:00
David Herrmann
fc913dd238 test_vt: fix using correct uterm API
This still uses the old VT API which now fails as we added a new
parameter. As a side-effect, this test will not work if used on a VT-less
system or on a seat without VTs. But we actually don't care, yet, as any
other VT-replacement isn't really production-ready, yet.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-29 17:59:21 +02:00
David Herrmann
2841558f7c test_output: add --dev parameter
The --dev parameter is used to specify the device that is used for
testing.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-12 13:30:51 +02:00
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