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