uterm: add fbdev video backend

This adds a fully working fbdev backend to the uterm library. This allows
us to create our rendering pipeline on any linux machine.

The fbdev backend is not yet hooked up into kmscon. There are still some
remaining issues as we do not have OpenGL on fbdev if EGL is not compiled
with fbdev backend (which is usually not).

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
eloop: turn comment into non-gtkdoc comment

This comment does not use gtk-doc syntax so remove the extra *.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: add gtk-doc

This adds gtk-doc documentation builds to kmscon. All documentation is
build in a central place due to gtk-doc restrictions.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: video_fbdev: remove display_use()

fbdev does not support OpenGL contexts so there is no need to implement
this function. Instead, we will provide blitting support later.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: video: return -EOPNOTSUPP when opengl is not supported

When the backend does not implement display_use() then we return an error
instead of success to notify the application that it should use blitting
instead.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: video_fbdev: discard non-xrgb32 devices

We discard all non-xrgb32 devices for simplicity reasons for now. We
definitely need to support other devices in future but that makes the
backend unnecessarily complex at the beginning so avoid it.

This also moves the resolution-change to the beginning and duplicates the
tests so we can be totally sure that everything is right after setting the
correct values.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: video_fbdev: remove double check

There is no need to check this twice so move it beyond the last vinfo
modification.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: video_fbdev: test whether bpp is power of 8

I have never seen something different but lets be sure here and test for
modulo-8.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: video_fbdev: save stride on open

Copy stride into the fbdev structure so we can use it throughout the code.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
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>
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>
uterm: video_fbdev: make double-buffering optional

This makes double-buffering optional as not all drivers provide this. In
fact, only very few drivers implement this. Furthermore, this also adds a
fake display-mode that is used instead of NULL. Otherwise, the screen
object might not work as expected.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: video_drm: set .blit to NULL

We do not support blitting via drm (yet) so set it to NULL explicitely.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: add internal header for blitting support

Whoops, forgot to add it in the fbdev commit. Pushing it now so it works
again.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: video_fbdev: fix debug statements

Remove blitting debug statements as it is working fine now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
terminal: add debug message when removing display

This can help a lot when debugging displays that are registered multiple
times with a terminal object.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
terminal: create shader only when OpenGL is available

If the video backend does not provide an OpenGL context, there is no need
to create the gl shaders. We then use the 2D blitting functions instead.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
main: do not depend on OpenGL

We currently try activating the OpenGL context when adding a video device
to a seat. However, not all video backends provide OpenGL contexts so
remove this restriction. The terminal subsystem does all this by itself
now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
ui: enumerate displays on wakeup

We might have missed a display when our handler was not registered, yet.
So enumerate these displays on wakeup so we can be sure that we have all
displays registered with the terminal subsystem.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
video: return -EOPNOTSUPP in video_use without OpenGL

If OpenGL is not supported, we should _not_ return 0. Otherwise, there is
not convenient way to detect this scenario.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>