388 Commits

Author SHA1 Message Date
David Herrmann
2d2c92e6c2 uterm_monitor: correctly enumerate input devices
We are actually not interested in the main input device but rather in the
evdev interface. However, the evdev interface is a child of the input
device and therefore has no seat values specifies. This patch removes the
scan-filter for seat tags and performs seat matching in user-space by
first finding the parent of the input device.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 22:41:23 +02:00
David Herrmann
fd9a68ae2e uterm_monitor: refresh seats before scanning the system
We currently only scan devices in uterm_monitor_scan() but we should read
the initial seat values before even searching for devices.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 22:40:32 +02:00
David Herrmann
c81a83fb3a uterm_monitor: initialize list heads correctly
List heads must be initialized and cannot be set to NULL by default.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 22:40:01 +02:00
David Herrmann
c67b20d89e uterm_monitor: add debug messages
Be more verbose about added and removed devices. Otherwise, debugging is
not as easy as it could be.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 22:39:24 +02:00
David Herrmann
fcd4156ea0 uterm_input: fix initializing device list
kmscon_dlist heads must be initialized and cannot be set to NULL by
default!

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 22:37:21 +02:00
David Herrmann
3e905921da uterm_input_xkb: fix typo
We renamed kmscon_kbd to kbd_dev but forgot that single function.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 22:36:23 +02:00
David Herrmann
07d94e0792 uterm_input: fix typo
The header said *_is_asleep() instead of *_is_awake().

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 22:35:43 +02:00
David Herrmann
c5f137c833 uterm_input: add xkb backend
This mainly copies the kbd_xkb.c backend into the uterm library.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 21:30:06 +02:00
David Herrmann
aa0566ba0a uterm_input: use new kbd API
Use the uterm internal kbd API instead of the kmscon kbd API.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 21:15:57 +02:00
David Herrmann
a13ac6b8e4 uterm_input: add kbd API
Internally, we use a new kbd API to handle keyboard related stuff in
uterm. It is a reimplementation of the old kbd_dumb.c backend.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 21:14:38 +02:00
David Herrmann
c7cd3bf353 uterm_input: add input layer to uterm
This is a rewrite of the input layer but integrated into uterm. It has the
same functionality but is tightly bound to the concepts behind uterm and
will soon supercede the old implementation.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 20:33:27 +02:00
David Herrmann
5a5bd3a6f2 uterm_monitor: add input device support
To allow moving all input handling to uterm, too, we need to detect input
devices in the uterm-monitor like all other devices, too.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 18:21:58 +02:00
David Herrmann
d1be1d60fa uterm_video: remove hotplug awareness
To introduce the new uterm-monitor object we need to remove all the udev
handling from uterm_video. To not break "git bisect" we now remove all the
udev code from uterm_video and uterm_video_drm and make kmscon use the
static /dev/dri/card0 interface for now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 17:39:46 +02:00
David Herrmann
394879e603 uterm_video_drm: include xf86drmMode.h again
Upstream mesa fixed the missing header protection of xf86drmMode.h so we
can include it again.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 17:24:23 +02:00
David Herrmann
380868d54b uterm_monitor: add system monitor for full seat support
The new uterm_monitor watches the system for seat-changes and puts all
devices under the correct seat. This allows to run kmscon on multiple
seats in a single process. It now also correctly handles seat-changes,
that is, devices that are reattached to a different seat on runtime.

It is not integrated into the kmscon source, yet, but will soon be.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 17:16:13 +02:00
David Herrmann
23e9903f07 misc: add safe list iterator
New for-each implementation that keeps a safe pointer to the next element
so you can remove the current element from the list.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 17:14:28 +02:00
David Herrmann
f7b398a34a eloop: allow flushing an fd
Sometimes one wants to remove all pending events for an fd. The new
ev_eloop_flush_fd() call allows this in a safe way.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-05 17:13:42 +02:00
David Herrmann
335182556c uterm_video: add udev device parameter to video_new()
When triggered by seat monitor we need to be able to create uterm_video
objects on a concrete device so enable passing it in.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-03 19:24:39 +02:00
David Herrmann
60b4fb5100 build: fix build for automake 1.12
automake-1.12 complains about missing AC_PROG_AR so add it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-03 19:05:59 +02:00
David Herrmann
bd9d153691 uterm: fix comments
Update comments to resemble new uterm_video logic.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-03 18:11:40 +02:00
David Herrmann
36a4948be5 uterm_video_drm: return -EINVAL if already activated
If a display is already activated we return EINVAL. Otherwise, the user
might think that the requested mode was activated even though a totally
different mode may be still active.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-25 18:19:21 +02:00
David Herrmann
7e9a31aa4e uterm_video: allow explicitely activating GL ctx
We may have to use multiple GL contexts if we mix DRM and fbdev devices.
Therefore, we need explicit GL-ctx management.
We now allow to explicitely activate a specific GL context. This means,
the user needs to use the right GL context before he creates textures or
similar.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-25 17:35:03 +02:00
David Herrmann
c7ec2f9dac uterm_video: disable egl context on destruction
Make sure to reset the egl-context before destroying it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-22 17:19:55 +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
6c23507910 console: avoid unneeded matrix transformations
We now assume a screen of -1,-1 to 1,1 instead of 0,0 to 1,1 to avoid
matrix transformations.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-22 16:38:53 +02:00
David Herrmann
0310a4c054 font_pango: add debug messages
Add debug messages so we always know what kind of screen is created.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-22 16:38:23 +02:00
David Herrmann
530991f536 gl: disable texture stride support
This currently does not work properly so disable it. However, we
definitely need to fix this later.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-22 16:37:43 +02:00
David Herrmann
2010d661dd eloop: fix memory leak for shared signals
A shared signal owns an eloop_fd object. This has a reference of its
connected eloop. Therefore, we must free a shared signal to drop a
reference to the connected eloop and cannot postpone this to
eloop-destruction. Otherwise, the eloop will never get destroyed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-22 15:47:40 +02:00
David Herrmann
e302a0bd96 eloop: use kmscon_dlist for shared signals
Move to new list-implementation instead of the single-linked list. This
allows removal of elements in O(1).

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-22 15:47:00 +02:00
David Herrmann
b7773bc70b misc: add double-linked list implementation
This adds a generic double-linked list implementation so we don't have to
write all list-handling over and over again.

The list-type is similar to the kernel list where we use the same type for
heads and entries. This is a _very_ convenient list-type so we copy it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-22 15:43:00 +02:00
David Herrmann
7a7f977d43 misc: add type-safe "offsetof"
This uses the GCC extension "typeof" to implement a type-safe "offsetof"
similar to the implementation in the linux kernel.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-22 15:40:39 +02:00
David Herrmann
68633aee06 misc: fix header protection
There was a typo in the macros for header protection.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-22 15:39:57 +02:00
David Herrmann
3a480dc910 misc: add kmscon_hook_num() helper
This helper returns the number of registered callbacks for an hook.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-15 14:57:17 +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
dab18c4eb7 console: remove old font-factory code
Remove the code that is no longer needed due to the new font renderer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-01 19:31:57 +02:00
David Herrmann
a220fbae1a terminal: use new font backend
Instead of using the slow old font-factory we now use the new font_screen
object which allows faster software rendering with pango/cairo.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-01 19:25:54 +02:00
David Herrmann
a0109ffabc console: remove margin_bottom cache
margin_bottom was always the last index of the scroll-region, in contrast
to cells->mbottom_y which is the bottom margin size. However, this cache
is inconvenient so this replaces all calls to margin_bottom with a correct
immediate calculation of the bottom margin.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-01 18:17:45 +02:00
David Herrmann
9c2b838054 console: remove mtop cache
We can directly access the buffer now so no need to cache the value.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-01 16:12:02 +02:00
David Herrmann
4897b4ce68 console: remove cells_x/y cache
We don't need this anymore as we now have direct access to the buffer
structure.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-01 15:00:47 +02:00
David Herrmann
d2786e12d3 console: add "fixed_position" option
The fixed_position option allows to explicitely keep the scrollback-buffer
position instead of scrolling on new input. This was already the current
behavior but now we can also scroll on new input if this is set to false.

Also fix up the formatting of the comments and remove old information.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-01 14:08:20 +02:00
David Herrmann
bfe6702c1e console: remove refcnt of buffer object
The buffer object is used internally only and should never be shared.
Hence, we can safely remove the refcnt.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-01 12:52:54 +02:00
David Herrmann
c25a2bb249 console: make buffer code private
The buffer should not be accessed from code outside of console.c so make
it private. This includes some code-moving but no bigger changes. The diff
might look scary, though.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-04-01 12:50:17 +02:00
David Herrmann
d01ad92bf8 font: add new font renderer
The old font-renderer was horribly slow. There were several ideas to
speed it up but I decided to add the pango backend again. Pango allows us
to draw combined-characters and all other kinds of special characters. We
would have to rewrite pango if we wouldn't want this dependency so I
currently have no idea why we should make it optional.

However, some people might not care whether they can correctly display all
kind of Unicode text but instead want some shiny kmscon without any
dependencies. Therefore, I will keep the old freetype font-renderer even
though it is not used yet. However, we can convert it at any time.

The new font-renderer is not used yet. We need to cleanup the console
layer first before it can be hooked into the terminal.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-31 22:45:12 +02:00
David Herrmann
728f4a1b18 gl: add stride parameter to texture upload
Allow to specify the stride when uploading data into a texture.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-31 22:44:37 +02:00