Commit Graph
25 Commits
Author SHA1 Message Date
David Herrmann 720d8d8dfd uterm: video: greatly enhance performance by special casing
If we special-case the "src == 0" and "src == 0xff" cases, then we can
avoid all the heavy calculations most of the time. This reduces rendering
time by like 50%.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-09-04 17:56:03 +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 efce8e1747 uterm: video: improve blitting performance
Turns out gcc didn't optimize this trivial math so we do it by hand. This
reduces the number of divisions per color to 1. This increases performance
by like 15%.

As a second optimization, we replace the division with a left shift, that
is, we divide by 256. Technically, this is wrong as we will get slightly
incorrect results. However, this is hardly noticible by human eye so we
can safely use it. This increases performance by like 20% again.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-29 17:56:38 +02:00
David Herrmann bed915dfb6 uterm: video: fbdev: add support for non xrgb32 devices
This adds blitting/blending/filling support for devices which are not the
classic xrgb32 device. bpp=24 is not supported as it is still unclear how
3-byte integers look like in mixed/big endian.

This uses a very basic dithering technique to check for errors between the
real and computed values which is then distributed horizontally only.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 13:51:10 +02:00
David Herrmann faa12b6a61 uterm: fbdev: add udlfb workaround
udlfb incorrectly reports framebuffer sizes. That is, if we request a
framebuffer twice the size as the real framebuffer for double-bufferring,
it will accept these values and report success. We can even map this
virtual framebuffer successfully! However, the memory that is internally
allocated is only the real smaller framebuffer and we will get segfaults.
This might even leak internal kernel memory so we should fix this on
kernel-side as soon as possible.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-08-11 11:32:55 +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 6ab01cbf6b uterm: video: fix blit() and fill() height adjustments
Whoops, we missed the last line for all blit()/fill() operations. Fix the
decrement to correctly count as many lines as given.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-31 13:35:18 +02:00
David Herrmann 254cb5f6cb uterm: video: remove fbdev_display_map() orphan
The dummy fbdev backend included this function to allow outside access to
the framebuffer. This has for long been replaced with blit() and fill()
helpers and it was never actually implemented. Hence, remove the helper
function.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-31 10:32:43 +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 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 a67df3a069 video: fbdev: fix freeing fake display
We currently leak the fake display that is created for every fbdev video
device. Fix this by simply freeing this device during destruction.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-07-21 21:01:22 +02:00
David Herrmann 651d1ed980 uterm: remove libudev.h includes if not needed
All udev-dependencies are now moved into uterm-monitor. This allows us to
easily make udev optional for hotplug-less systems or emergency setups.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-29 12:49:37 +02:00
David Herrmann f1326b2728 static: move statically linked subsystems to static_*
Small stuff that is not worth putting into a separate library is no moved
into the "static" library which is statically linked into all our
subsystems.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-06-24 20:35:22 +02:00
David Herrmann 10cb9fdee0 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>
2012-06-24 01:09:40 +02:00
David Herrmann 66b7cce2cf 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>
2012-06-24 01:04:50 +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 c8fbc14425 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>
2012-06-23 22:54:52 +02:00
David Herrmann 8c64daa5df 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>
2012-06-23 22:52:24 +02:00
David Herrmann f7e6e1b19b 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>
2012-06-23 22:46:42 +02:00
David Herrmann ec46dc2909 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>
2012-06-23 22:39:48 +02:00
David Herrmann 59f4e84519 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>
2012-06-23 21:56:43 +02:00
David Herrmann a36b66cc77 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>
2012-06-23 18:24:44 +02:00
David Herrmann c4f68e36c1 fbdev: add few implementation hints
fbdev is still not ready but we add some hints so implmenting it later
will be easier.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-05-18 16:42:32 +02:00
David Herrmann 62a3db3e9c uterm_video: add dummy fbdev backend
The fbdev backend is non-functional, but we add it for documentational
purposes. It is not built as part of kmscon.

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