339 Commits

Author SHA1 Message Date
David Herrmann
728f4a1b18 gl: add stride parameter to texture upload
Allow to specify the stride when uploading data into a texture.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-31 22:44:37 +02:00
David Herrmann
f091b2b763 misc: replace all GHashTable with kmscon_hashtable
We use a new wrapper to move all glib deps to central points so we can
replace them easily.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-30 18:49:04 +02:00
David Herrmann
2707ba7336 misc: hash-table wrapper
We want to move away from glib eventually. Until then, we use a simple
wrapper around the hash-table functions so we need to change a single
place only.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-30 18:42:12 +02:00
David Herrmann
046833530c console: fix log messages
Use LOG_SUBSYSTEM and remove trailing newlines.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-30 15:55:23 +02:00
David Herrmann
8baea629f9 vte: fix log messages
Use LOG_SUBSYSTEM and remove trailing newlines.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-30 15:51:33 +02:00
David Herrmann
c4716ad6ce font_freetype2: fix log messages
Use LOG_SUBSYSTEM and remove newlines.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-30 15:49:28 +02:00
David Herrmann
668052401e conf: add --seat parameter
The --seat parameter specifies which seat is used for drm and input
devices. Default is seat0.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-29 18:04:39 +02:00
David Herrmann
262a0e98a0 conf: fix negative getopt_long parameters
I don't know the reason but negative values don't work here. We simply use
big integers now to avoid clashes with valid getopt() values.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-29 18:03:21 +02:00
David Herrmann
c9ea08d9b5 unicode: use static global symbol table
A symbol table should never be created twice therefore we can make it
static and global. We add locks so it is totally thread-safe, too.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-29 16:17:55 +02:00
David Herrmann
a31455a10b unicode: fix logging messages
Use new logging style in unicode layer.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-28 17:20:13 +02:00
David Herrmann
1648c9101b Update README
Fix some small typos and add TODOs.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-27 16:48:27 +02:00
David Herrmann
f02d745928 Bump version number to 1
We use a single version number. The current state seems to be pretty
stable and has all the important features regarding the DRM/input setup.
Only missing stuff is VTE and console.
This is no stable release but rather a first development release.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-27 16:42:31 +02:00
David Herrmann
622f3c72e2 terminal: rework API
We now use the new input/video hooks to avoid waking up the UI all the
time. This reduces the code in the generic UI subsystem and makes the
terminal handle all the stuff.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-27 16:11:38 +02:00
David Herrmann
3bcce95be3 pty: add kmscon_pty_signal()
Allow to send arbitrary signals to the foreground process group of the
pty. Linux supports the TIOCSIG ioctl so we actually do not need to
implement this on our own, yeah!

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-27 13:35:41 +02:00
David Herrmann
84b87c320b pty: avoid calling callbacks twice
We shouldn't call the close-cb twice. Therefore, correctly free the FD on
first error, however, keep the signal-callback to get nice log-messages.
Only when the user calls *_close() we eventually stop everything.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 19:14:30 +02:00
David Herrmann
9a2e025475 eloop: wait for all childs
Move child-waiting into the eloop subsystem so all childs are always
correctly freed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 19:02:23 +02:00
David Herrmann
3935a77439 pty: fix using right fd
Use right fd when spawning child process.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 18:50:30 +02:00
David Herrmann
5cdf94711b pty: random fixes
Fix some random coding-style issues and adjust to new eloop-rules.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 18:37:45 +02:00
David Herrmann
e0546adcaa pty: correctly terminate when child_setup fails
We currently return "ret" when child setup fails, however, we should
rather call exit(). Also avoid cleaning up as this is impossible here
anyway.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 18:16:05 +02:00
David Herrmann
0392fb8c49 pty: fix wrong fd check
FDs may be 0 so check for >= and not > for fds.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 18:10:27 +02:00
David Herrmann
6bcc73666a pty: fix race when starting child
We should do fork() as the last operation when starting the child.
Currently, if our eloop-add() fails, we have a started child but return
failure to the caller. Therefore, the child will stay alive but we do not
use it.

We now perform all startup correctly before fork()'ing so we are always
safe when starting the child.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 18:06:33 +02:00
David Herrmann
21f6bbb15d eloop: remove old signal sources
Remove the old non-shared signal sources in favor of shared-signals.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 17:59:58 +02:00
David Herrmann
524cfb0093 vt: use new shared signals
Use the new shared-signal backend so we can finally remove the old
signals.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 17:58:17 +02:00
David Herrmann
9e87b853ab use pthread_sigmask instead of sigprocmask
pthread is already in our vmem due to our dependencies so link to it
explicitly and use pthread_sigmask to avoid buggy sigprocmask in
multi-threaded applications.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 17:53:16 +02:00
David Herrmann
f545d9641a main: use new shared signals
Use the shared signal-implementation instead of the generic signals.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 17:44:58 +02:00
David Herrmann
580b0a7992 eloop: add shared signal callbacks
Our current signal source has the problem that a single signal event is
only delivered to one random registered source. This is the design of the
signalfd kernel feature. However, for signals like SIGCHLD it is often
desired to have multiple callbacks. Hence, while keeping the old
signal-source, we now also allow a shared signal source. It is registered
the same way as the old signal source but uses a shared hook.

We may remove the old source so we don't use it in the new implementation.
There are still problems when multiple eloops are used in a single
process and you register the same shared-signum in both eloops. However,
such a design is bad anyway, so we don't care.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 17:39:55 +02:00
David Herrmann
56f5eebf0e hook: delete by callback *and* data argument
When deleting a hook we should not search for the callback only. Otherwise
we might remove the wrong callback. Therefore, we now search for callback
and data argument. If multiple callbacks are registered with the same data
and cb, then we don't care which one is removed as this wouldn't make any
difference. They behave the same way, anyway.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 17:08:00 +02:00
David Herrmann
ac9df3aac5 eloop: catch EINTR in epoll_wait()
epoll_wait() returns EINTR even if using SA_RESTART for signals.
Therefore, catch EINTR and set count to zero.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 16:45:39 +02:00
David Herrmann
c0030f47c2 conf: fix local storage of default argv
We assigned stack-storage to a global pointer and therefore we got
seg-faults when using the default. Fix that.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 16:22:27 +02:00
David Herrmann
b1cb8c918c pty: use reentrant ptsname_r
Avoid static storage in pty subsystem and use the ptsname_r extension.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-25 16:18:03 +02:00
David Herrmann
8773331331 pty: introduce --term
Allow setting TERM to different values than the default with a
command-line switch.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 18:15:50 +01:00
David Herrmann
ec2dfaa244 pty: add --login option
Allow to specify a separate login-program that is executed instead of the
default. All arguments specified after --login are considered argv[] of
the new process and not parsed by the library.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 18:10:55 +01:00
David Herrmann
d98dba57d3 pty: fix log statements
Remove new-lines and add LOG_SUBSYSTEM.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 17:44:42 +01:00
David Herrmann
4b9bc46226 Fix some signed/unsigned warnings
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 17:04:42 +01:00
David Herrmann
813e5655e0 main: wait for child processes
Add SIGCHLD handler and wait for exiting child processes to avoid zombies.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 16:44:33 +01:00
David Herrmann
54973fb341 uterm_video: set displays after waking up
Set CRTC state correctly after waking up. Otherwise the displays will keep
their previous state until the next redraw.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 16:02:30 +01:00
David Herrmann
ec6e095a64 uterm_video: check online-state before swapping
Check whether the display is online before swapping buffers in DRM
backend.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 16:01:13 +01:00
David Herrmann
ead3172d49 main: use ui subsystem
Use the new UI subsystem in the main application. The kmscon application
provides now the same functionality as the test_terminal application.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 15:44:36 +01:00
David Herrmann
e6d3d3f5b1 ui: add user interface subsystem
The UI subsystem starts the terminals, switches between them and draws the
screen.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 15:44:06 +01:00
David Herrmann
fded606baa input: change callback logic
Allow multiple callbacks and notify all about new input.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 15:22:23 +01:00
David Herrmann
e6db44385b uterm_video: add callback
Allow applications to register callback and notify them about new or gone
displays.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 15:21:57 +01:00
David Herrmann
c04c807eca misc: add hook structure
The hook structure can be used to provide a central hook where other
subsystems can register callbacks.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 15:12:37 +01:00
David Herrmann
a13797ac76 uterm_video: fix drm debug messages
Print more verbose messages on DRM errors.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 14:15:53 +01:00
David Herrmann
00c34e1685 kbd_*: fix log messages
Remove new-lines again and set subsystem automatically.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 13:54:27 +01:00
David Herrmann
84f1883809 xkb: use new API
libxkbcommon-git did some API changes

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 13:42:16 +01:00
David Herrmann
6072a4ea53 test_terminal: parse command line arguments
Parse command line arguments so the input subsystem recognizes the XKB
values.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 13:41:30 +01:00
David Herrmann
75339df698 input: fix kmscon_input_device_wakeup protection
We cannot check for dev->fd as the fd is only set when the input device
has keys. Therefore check for rfd now.
Also remove the NULL check in *_sleep() as it is not needed. All public
APIs allow passing NULL.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 13:20:52 +01:00
David Herrmann
18d829bd39 input: remove refcnt in input-devices
Input-devices are used internally only so we do not need refcounts.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 13:20:01 +01:00
David Herrmann
9f695c042f input: fix log-messages
Remove newline from log-messages and set LOG_SUBSYSTEM to "input". Also
fix some small indentation issues.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 13:19:02 +01:00
David Herrmann
f8dc74c297 conf: add --xkb-XY options
Allow setting XKB options on the command line.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-03-24 13:02:48 +01:00