1139 Commits

Author SHA1 Message Date
David Herrmann
7416af5fd9 text: bblit: use bold fonts
This makes the bblit renderer use bold fonts for bold characters.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-08 13:59:10 +01:00
David Herrmann
3ff0992218 text: bbulk: implement bold-char renderer
Instead of always using the regular font, we now use the bold font for
bold characters.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-08 13:56:09 +01:00
David Herrmann
da58968095 terminal: allocate bold fonts
This makes the terminal layer allocate bold fonts (and use normal fonts as
fallback) and pass it to the text layer. This allows the text layer to
actually draw bold characters.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-08 13:55:04 +01:00
David Herrmann
4368500596 text: add bold font as separate font object
We now allow the user to specify the font that is used for bold
characters. If NULL is given, the normal font is used.

The bold font is not used by any renderer backend, yet, but will be hooked
up later.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-08 13:40:37 +01:00
Matthew Monaco
d4a1f69fe3 Add kmscon@.service
This almost certainly can be optimized, but we should be able to mask
getty@.service with kmscon@.service.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-05 17:36:57 +01:00
Ran Benita
75f59c54ba uterm: input: uxkb: properly handle changed keyboard state on wake up
Fix the problems caused by the keyboard state getting out-of-sync with
the xkb_state while the device is asleep (instead of the current hack).
The problem is described in a comment and in the removed FIXME.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-05 15:00:41 +01:00
Ran Benita
a6b3ae861c uterm: input: don't test device capability in wakeup_dev
The current code ignores non-keyboard devices, and various places
implicitly assume that it does. If we ever need finer granularity, we
should review (and probably restructure) the code for that; but for now
this test seems out of place.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-05 14:56:25 +01:00
David Herrmann
a9b12b22ac uterm: vt: avoid blocking SIGUSR1/2 twice
eloop does already block signals that we register callbacks for so we do
not have to block it manually here.
Note that the signal-handlers are registered _before_ doing the backend
initialization so we also avoid the previously fixed race-condition.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-05 14:52:25 +01:00
David Herrmann
614fe3dc81 uterm: vt: keep graphics mode during VT switch
If we open a VT, we assume that we are the only user on it. Therefore, we
put it into graphics mode _once_ and keep it this way. Resetting it to
text mode is useless, as there is no other user and every VT has its own
modes.

This also fixes page-flip issues during VT-switches which caused the
text-mode fbdev layer to claim one vertical-sync for their own page-flip
only for us to override it immediately after it is done.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-05 14:47:38 +01:00
David Herrmann
8e837167c5 uterm: vt: add fake_open/close() helpers
Instead of doing the backend initialization directly in uterm_vt code, we
now use fake_* helpers similar to real_* helpers.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-05 14:45:22 +01:00
David Herrmann
e7c8e7b531 uterm: vt: allow VT-deactivation to fail
If we dispatch VT-deactivation to child-processes, we might allow them to
abort the VT-switch, so the upper layer (uterm_vt) must also allow us to
abort the VT-switch.
During shutdown, we need to force the deactivation to guarantee that a VT
is inactive during shutdown.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-05 14:18:41 +01:00
David Herrmann
68af064040 seat: clean up session-callback function type
We use structures to pass information in all callbacks so we always get 3
arguments: parent, parameters, data
Also change the return type to int so we can catch errors when changing
session stati.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-11-02 18:25:49 +01:00
David Herrmann
f448fdb3f8 cdev: implement KDSKBMODE/KDGKBMODE ioctls
These ioctls change/retrieve the keyboard mode. We only support K_UNICODE,
K_RAW and K_OFF. Even K_RAW isn't supported fully as it is unclear what it
is supposed to do.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-29 21:08:15 +01:00
David Herrmann
9573302e26 cdev: implement KDSETMODE/KDGETMODE ioctl stubs
These ioctls are used to change from TEXT to GRAPHICS mode. We currently
do not support GRAPHICS mode correctly, but this will be added later.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-29 21:02:57 +01:00
David Herrmann
dd2fea4f96 cdev: implement basic ioctl() stubs
This commit adds stubs for every ioctl() that we need to support so an
xserver can run on this fake VT.
There are a lot more ioctl()s that can be invoked on TTYs and VTs, but we
currently do not intend to support these. If there is an application that
uses these and it makes sense to run it under kmscon, we will add the
needed ioctls.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-29 20:35:36 +01:00
David Herrmann
b626a85206 shl: ring: add shl_ring_flush() helper
This helper flushes all messages from the ring buffer and releases the
memory.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-29 20:34:52 +01:00
David Herrmann
9cc9008866 build: fix typo in configure.ac regarding cdev-sessions
A missing "test" keyword causes bash to fail executing this statement. Fix
this.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-29 20:34:03 +01:00
David Herrmann
61f4a3c29b kmscon: enable --all-gpus by default
Users with multiple GPUs that cannot be used simultaneously should pass
--no-all-gpus if they encounter problems or use --video-devices
explicitly. However, we cannot rely on PRIMARY flags being set for all
kinds of setups. Instead, default behavior should be using all available
GPUs unconditionally (except the safe DRM_BACKED and fbdev PRIMARY logic).

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-29 18:29:52 +01:00
David Herrmann
22e73357ff uterm: monitor: put systemd-layer into separate file
This moves all systemd code into uterm_systemd.[ch]. This removes all the
ugly #ifdef's.

Furthermore, this fixes some hidden bugs in the previous implementation
and makes use of sd_booted() to see whether runtime systemd is really
available.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-29 18:09:35 +01:00
David Herrmann
c827720f48 uterm: vt: fix real VTs when opening the currently active VT
We always assumed that the currently active VT is never the VT we open.
However, this is not true so schedule a VT-activation if this happens.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 17:38:28 +01:00
David Herrmann
0eb8d17590 uterm: drm: fix device-detection if no master is active
If we try to detect a device name if no master is active, the
drmGetBusid() call will always return an empty string. Therefore, try to
become drm-master and set the correct interface version before doing this.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 17:37:18 +01:00
David Herrmann
150f976b64 uterm: vt: put input devices asleep when inactive
There is no need to keep the input-devices around while another VT is
active.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 16:56:50 +01:00
David Herrmann
9fb08904a9 uterm: input: fix stopping key-repeat when going asleep
We need to stop each key-repeat when putting input-devices to sleep.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 16:54:07 +01:00
David Herrmann
4a4ccec363 uterm: vt: fix race by blocking signals before setting them
We must block the signals before setting the signal handlers to avoid
retrieving them asynchronously.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 16:17:18 +01:00
David Herrmann
616d5bbf6d uterm: drm: clear new buffers after allocation
Framebuffers are not guaranteed to be cleared after we allocate them.
Therefore, clear them as all the other uterm-video backends do.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 16:11:06 +01:00
David Herrmann
29e838ab2f kmscon: change default grab for "sesison-close" to "BackSpace"
Session management should be done with global keys. This allows us to use
the known "w", "t", "n" keys for "close", "new tab", "new window" etc.
functionality later.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 16:06:26 +01:00
David Herrmann
a9c61f7644 kmscon: add --video-devices option
If all the auto-detection logic of kmscon still does something you don't
want, you can now use this list to override all this logic with a
statically configured white-list.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 16:02:28 +01:00
David Herrmann
fb2006fe9a shl: add shl_string_list_is() helper
This helper tests whether a string-list has only a single entry and
compares this with the given entry.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 16:01:47 +01:00
David Herrmann
bedba7a7e3 uterm: monitor: mark vesafb devices as primary
VESA VGA devices are platform devices so they are always primary.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 15:40:56 +01:00
David Herrmann
8bd338f8b1 kmscon: remove deprecated /etc/kmscon.conf support
This was supported for backwards-compatibility, but is no longer
supported. Use the new /etc/kmscon/kmscon.conf files.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 15:23:09 +01:00
David Herrmann
3085b252ca kmscon: replace --fbdev/--dumb with --drm/--hwaccel
The old options were quite stupid and low-level. It doesn't make sense to
require users to understand "--dumb" (besides, it sounds wrong).

Therefore, two new options replace the old options:
 --drm: Enabled by default. If true, kmscon uses primary DRM devices and
        avoids primary fbdev devices. If false, kmscon uses no DRM devices
        at all but uses primary fbdev devices now.
 --hwaccel: Disabled by default. If true, kmscon tries to
            hardware-accelerate any rendering if available. This can also
            affect fbdev or other devices in the future.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 15:20:20 +01:00
David Herrmann
3e1f9f0c61 uterm: add uterm_video_available() helper
This helper provides information whether a given backend is available and
even whether kernel-runtime support is available for this backend.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 15:17:36 +01:00
David Herrmann
b1c7902eeb uterm: enable DRM helpers with UTERM_VIDEO_DUMB
The DRM helpers can actually also be used with dumb-displays so provide it
in both cases.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-28 14:22:19 +01:00
David Herrmann
16cf16c1aa NEWS: add kmscon-6 entries
Add entries for all main features since kmscon-5.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 19:22:56 +02:00
David Herrmann
f5a98b0c6b kmscon: fix --fbdev implying --all-gpus
We currently have no code that sets PRIMARY flags for fbdev devices so
this logic does not make sense with --fbdev. Hence, imply --all-gpus when
--fbdev is set.

Reported-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 19:21:56 +02:00
David Herrmann
e495126c80 kmscon: add --xkb-model option
This option now allows the user to change the XkbModel from the command
line or configuration file.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 19:00:43 +02:00
David Herrmann
8f79d860c1 uterm: input: allow passing "model" for keyboard descs
We set the model to a system-default, which means, we are hosed if the
system-default is not what the user expects. Therefore, allow setting the
model via internal APIs.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:55:21 +02:00
David Herrmann
3c9a3f3e2d kmscon: turn --switchvt on by default
We really _want_ this so turn it on by default. Especially for fake-VTs,
this really should be turned on all the time.
Use --no-switchvt to disable it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:50:50 +02:00
David Herrmann
797675953b conf: fix CONF_OPTION_BOOL warnings
We need to cast the boolean to void* to avoid warnings when using "true"
as default value instead of "false" (which evaluates to 0 => NULL).

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:50:03 +02:00
David Herrmann
9d2018f521 build: fix "make check" build failures
I forgot again to keep these up to date. The conf-layer updates broke them
horribly. However, we now build them correctly without kmscon-core by
including all required layers directly.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:32:43 +02:00
Ran Benita
6e05334695 tsm_vte: don't interpret Pause, it hangs the VTE
Pressing the 'Pause/Break' key causes the VTE to hang with no apparent
way to recover (from within kmscon). It must turn on some software flow
control, XON/XOFF or whatever.
We might want to do something with this key, but certainly not *that*.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:21:11 +02:00
Ran Benita
a939a9e59f tsm_vte: don't send sequence for Scroll_Lock
This value should not be sent to the application; currently pressing
Scroll Lock does some weird character transposing, which I believe to be
completely accidental.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:17:25 +02:00
Ran Benita
c8f79aa53d tsm_vte: bind non-numlock'ed keypad keys correctly
When a user presses on the 4 key on the keypad with NumLock off, the
expected behavior is to move left. This commit fixes all of the main
keypad keys to act like their counterparts (though KP_Begin is not
bound to anything).
This is also what xterm does, as far as I can tell:
http://anonscm.debian.org/gitweb/?p=pkg-xorg/app/xterm.git;a=blob;f=input.c;h=f049078ed672c1da5adc169e85dc458b0fffc100;hb=HEAD#l984

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:13:42 +02:00
Ran Benita
b5c05dd5f1 uterm_input_uxkb: update leds to match keyboard state
Upon device wakeup or led state changes, we update the keyboard LEDs to
match the new xkb state.

This means that every kmscon instance retains its own LED state, in the
users eyes. In other words, if you had Num Lock set on one kmscon, switched
to an X VT where it's off, and come back, then Num Lock will be set as
when you left. This is what X server, linux VT, etc. do.

Note that since we need to write the LED events to the evdev devices, we
need to open them RDWR. But since we don't really care what happens to
that write(), that's fine.

Also note that this means NumLock is off by default, which might be
annoying. We need to think how to get some 'setleds' or 'numlockx'
equivalent functionality.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:12:59 +02:00
Ran Benita
28c8d07109 uterm_input: change device 'feature' to device 'capability'
'capability' seems to be the common terminology for this, and it sounds
better - so use it.

We also move the enum definition to the header, because otherwise the
'capabilities' field there doesn't make sense.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:08:30 +02:00
Ran Benita
874bbbe17a uterm_input: remove supporting code for updating LED state
Before we transitioned to xkbcommon, we had some code that, upon
returning from a VT-switch, looked at the evdev led state and updated
the keyboard modifier state accordingly. So if we returned and NumLock
was on, we adjusted ourselves to that. That was pretty cute.

xkbcommon however doesn't support updating the state by LEDs like that.
Normally, the state of the LEDs is derived from the modifiers; going the
other way is tricky, error-prone and not used much. What we should be
doing is updating the LEDs according to *our* state.

This commit does the part of removing the unused dead code.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:08:05 +02:00
Ran Benita
2843c80c5b xkb: use system defaults instead of "us" for layout
libxkbcommon has a configure option to set the default values for the
RMLVO's (if they are passed as NULL or "" - we use "" so it'd be safe to
print). If they are not specified there, it's just "us" like we currently
do have. But if they are specified, we should most likely defer to it.

We do the same for the model field, instead of hardcoding "evdev". The
rules field remains hardcoded to "evdev", because we rely on it when
doing the evdev scancode-to-keycode +8 mapping.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:06:43 +02:00
Ran Benita
ae78864cc9 xkb: don't use deprecated libxkbcommon symbols
Now that libxkbcommon had a release, that has some API breakage (in
particular to xkb_keysym_from_name), we should update our code against
it and advise users to just use the xkbcommon release.

This should not happen anymore, for the foreseeable future at least.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:05:59 +02:00
David Herrmann
5be8972270 kmscon: add --primary-gpu-only and --all-gpus options
By default, kmscon now only uses primary und auxiliary displays. All
uncategorized displays are ignored. This fixes problems with dual-GPU
systems.

--primary-gpu-only makes kmscon not use any auxiliary displays. --all-gpus
makes kmscon also use uncategorized displays.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 18:00:27 +02:00
David Herrmann
dbd5fa7e74 uterm: monitor: mark auxiliary devices
We now mark auxiliary displays specially so applications know which
devices can be used independently. We currently only mark USB devices as
such but this can be extended in the future for more devices.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-27 17:46:48 +02:00