platform/upstream/libtsm.git
10 years agoscreen: add screen-age to API
David Herrmann [Wed, 23 Oct 2013 13:31:03 +0000 (15:31 +0200)]
screen: add screen-age to API

This adds the "ageing"-concept to the screen API. Each cell now has an
integer attached which describes its age. Furthermore, the whole screen
has an age-counter which is increased on every change we do on the screen.
Whenever we modify a cell, we increase the age-counter and set the age of
the cell to the current value of the age-counter.

During rendering, we pass the age of the cell to the cell-renderer.
Furthermore, once rendering is done, we return the current screen age.
This allows renderers to save the age of the screen with a framebuffer.
Once a specific framebuffer is redrawn, only cells with a newer age need
to be updated. Everything else can be skipped.
By saving the age with the framebuffer, this even allows multi-buffered
applications to make use of this (also see the EGL buffer-age ext for a
similar feature).

Note that the age-counter might overflow. We return 0 in that case (which
is an invalid age). Applications need to reset *all* their framebuffer
ages if that happens.

Note that non-ageing-aware applications can simply ignore the new feature
(apart from changing the draw-cb) and it'll work as before.

This does _not_ implement the real ageing feature. It only adds the API.
We currently always return 1 as age, which is wrong.. We need to fix the
whole code to increase ages correctly, which can get quite tricky if we
want the scrollback-buffer to work, too.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agoscreen: reset buffer-link on screen-reset
David Herrmann [Wed, 23 Oct 2013 13:23:54 +0000 (15:23 +0200)]
screen: reset buffer-link on screen-reset

We need to reset the lines-link to main_lines during reset, otherwise the
alternate buffer stays active (which is not what we want).

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agoscreen: minor coding style fixes
David Herrmann [Tue, 22 Oct 2013 14:53:47 +0000 (16:53 +0200)]
screen: minor coding style fixes

Fix some coding-style issues and minor logical redudancy. Also improve the
file-documentation to correctly describe what tsm_screen does today.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agoscreen: clear padding of main-lines on resize
David Herrmann [Tue, 22 Oct 2013 14:28:02 +0000 (16:28 +0200)]
screen: clear padding of main-lines on resize

The invisible padding during width reduction is not cleared as we clear
it when it gets visible again. However, if the line is pushed into
scrollback in between, it may get visible once the width is increases
again. Hence, clear padding of main-lines if screen-width is decreased.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agoscreen: remove empty cell fallback
David Herrmann [Tue, 22 Oct 2013 13:53:31 +0000 (15:53 +0200)]
screen: remove empty cell fallback

If we resize our screen, we guarantee that all cells are allocated. This
hasn't been true in the early times so we needed an empty cell during
rendering as fallback. It's no longer needed so remove it.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agoscreen: remove prepare/render callbacks
David Herrmann [Tue, 22 Oct 2013 13:38:14 +0000 (15:38 +0200)]
screen: remove prepare/render callbacks

Again, some leftovers from kmscon. There's no reason to provide these
callbacks. Users can just call the, before/after calling into TSM.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agobuild: remove shl_timer.h
David Herrmann [Tue, 22 Oct 2013 13:36:04 +0000 (15:36 +0200)]
build: remove shl_timer.h

This helper is now unused, remove it.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agoscreen: remove timer
David Herrmann [Tue, 22 Oct 2013 13:34:24 +0000 (15:34 +0200)]
screen: remove timer

This is still a leftover from kmscon. Remove it, if users want it, they
should implement it themselves.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agoscreen: correctly clear expansion area
David Herrmann [Tue, 22 Oct 2013 13:07:59 +0000 (15:07 +0200)]
screen: correctly clear expansion area

We incorrectly clear the alternate-screen and width-extensions. Fix this.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agoAdd support for blink screen attribute
Marcin Kulik [Sat, 17 Aug 2013 10:33:36 +0000 (12:33 +0200)]
Add support for blink screen attribute

The blink attribute is enabled via m-CSI 5 and disabled via 25. It's up to
the renderer to do anything useful with it.

Signed-off-by: Marcin Kulik <m@ku1ik.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agoAdd test infrastructure
David Herrmann [Mon, 19 Aug 2013 21:22:51 +0000 (23:22 +0200)]
Add test infrastructure

Add "make check" test suite and some initial hashtable dummy tests. More
comprehensive tests can be added later.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agogitignore: ignore release tarballs
David Herrmann [Sat, 17 Aug 2013 13:02:11 +0000 (15:02 +0200)]
gitignore: ignore release tarballs

Ignore tar.xz tarballs from "make dist".

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agobuild: remove non-existant shl_dlist.h reference
David Herrmann [Sat, 17 Aug 2013 13:01:34 +0000 (15:01 +0200)]
build: remove non-existant shl_dlist.h reference

We don't use the linked list helper, so remove this reference.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agobuild: add xkbcommon-keysyms.h to sources
David Herrmann [Sat, 17 Aug 2013 13:00:08 +0000 (15:00 +0200)]
build: add xkbcommon-keysyms.h to sources

We need to add this file to the list of source files. Otherwise, dists
might not include it.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agoInclude libtsm.h instead of sub-headers
David Herrmann [Sat, 17 Aug 2013 12:59:29 +0000 (14:59 +0200)]
Include libtsm.h instead of sub-headers

Move all source files to include libtsm.h directly. This will get rid of
the recently introduced warnings if sub-headers are included directly.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agoMove all public header information into libtsm.h
David Herrmann [Sat, 17 Aug 2013 12:56:04 +0000 (14:56 +0200)]
Move all public header information into libtsm.h

Avoid splitting all information across different headers. But keep the old
headers and add #warning's before including libtsm.h.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agoMove tsm.h to libtsm.h
David Herrmann [Sat, 17 Aug 2013 12:49:43 +0000 (14:49 +0200)]
Move tsm.h to libtsm.h

I want to get rid of the header mess and move everything public into a
proper single public header. There is no reason to keep everything
separate once we make libtsm a proper library.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agobuild: fix logic in msg regarding optimizations
David Herrmann [Sat, 17 Aug 2013 12:02:20 +0000 (14:02 +0200)]
build: fix logic in msg regarding optimizations

While we enable optimizations by default and thus invert the logic in help
text, the actual check still is non-inverted. Hence, print the correct
message during ./configure.

Reported-by: Marcin Kulik
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
10 years agoInitial import of libtsm
David Herrmann [Tue, 13 Aug 2013 14:50:38 +0000 (16:50 +0200)]
Initial import of libtsm

This is a copy of libtsm from the kmscon repository. It has no external
dependencies except glibc. libxkbcommon should be provided during
compile-time. If not, a fallback header is used.

The library interface is not stable, yet! There is still a lot to do
before we release libtsm-1.

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