1334 Commits

Author SHA1 Message Date
David Herrmann
bf39cf80b0 uterm: video: use shl_dlist for linked lists
uterm-video is actually older than shl_dlist and it used its own
single-linked lists until now. This had several drawbacks and produced
ugly code.

This commit converts all uterm-video elements to use shl_dlist and
introduces _bind and _unbind helpers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-12 13:31:17 +01:00
David Herrmann
ca6d86d8e8 uterm: video: share set_dpms code
The set_dpms callback of dumb and drm backends is identical so share it in
drm-shared module.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-12 08:21:40 +01:00
David Herrmann
415a53bfd7 uterm: share drm-video wakeup helpers
The dumb and drm backends still use the same code to perform wakeup/sleep
code. Hence, move it into the drm-shared file so we can use the same
helpers for both.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-12 01:01:54 +01:00
David Herrmann
9d70156dc9 uterm: drm: fix y-invert bug
This fixes the last OpenGL user that still uses the wrong y-axis
direction. See the gltex helpers for more information.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-12 00:53:01 +01:00
David Herrmann
921d4e8c25 uterm: share drm-video objects
This moves the gbm/drm shared properties into the drm-shared helper.
Furthermore, it removes the last static property in uterm_video objects so
everything is correctly accessed via ->data pointers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-12 00:51:23 +01:00
David Herrmann
5853a5c97a uterm: drm: fix y-inversion bug
OpenGL uses an inverted y-axis by default. However, the old gbm-surface
layer didn't correctly map this. But with the conversion to gbm_surface
objects, we now have the correct OpenGL framebuffers so we have to invert
the y-axis.
This was already fixed for the gltex renderer earlier but we forgot to fix
the uterm-drm blitting backend.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-11 19:18:15 +01:00
David Herrmann
4965a957b3 uterm: share drm-display helpers
dumb and drm video backends share quite a lot of logic. Hence, move common
helpers into the drm-shared module and use it in both backends.

This also moves the uterm-display objects of both backends to use the data
member instead of static fields.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-11 19:09:42 +01:00
David Herrmann
432b1961d1 uterm: share drm dpms code
drm and dumb backends use the same DPMS code so share it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-11 17:45:48 +01:00
David Herrmann
b6087af25e uterm: share drm_mode between dumb and drm backend
The dumb and drm backends use the same mode structure so share the code as
drm_shared module.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-11 17:28:29 +01:00
David Herrmann
464fbe7fef uterm: fbdev: set mode dimensions after activation
We do not set the dimensions correctly but always use 0/0. Fix this by
overwriting the values on mode creation.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-11 17:27:22 +01:00
David Herrmann
bbe3a5cc2f uterm: video: remove .blend and .blendv backends
We never implemented real blending and never hooked it up with the public
API. Hence, we can safely remove this. All functionality that was
available via .blend is now available via .fake_blendv.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-11 16:35:25 +01:00
David Herrmann
cad0d410d7 uterm: split fbdev module into different files
This is the first step towards a uterm-fbdev module. It splits the huge
video file into a video backend and a render backend. A monitor backend
will follow later when a full uterm module infrastructure is available.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-11 16:24:37 +01:00
David Herrmann
a272e506f7 uterm: fbdev: use video-data pointer
Instead of hardcoding fbdev data in the header, we now store all data in
the "data" pointer so we can be loaded during runtime.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-11 16:01:23 +01:00
David Herrmann
9220d48a42 uterm: video: add data pointer
If we want to load backends during runtime, we must allow them to store
their data. Instead of hardcoding it, we now provide a "data" pointer so
they can store arbitrary data.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-11 16:00:32 +01:00
David Herrmann
686ee42b22 uterm: video: include xf86drm.h for drmAvailable()
We need this include so drmAvailable() is declared correctly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-11 15:59:33 +01:00
David Herrmann
694f451ae8 uterm: video: modularize video backends
We want to allow dynamic backend loading during runtime so we need to
avoid static definitions. This converts the backend IDs into module
structures which are then linked into the binary.

To make this fully modular, we need to load the backends dynamicly via
dlsym() and move all the static declarations from uterm_video.h into the
backends. But for now at least the backends can be easily exchanged and
configured during compile-time.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-11 12:16:43 +01:00
David Herrmann
81b691b742 build: link with -ldl
We use dlopen() and friends so link with libdl.so to be sure that they are
available.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-08 17:54:53 +01:00
David Herrmann
cadb3e0899 uterm: move uterm.h to uterm_monitor.h
uterm.h contains only uterm-monitor related APIs so rename it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-07 19:37:44 +01:00
David Herrmann
407a5fc158 uterm: move uterm-vt into uterm_vt.h
This splits off uterm-vt from the main header to reduce the dependencies
on uterm.h.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-07 19:31:27 +01:00
David Herrmann
2047b56c80 uterm: move input related API to uterm_input.h
This splits off the uterm-input API from uterm.h to avoid depending on
uterm.h everywhere.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-07 19:22:38 +01:00
David Herrmann
50cfef008b uterm: move video API into uterm_video.h
Split the main header to avoid having it as dependency in so many places.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-07 18:03:45 +01:00
David Herrmann
ebf48cba22 uterm: monitor: avoid libdrm dependency
Instead of depending on libdrm, we simply copy the VERSION-IOCTL ABI and
perform the ioctl ourself. This reduces complexity and dependencies.

Why does the DRM layer not provide normal uapi headers via
linux-api-headers? We should fix that.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-07 14:07:14 +01:00
David Herrmann
67ac019dec uterm: remove unused pciaccess helpers
We now detect primary GPUs via udev so the pciaccess helpers are no longer
needed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-07 13:40:26 +01:00
David Herrmann
0dc3bf8012 uterm: video: remove drm_get_id() helper
This helper is no longer used so remove it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-07 13:37:17 +01:00
David Herrmann
6e013bca45 uterm: monitor: read boot_vga via uterm
Instead of using the pciaccess helpers, we now read the boot_vga flag via
uterm. This makes the whole process a lot simpler and removes a lot of
duplicated code that is already provided by the kernel.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-07 13:34:44 +01:00
David Herrmann
790254766e uterm: move uterm_systemd.h to uterm_systemd_internal.h
Same as uterm_input.h, we want internal headers to have the *_internal
suffix.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-07 13:24:50 +01:00
David Herrmann
0c008631d7 uterm: move uterm_video.h to uterm_video_internal.h
Same as uterm_input.h, we want internal headers to have the *_internal
suffix.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-07 13:24:09 +01:00
David Herrmann
9ad1438d55 uterm: move uterm_input.h to uterm_input_internal.h
We will split the public uterm header soon to avoid big headers. Hence,
rename internal headers to *_internal.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-07 13:18:06 +01:00
David Herrmann
77b67694d2 build: fix build without libfont.la
We still have dead dependencies on libfont.la but don't build it anymore.
Remove the dependency as it is directly linked now.

Reported-by: Vladimir Kravets
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-06 00:50:12 +01:00
David Herrmann
776566e216 build: remove getty@.service from makefiles
We removed this service unit earlier this week but the EXTRA_DIST variable
still mentions it. Remove it so kmscon builds cleanly again.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-06 00:49:38 +01:00
David Herrmann
9fd26ce310 text: remove old init/deinit helpers
We no longer need these helpers so remove them. We require each backend to
register itself as part of module-loading so no need to keep these
helpers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 17:49:39 +01:00
David Herrmann
995c07f853 kmscon: make bblit mandatory
Similar to the font backends we now require one backend to be always
available as safe fallback. The bblit backend is the most basic backend so
make it mandatory and link it unconditionally.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 17:48:23 +01:00
David Herrmann
b55f6e3284 build: remove libfont.la and link directly
We no longer share libfont.la so link it directly into kmscon.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 17:47:42 +01:00
David Herrmann
72925e0af9 kmscon: move gltex renderer into module
Provide the gltex renderer via a module to allow loading it during
runtime.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 17:41:50 +01:00
David Herrmann
e9d314b49b kmscon: move bbulk renderer into module
Provide the bbulk renderer via mod-bbulk.so so it can be loaded during
runtime.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 17:36:23 +01:00
David Herrmann
0cecc8de1e text: add owner field to text-ops
When text-ops are registered via modules, we need an owner field so
they're correctly tracked. Hence, add this field to all text-ops and
correctly keep module references.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 17:24:41 +01:00
David Herrmann
074c06eafb COPYING: update copyright to 2013
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 17:15:54 +01:00
David Herrmann
bef45b7d65 build: disable freetype2 by default
The freetype2 backend is no longer recommended. You should always prefer
the pango backend. Pango provides a lot more advanced font options and
internationalization.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 17:09:18 +01:00
David Herrmann
70b069aacc kmscon: add freetype2 module
The freetype2 module register the freetype2 font backend with kmscon core.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 17:04:55 +01:00
David Herrmann
b81cff46e5 kmscon: add unifont module
The unifont module registers the unifont font backend with kmscon core.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 17:04:33 +01:00
David Herrmann
e6fa020937 text: remove old font definitions
All font definitions have been moved to font.h so remove the old
definitions and include font.h instead.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 17:03:31 +01:00
David Herrmann
e97c71fea1 text: move font layer into top-level font_* namespace
The font layer does not longer depend on the text layer so move it into
its own namespace.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 16:55:56 +01:00
David Herrmann
c14492796e kmscon: add pango module
The pango module registers the pango font-backend with kmscon.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 16:30:40 +01:00
David Herrmann
5dcdc91b42 text: font: add owner field to font_ops
The owner fields specifies the module that provides the code for the given
backend. The font-core is responsible of ref/unref'ing the module so its
code is always available as long as the module exists.

We cannot push this into the modules as modules _must_ never call
kmscon_module_unref(KMSCON_THIS_MODULE)! Because this might drop the last
reference and hence the function might disallocate the module. However,
this means that it cannot return because the caller is _part_ of the
module and so no longer valid.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 16:23:52 +01:00
David Herrmann
a8c1d8bbf1 kmscon: add module support
Several parts of kmscon have huge external dependencies. However, we allow
them to be disabled during build-time. But this is not enough as it
requires distributions to choose which options to use. Therefore, we now
allow dynamicly loadable modules that can optionally be installed and
kmscon automatically picks them up.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 16:21:18 +01:00
David Herrmann
0c119779ad build: disable wlterm by default
wlterm hasn't been updated for long and it will take some more time to get
it to work with recent Wayland protocol. Hence, disable it so it doesn't
matter if it breaks for now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 15:53:01 +01:00
David Herrmann
82ee6c8e51 text: font: add .finalize callback
Each font-backend now also gets a .finalize callback that is called when
the last font-user drops its font. This will allow modules to destroy
themself when the last reference is dropped.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 14:03:58 +01:00
David Herrmann
327c7f0690 shl: register: add destroy callback
The new destroy callback is called whenever an entries last reference is
dropped. This will allow modules to keep reference of its code users.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-03 14:00:57 +01:00
David Herrmann
0248318732 text: remove load/unload helpers for text-font backends
With modules we no longer need to conditionally load backends. Instead
each module will register the backend with the main application on load.

This will temporarily break pango, freetype2 and unifont backends as they
are not registered until we introduce full module support.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-02 18:14:48 +01:00
David Herrmann
180f25375d build: link each text-font backend separately
We want to modularize the text-font library, so we need each backend as a
different library. This step links each of them into a different static
library so we can now link them either into the binary or into modules.

This step also makes 8x16 always compiled into the text-font backend so we
always have a working implementation even though no modules might be
loaded.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-02 18:02:10 +01:00