37 Commits

Author SHA1 Message Date
David Herrmann
02ddaaeb9f uterm: monitor: mark DRM-fbdev devices as such
Most DRM drivers also provide a legacy fbdev device so fbcon can pick it
up (and more importantly, we get kernel panics on it). However, as an
application developer, I don't want to use two devices which drive the
same physical hardware.

This marks all such DRM fbdev devices as FBDEV_DRM so kmscon doesn't pick
them up automatically.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-21 14:25:10 +02:00
David Herrmann
a0a8be1c0a tsm: vte: introduce own modifiers
We do not want to depend on uterm just for the modifiers so introduce new
modifier-names which are in-sync with the UTERM names.

Inside of kmscon we still use the UTERM names everywhere, but inside of
TSM we now rely on the new names.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-18 17:36:29 +02:00
David Herrmann
69259c8d64 build: make xkbcommon built-time dependency
We really need xkbcommon-keysyms.h for building kmscon/uterm/TSM/etc.
However, the recent fix was ugly and didn't really help. Instead we copy
the keysyms file into external/xkbcommon/ so we can just include the real
xkbcommon files from any source but have a fallback in external/.

Hence, you can still build kmscon without xkbcommon with this fallback,
but this will be removed the first day when xkbcommon sees a public
release.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-18 12:29:06 +02:00
David Herrmann
2df4fc0d31 uterm: video: add *_display_fake_blend(v) requests
Instead of requiring to use uterm_screen objects we now add a
fake_blendv() request directly to the display object. We rename it to
"fake_blend" instead of just "blend" so we can later implement real
blending.

This reuses the existing infrastructure. But the fake_blendv is the way to
go so we rename the existing functions to "fake_*" either.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-12 15:23:15 +02:00
David Herrmann
87c9963438 uterm: add *_swap() and *_use() helpers for displays
Instead of requiring to use a uterm_screen object we now also add these
helpers to the display directly. This allows to use libuterm without any
screens, which is often useful if no virtual screen are needed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-12 15:00:28 +02:00
David Herrmann
085aef9e38 uterm: move uterm_vt to the end
Move uterm_vt to the end of the file to avoid forward declaration of
uterm_input.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-11 19:33:58 +02:00
David Herrmann
55e37dde77 uterm: add uterm_keysyms.h
We need a copy of xkbcommon-keysyms.h as long as xkbcommon is not included
in all major distributions. We _need_ this build-time dependency,
otherwise, we cannot build the other keyboard backends.

However, requiring xkbcommon as build-time dependency is not a solution as
no major distribution includes it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-11 19:30:26 +02:00
David Herrmann
2a05b978d3 uterm: input: include keysym file from main header
We still depend on xproto during compile time as we need the keysym
definitions. We could simply copy the keysym file but I really want to
wait until xkbcommon is finally released as it includes a keysym header,
too. Then we can simply depend on xkbcommon during build.

However, as we still need a way to perform the other conversion: string to
keysym, we need some hashtable anyway. So we can then also copy the keysym
definitions, too.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-05 19:47:41 +02:00
David Herrmann
2d3166a847 conf: add "grab" config data-type
Grabs are used to specify keyboard shortcuts so they do not have to be
hardcoded into the binary.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-05 14:07:03 +02:00
David Herrmann
7ff4426bc3 uterm: input: add string_to_keysym() helper
This new helper can be used to convert a string description of a keysym
into a real keysym. This is required to allow users to configure keyboard
shortcuts and more.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-05 14:04:05 +02:00
David Herrmann
3386aa955b uterm: video: add vectorized blending
Vectorized blending allows pushing multiple blending-requests to the video
hardware at once. This can speed up rendering on 2D devices a lot.
However, the gl-rendering is really just for completeness and shouldn't be
used if performance matters.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-31 00:00:07 +02:00
David Herrmann
06d33f6636 uterm: vt: add fake VT via user-input
This actually incorporates the fakevt tool into kmscon. That is, if the
user presses ctrl+mod4+F12, we activate or deactivate the fake VT.

This is for debugging only and needs to be made more configurable. Use it
on your own risk.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-15 09:27:11 +02:00
David Herrmann
4c1da1069d uterm: vt: mark vts as dead during deallocation
To avoid useless checks wether a vt is valid we simply mark it as dead and
centralize the checks in the API entry point.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-12 10:16:55 +02:00
David Herrmann
58eb1e85b9 uterm: vt: rename real VTs internally to real_*
Instead of using the old kmscon_vt_* names we now prefix everything that
implements real linux VTs with real_*. An internal flag specifies which
mode the VT is in so we can check whether we are a real VT or a fake one.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-12 10:03:01 +02:00
David Herrmann
f4b4bc2ee4 uterm: input: pass xkb parameters from outside
Instead of accessing the kmscon configuration from the uterm code, we
should pass it in on creation. Otherwise, uterm depends on main.c which
would be really ugly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 22:41:53 +02:00
David Herrmann
51b70bef52 uterm: video: add blend() helper
When drawing single glyphs we often have the glyph as alpha-only buffer so
we can draw it with any color we want. blit() requires a full image that
can be copied, so the new blend() helper is introduced which takes a
foreground and background color and blends in an image. Only plain-alpha
buffers are currently supported.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-31 14:24:45 +02:00
David Herrmann
7c075e3891 uterm: video: remove unused UTERM_FORMAT_MONO
This format is not used, neither implemented, so it is safe to remove the
constant.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-31 13:12:05 +02:00
David Herrmann
aada3038e1 uterm: video: add fill() helper
When using unaccelerated video we want to be able to fill a region of the
target framebuffer with a solid color. Hence, this adds the fill() helper
function with similar semantics to blit() but it uses a solid RGB color
value to fill in the framebuffers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-31 10:29:52 +02:00
David Herrmann
361177fe97 uterm: video: change blit'ting logic
Instead of passing width/height separately, we now use the values from the
buffer object. The caller has to manipulate the buffer object to change
these values. In fact, they can simply create a buffer object on the stack
with the same values copied from the real buffer and just adjust the
offset, width, height and stride. With the help of the stride value, it is
possible to even shrink the buffer horizontally.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-31 10:22:39 +02:00
David Herrmann
dd3d67a6f4 uterm: input: add uterm_input_keysym_to_string()
There is no much gain from having an internal kbd_desc_keysym_to_string()
function if we cannot get access to the kbd_desc object. Therefore, add a
forward helper to uterm_input() which forwards the call to its internal
kbd_desc object. This allows outside access to the keysym_to_string()
function.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-31 10:00:03 +02:00
David Herrmann
c170a43624 uterm: video: replace bpp with format id
Instead of using bpp as parameter for buffers we now use format
identifiers so we can add different formats with the same bpp. Please note
that currently only xrgb32 is supported.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-22 16:16:51 +02:00
David Herrmann
de02874bf6 uterm: add dumb-drm backend
Nearly all drm drivers provide a GEM/TTM buffer backend called "dumb
buffers". These buffers can simply be mmap'ped like fbdev device so 2D
acceleration is available. This patch adds a backend to uterm-video that
uses these buffers. It is quite similar to the drm backend but removes all
the egl/gl/gles2 dependencies.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-01 14:28:26 +02:00
David Herrmann
749f653e66 uterm: video: add blitting support
All backends that do not provide OpenGL contexts can not implement buffer
blitting so we can at least draw rectangular areas to the framebuffer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 01:03:56 +02:00
David Herrmann
eec3f2ad85 uterm: add WAKEUP and SLEEP signals
Notify all listeners when going to sleep or waking up. This allows saving
energy in the listeners by not redrawing the screen while being asleep.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 01:01:47 +02:00
David Herrmann
9c7e0159aa uterm_input: introduce UTERM_INPUT_HAS_MODS()
This is a convenient macro to check whether a given set of modifiers is
enabled on the given input event.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-27 16:43:26 +02:00
David Herrmann
233eb5c510 uterm: add VT API
The uterm VT API is designed to support new user-space implementations of
vt-master APIs. If we are on seat0 and CONFIG_VT is enabled, we use the
kernel VT API. In all other cases we currently simply fall back to a
non-op but will implement in the future dbus based APIs or similar to
support VT switching, that is multi-session, on all seats.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-25 09:45:20 +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
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
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
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
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
56f5eebf0e hook: delete by callback *and* data argument
When deleting a hook we should not search for the callback only. Otherwise
we might remove the wrong callback. Therefore, we now search for callback
and data argument. If multiple callbacks are registered with the same data
and cb, then we don't care which one is removed as this wouldn't make any
difference. They behave the same way, anyway.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 17:08:00 +02:00
David Herrmann
e6db44385b uterm_video: add callback
Allow applications to register callback and notify them about new or gone
displays.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 15:21:57 +01:00
David Herrmann
a8562c7a5c uterm_video: add *_screen_height/width() helpers
A screen may have a different size than the displays so add these two
hooks.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-23 13:34:20 +01:00
David Herrmann
8e2af97038 uterm: new video backend
Our old backend was hacked together and hadn't have any structure. This is
a new approach to create the uterm-library inside kmscon. The
uterm-library will contain everything that is needed to run an application
on Linux DRM devices without X11 or Wayland support.

The idea is to move the input subsystem to uterm, too. No other stuff is
currently planned to be included in uterm.

Although uterm is supposed to be a separate library, we do not build it as
such library. We currently include the log-subsystem and the
eloop-handlers in the library so we cannot build it as stand-alone
library. However, we try to keep it separate so if we ever need to export
it, then it should be a one-hour job to do it so.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-23 11:26:04 +01:00