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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>