Send plymouth mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.freedesktop.org/mailman/listinfo/plymouth
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of plymouth digest..."
Today's Topics:
1. [PATCH 09/21] [terminal] drop next_active_vt (Scott James Remnant)
2. [PATCH 18/21] [x11] default renderer to inactive
(Scott James Remnant)
3. [PATCH 15/21] [terminal,text,details] move activate vt into
plugins (Scott James Remnant)
4. [PATCH 05/21] [terminal] add ply_terminal_is_vt() function
(Scott James Remnant)
5. [PATCH 16/21] [drm] default renderer to inactive
(Scott James Remnant)
6. [PATCH 19/21] [terminal] guard open and close against
repeated calls (Scott James Remnant)
7. [PATCH 07/21] [terminal] drop support for opening the
foreground terminal (Scott James Remnant)
8. [PATCH 06/21] [terminal] only support vt-like operations on
VTs (Scott James Remnant)
9. [PATCH 02/21] [terminal] remove references to ply_console_t
(Scott James Remnant)
----------------------------------------------------------------------
Message: 1
Date: Thu, 18 Mar 2010 04:32:26 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 09/21] [terminal] drop next_active_vt
To: [email protected]
Message-ID:
<2d3eee3556fad2ad278e83f3a6841b2affe7e2cc.1268889867.git.sc...@ubuntu.com>
When we activate our VT, now we actually have it in VT_PROCESS not the
VT we started from, we get the proper signal so don't need an ioctl to
wait until its active.
If we were to leave our VT, we'd get the opposite signal as well and
we don't really care whether we actually get to the other VT, just
that we leave ours.
And this code was in the wrong place anyway.
---
src/libply-splash-core/ply-terminal.c | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/src/libply-splash-core/ply-terminal.c
b/src/libply-splash-core/ply-terminal.c
index e0baf2e..3e54075 100644
--- a/src/libply-splash-core/ply-terminal.c
+++ b/src/libply-splash-core/ply-terminal.c
@@ -65,7 +65,6 @@ struct _ply_terminal
char *name;
int fd;
int vt_number;
- int next_active_vt;
ply_list_t *vt_change_closures;
ply_fd_watch_t *fd_watch;
@@ -336,12 +335,6 @@ on_leave_vt (ply_terminal_t *terminal)
{
ioctl (terminal->fd, VT_RELDISP, 1);
- if (terminal->next_active_vt > 0)
- {
- ioctl (terminal->fd, VT_WAITACTIVE, terminal->next_active_vt);
- terminal->next_active_vt = 0;
- }
-
terminal->is_active = false;
do_active_vt_changed (terminal);
}
@@ -688,8 +681,6 @@ set_active_vt (ply_terminal_t *terminal,
if (ioctl (terminal->fd, VT_ACTIVATE, vt_number) < 0)
return false;
- terminal->next_active_vt = vt_number;
-
return true;
}
--
1.7.0
------------------------------
Message: 2
Date: Thu, 18 Mar 2010 05:04:33 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 18/21] [x11] default renderer to inactive
To: [email protected]
Message-ID:
<08c94a299f449ce5fc4805eeb7007e8c4fb34040.1268889867.git.sc...@ubuntu.com>
Change the renderer so that it defaults to inactive until we
map to the device.
---
src/plugins/renderers/x11/plugin.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/plugins/renderers/x11/plugin.c
b/src/plugins/renderers/x11/plugin.c
index a280bc7..0bf8ab2 100644
--- a/src/plugins/renderers/x11/plugin.c
+++ b/src/plugins/renderers/x11/plugin.c
@@ -85,7 +85,7 @@ struct _ply_renderer_backend
ply_fd_watch_t *display_watch;
- uint32_t is_inactive : 1;
+ uint32_t is_active : 1;
};
ply_renderer_plugin_interface_t *ply_renderer_backend_get_interface (void);
@@ -269,6 +269,9 @@ map_to_device (ply_renderer_backend_t *backend)
ply_renderer_head_redraw (backend, head);
node = next_node;
}
+
+ backend->is_active = true;
+
return true;
}
@@ -301,13 +304,13 @@ unmap_from_device (ply_renderer_backend_t *backend)
static void
activate (ply_renderer_backend_t *backend)
{
- backend->is_inactive = false;
+ backend->is_active = true;
}
static void
deactivate (ply_renderer_backend_t *backend)
{
- backend->is_inactive = true;
+ backend->is_active = false;
}
static void
@@ -341,7 +344,7 @@ flush_head (ply_renderer_backend_t *backend,
assert (backend != NULL);
- if (backend->is_inactive)
+ if (!backend->is_active)
return;
pixel_buffer = head->pixel_buffer;
--
1.7.0
------------------------------
Message: 3
Date: Thu, 18 Mar 2010 04:56:24 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 15/21] [terminal,text,details] move activate vt into
plugins
To: [email protected]
Message-ID:
<ed7a03d0834712af8ceb81049069e3d4e9fffcfc.1268889867.git.sc...@ubuntu.com>
Move the responsiblity to activate the VT into the text and details
plugins; this not only matches the graphical renderers, but it also
ensures we activate the VT in all possible code paths.
Previously if we fell back to text.so because we couldn't activate
a renderer, this would not activate the VT.
---
src/main.c | 2 --
src/plugins/splash/details/plugin.c | 3 ++-
src/plugins/splash/text/plugin.c | 3 ++-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main.c b/src/main.c
index 7c67c76..429d8c5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1011,8 +1011,6 @@ add_display_and_keyboard_for_terminal (state_t *state,
state->terminal = ply_terminal_new (tty_name);
- ply_terminal_activate_vt (state->terminal);
-
keyboard = ply_keyboard_new_for_terminal (state->terminal);
display = ply_text_display_new (state->terminal);
diff --git a/src/plugins/splash/details/plugin.c
b/src/plugins/splash/details/plugin.c
index d6980cf..05eddc6 100644
--- a/src/plugins/splash/details/plugin.c
+++ b/src/plugins/splash/details/plugin.c
@@ -202,7 +202,8 @@ add_text_display (ply_boot_splash_plugin_t *plugin,
view = view_new (plugin, display);
terminal = ply_text_display_get_terminal (view->display);
- ply_terminal_open (terminal);
+ if (ply_terminal_open (terminal))
+ ply_terminal_activate_vt (terminal);
ply_list_append_data (plugin->views, view);
}
diff --git a/src/plugins/splash/text/plugin.c b/src/plugins/splash/text/plugin.c
index 228e271..690f54b 100644
--- a/src/plugins/splash/text/plugin.c
+++ b/src/plugins/splash/text/plugin.c
@@ -484,7 +484,8 @@ add_text_display (ply_boot_splash_plugin_t *plugin,
view = view_new (plugin, display);
terminal = ply_text_display_get_terminal (view->display);
- ply_terminal_open (terminal);
+ if (ply_terminal_open (terminal))
+ ply_terminal_activate_vt (terminal);
ply_text_display_set_draw_handler (view->display,
(ply_text_display_draw_handler_t)
--
1.7.0
------------------------------
Message: 4
Date: Thu, 18 Mar 2010 04:07:33 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 05/21] [terminal] add ply_terminal_is_vt() function
To: [email protected]
Message-ID:
<348e49a4a199b1489c35bd02108c4a5a197ef4cd.1268889867.git.sc...@ubuntu.com>
We want to be able to query whether a terminal is an ordinary terminal
or a virtual terminal, rather than looking up the vt number and knowing
what the right numbers are, add a function that knows that.
---
src/libply-splash-core/ply-terminal.c | 8 +++++++-
src/libply-splash-core/ply-terminal.h | 1 +
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/libply-splash-core/ply-terminal.c
b/src/libply-splash-core/ply-terminal.c
index 7725eb4..a4a9e76 100644
--- a/src/libply-splash-core/ply-terminal.c
+++ b/src/libply-splash-core/ply-terminal.c
@@ -509,6 +509,12 @@ ply_terminal_get_fd (ply_terminal_t *terminal)
}
bool
+ply_terminal_is_vt (ply_terminal_t *terminal)
+{
+ return terminal->vt_number > 0;
+}
+
+bool
ply_terminal_is_open (ply_terminal_t *terminal)
{
return terminal->is_open;
@@ -712,7 +718,7 @@ ply_terminal_activate_vt (ply_terminal_t *terminal)
{
assert (terminal != NULL);
- if (terminal->vt_number <= 0)
+ if (!ply_terminal_is_vt (terminal))
return false;
if (terminal->vt_number == terminal->active_vt)
diff --git a/src/libply-splash-core/ply-terminal.h
b/src/libply-splash-core/ply-terminal.h
index 2c9c4f8..d3ac89b 100644
--- a/src/libply-splash-core/ply-terminal.h
+++ b/src/libply-splash-core/ply-terminal.h
@@ -60,6 +60,7 @@ void ply_terminal_free (ply_terminal_t *terminal);
bool ply_terminal_open (ply_terminal_t *terminal);
int ply_terminal_get_fd (ply_terminal_t *terminal);
+bool ply_terminal_is_vt (ply_terminal_t *terminal);
bool ply_terminal_is_open (ply_terminal_t *terminal);
void ply_terminal_close (ply_terminal_t *terminal);
void ply_terminal_reset_colors (ply_terminal_t *terminal);
--
1.7.0
------------------------------
Message: 5
Date: Thu, 18 Mar 2010 05:01:15 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 16/21] [drm] default renderer to inactive
To: [email protected]
Message-ID:
<89fca21f6d3625cdf069125c3928c8fa421c5c2e.1268889867.git.sc...@ubuntu.com>
Change the renderer so that it defaults to inactive, then when we
map to the device, activate the renderer by activating the VT;
unless the VT is already active in which case activate the
renderer directly.
---
src/plugins/renderers/drm/plugin.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/plugins/renderers/drm/plugin.c
b/src/plugins/renderers/drm/plugin.c
index 6d4ce9b..75c3927 100644
--- a/src/plugins/renderers/drm/plugin.c
+++ b/src/plugins/renderers/drm/plugin.c
@@ -111,7 +111,7 @@ struct _ply_renderer_backend
int32_t dither_green;
int32_t dither_blue;
- uint32_t is_inactive : 1;
+ uint32_t is_active : 1;
};
ply_renderer_plugin_interface_t *ply_renderer_backend_get_interface (void);
@@ -373,7 +373,7 @@ activate (ply_renderer_backend_t *backend)
{
ply_list_node_t *node;
- backend->is_inactive = false;
+ backend->is_active = true;
drmSetMaster (backend->device_fd);
node = ply_list_get_first_node (backend->heads);
@@ -398,7 +398,7 @@ deactivate (ply_renderer_backend_t *backend)
{
ply_trace ("dropping master");
drmDropMaster (backend->device_fd);
- backend->is_inactive = true;
+ backend->is_active = false;
}
static void
@@ -819,7 +819,10 @@ map_to_device (ply_renderer_backend_t *backend)
node = next_node;
}
- ply_terminal_activate_vt (backend->terminal);
+ if (ply_terminal_is_active (backend->terminal))
+ activate (backend);
+ else
+ ply_terminal_activate_vt (backend->terminal);
return head_mapped;
}
@@ -921,7 +924,7 @@ unmap_from_device (ply_renderer_backend_t *backend)
head = (ply_renderer_head_t *) ply_list_node_get_data (node);
next_node = ply_list_get_next_node (backend->heads, node);
- if (!backend->is_inactive)
+ if (backend->is_active)
{
ply_trace ("scanning out directly to console");
ply_renderer_head_set_scan_out_buffer_to_console (backend, head,
@@ -970,7 +973,7 @@ flush_head (ply_renderer_backend_t *backend,
assert (backend != NULL);
- if (backend->is_inactive)
+ if (!backend->is_active)
return;
ply_terminal_set_mode (backend->terminal, PLY_TERMINAL_MODE_GRAPHICS);
--
1.7.0
------------------------------
Message: 6
Date: Thu, 18 Mar 2010 05:06:11 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 19/21] [terminal] guard open and close against
repeated calls
To: [email protected]
Message-ID:
<e22d4ffda4d6ed384ba9d075fcc0070df75ee108.1268889867.git.sc...@ubuntu.com>
Since we have a status flag whether or not the terminal fd is open,
use it in the open and close functions to guard against repeated
calls.
---
src/libply-splash-core/ply-terminal.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/libply-splash-core/ply-terminal.c
b/src/libply-splash-core/ply-terminal.c
index 8f76ff0..6c81a72 100644
--- a/src/libply-splash-core/ply-terminal.c
+++ b/src/libply-splash-core/ply-terminal.c
@@ -436,6 +436,9 @@ ply_terminal_open (ply_terminal_t *terminal)
{
assert (terminal != NULL);
+ if (terminal->is_open)
+ return true;
+
ply_trace ("trying to open terminal '%s'", terminal->name);
if (!ply_terminal_open_device (terminal))
@@ -497,6 +500,9 @@ ply_terminal_is_active (ply_terminal_t *terminal)
void
ply_terminal_close (ply_terminal_t *terminal)
{
+ if (!terminal->is_open)
+ return;
+
terminal->is_open = false;
ply_terminal_stop_watching_for_vt_changes (terminal);
--
1.7.0
------------------------------
Message: 7
Date: Thu, 18 Mar 2010 04:20:17 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 07/21] [terminal] drop support for opening the
foreground terminal
To: [email protected]
Message-ID:
<3dbe54b1a5f66799e6713fdab33f94aeb72f7f3e.1268889867.git.sc...@ubuntu.com>
This isn't used anywhere in plymouth, we should always open a named
terminal to avoid surprises due to VT switches we're not watching
for.
---
src/libply-splash-core/ply-terminal.c | 61 ++++++---------------------------
1 files changed, 11 insertions(+), 50 deletions(-)
diff --git a/src/libply-splash-core/ply-terminal.c
b/src/libply-splash-core/ply-terminal.c
index b9d5a57..771f2bc 100644
--- a/src/libply-splash-core/ply-terminal.c
+++ b/src/libply-splash-core/ply-terminal.c
@@ -93,17 +93,18 @@ ply_terminal_new (const char *device_name)
{
ply_terminal_t *terminal;
+ assert (device_name != NULL);
+
terminal = calloc (1, sizeof (ply_terminal_t));
terminal->loop = ply_event_loop_get_default ();
terminal->vt_change_closures = ply_list_new ();
- if (device_name != NULL)
- {
- if (strncmp (device_name, "/dev/", strlen ("/dev/")) == 0)
- terminal->name = strdup (device_name);
- else
- asprintf (&terminal->name, "/dev/%s", device_name);
- }
+
+ if (strncmp (device_name, "/dev/", strlen ("/dev/")) == 0)
+ terminal->name = strdup (device_name);
+ else
+ asprintf (&terminal->name, "/dev/%s", device_name);
+
terminal->fd = -1;
terminal->vt_number = -1;
@@ -248,11 +249,8 @@ on_tty_disconnected (ply_terminal_t *terminal)
terminal->fd_watch = NULL;
terminal->fd = -1;
- if (terminal->name != NULL)
- {
- ply_trace ("trying to reopen terminal '%s'", terminal->name);
- ply_terminal_open_device (terminal);
- }
+ ply_trace ("trying to reopen terminal '%s'", terminal->name);
+ ply_terminal_open_device (terminal);
}
static bool
@@ -301,27 +299,6 @@ ply_terminal_check_for_vt (ply_terminal_t *terminal)
terminal->vt_number = -1;
}
-static int
-get_active_vt (void)
-{
- int console_fd;
- struct vt_stat console_state = { 0 };
-
- console_fd = open ("/dev/tty0", O_RDONLY | O_NOCTTY);
-
- if (console_fd < 0)
- goto out;
-
- if (ioctl (console_fd, VT_GETSTATE, &console_state) < 0)
- goto out;
-
-out:
- if (console_fd >= 0)
- close (console_fd);
-
- return console_state.v_active;
-}
-
static void
ply_terminal_look_up_active_vt (ply_terminal_t *terminal)
{
@@ -467,21 +444,6 @@ ply_terminal_open (ply_terminal_t *terminal)
{
assert (terminal != NULL);
- if (terminal->name == NULL)
- {
- char tty_name[512] = "";
-
- terminal->vt_number = get_active_vt ();
-
- if (readlink ("/proc/self/fd/0", tty_name, sizeof (tty_name) - 1) < 0)
- {
- ply_trace ("could not read tty name of fd 0");
- return false;
- }
-
- terminal->name = strdup (tty_name);
- }
-
ply_trace ("trying to open terminal '%s'", terminal->name);
if (!ply_terminal_open_device (terminal))
@@ -689,8 +651,6 @@ ply_terminal_free (ply_terminal_t *terminal)
if (terminal == NULL)
return;
- free (terminal->name);
-
if (terminal->loop != NULL)
ply_event_loop_stop_watching_for_exit (terminal->loop,
(ply_event_loop_exit_handler_t)
@@ -701,6 +661,7 @@ ply_terminal_free (ply_terminal_t *terminal)
ply_terminal_close (terminal);
free_vt_change_closures (terminal);
+ free (terminal->name);
free (terminal);
}
--
1.7.0
------------------------------
Message: 8
Date: Thu, 18 Mar 2010 04:10:48 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 06/21] [terminal] only support vt-like operations on
VTs
To: [email protected]
Message-ID:
<d975e7ee9b7fa4282dcb431f2b8acc50523b9c63.1268889867.git.sc...@ubuntu.com>
Now we can simply test whether a terminal is virtual or not, add
a guard in the mode and vt change functions that ensure they only
operate on virtual terminals.
---
src/libply-splash-core/ply-terminal.c | 23 ++++++++++++++++++++++-
src/libply-splash-core/ply-text-display.c | 2 +-
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/src/libply-splash-core/ply-terminal.c
b/src/libply-splash-core/ply-terminal.c
index a4a9e76..b9d5a57 100644
--- a/src/libply-splash-core/ply-terminal.c
+++ b/src/libply-splash-core/ply-terminal.c
@@ -388,6 +388,9 @@ ply_terminal_watch_for_vt_changes (ply_terminal_t *terminal)
if (terminal->fd < 0)
return;
+ if (!ply_terminal_is_vt (terminal))
+ return;
+
if (terminal->is_watching_for_vt_changes)
return;
@@ -416,6 +419,9 @@ ply_terminal_stop_watching_for_vt_changes (ply_terminal_t
*terminal)
{
struct vt_mode mode = { 0 };
+ if (!ply_terminal_is_vt (terminal))
+ return;
+
if (!terminal->is_watching_for_vt_changes)
return;
@@ -495,7 +501,10 @@ ply_terminal_open (ply_terminal_t *terminal)
ply_terminal_look_up_geometry,
terminal);
- ply_terminal_watch_for_vt_changes (terminal);
+ if (ply_terminal_is_vt (terminal))
+ {
+ ply_terminal_watch_for_vt_changes (terminal);
+ }
terminal->is_open = true;
@@ -616,6 +625,9 @@ ply_terminal_set_mode (ply_terminal_t *terminal,
assert (terminal != NULL);
assert (mode == PLY_TERMINAL_MODE_TEXT || mode ==
PLY_TERMINAL_MODE_GRAPHICS);
+ if (!ply_terminal_is_vt (terminal))
+ return;
+
if (terminal->should_ignore_mode_changes)
return;
@@ -637,6 +649,9 @@ void
ply_terminal_ignore_mode_changes (ply_terminal_t *terminal,
bool should_ignore)
{
+ if (!ply_terminal_is_vt (terminal))
+ return;
+
terminal->should_ignore_mode_changes = should_ignore;
}
@@ -737,6 +752,9 @@ ply_terminal_watch_for_active_vt_change (ply_terminal_t
*terminal,
{
ply_terminal_active_vt_changed_closure_t *closure;
+ if (!ply_terminal_is_vt (terminal))
+ return;
+
closure = calloc (1, sizeof (*closure));
closure->handler = active_vt_changed_handler;
closure->user_data = user_data;
@@ -751,6 +769,9 @@ ply_terminal_stop_watching_for_active_vt_change
(ply_terminal_t *terminal,
{
ply_list_node_t *node;
+ if (!ply_terminal_is_vt (terminal))
+ return;
+
node = ply_list_get_first_node (terminal->vt_change_closures);
while (node != NULL)
{
diff --git a/src/libply-splash-core/ply-text-display.c
b/src/libply-splash-core/ply-text-display.c
index cdf78dc..69d652b 100644
--- a/src/libply-splash-core/ply-text-display.c
+++ b/src/libply-splash-core/ply-text-display.c
@@ -249,7 +249,7 @@ ply_text_display_write (ply_text_display_t *display,
vasprintf (&string, format, args);
va_end (args);
- if (ply_terminal_get_vt_number (display->terminal) > 0)
+ if (ply_terminal_is_vt (display->terminal))
ply_terminal_set_mode (display->terminal, PLY_TERMINAL_MODE_TEXT);
write (fd, string, strlen (string));
free (string);
--
1.7.0
------------------------------
Message: 9
Date: Thu, 18 Mar 2010 03:42:07 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 02/21] [terminal] remove references to ply_console_t
To: [email protected]
Message-ID:
<2c238bc1535e2c822c496344d4609c9c5d9c1840.1268889867.git.sc...@ubuntu.com>
Remove all of the references to ply_console_t from the code, now
we operate exclusively on the terminal object. In some places
this means switching from one to the other, but in many it just
means dropping the console object and using the terminal object
we were already passed.
---
src/libply-splash-core/ply-boot-splash.c | 37 ++++++++++----------------
src/libply-splash-core/ply-boot-splash.h | 10 +++---
src/libply-splash-core/ply-renderer-plugin.h | 5 +--
src/libply-splash-core/ply-renderer.c | 12 +++-----
src/libply-splash-core/ply-renderer.h | 6 +---
src/libply-splash-core/ply-text-display.c | 8 +----
src/libply-splash-core/ply-text-display.h | 4 +--
src/main.c | 24 +++++------------
src/plugins/renderers/drm/plugin.c | 31 ++++++++++------------
src/plugins/renderers/frame-buffer/plugin.c | 29 +++++++++-----------
src/plugins/renderers/x11/plugin.c | 13 ++++-----
11 files changed, 70 insertions(+), 109 deletions(-)
diff --git a/src/libply-splash-core/ply-boot-splash.c
b/src/libply-splash-core/ply-boot-splash.c
index 5ba1bc1..1d56b8c 100644
--- a/src/libply-splash-core/ply-boot-splash.c
+++ b/src/libply-splash-core/ply-boot-splash.c
@@ -34,7 +34,7 @@
#include <wchar.h>
#include "ply-boot-splash-plugin.h"
-#include "ply-console.h"
+#include "ply-terminal.h"
#include "ply-event-loop.h"
#include "ply-list.h"
#include "ply-logger.h"
@@ -58,7 +58,7 @@ struct _ply_boot_splash
ply_module_handle_t *module_handle;
const ply_boot_splash_plugin_interface_t *plugin_interface;
ply_boot_splash_plugin_t *plugin;
- ply_console_t *console;
+ ply_terminal_t *terminal;
ply_keyboard_t *keyboard;
ply_buffer_t *boot_buffer;
ply_trigger_t *idle_trigger;
@@ -85,10 +85,10 @@ static void ply_boot_splash_update_progress
(ply_boot_splash_t *splash);
static void ply_boot_splash_detach_from_event_loop (ply_boot_splash_t *splash);
ply_boot_splash_t *
-ply_boot_splash_new (const char *theme_path,
- const char *plugin_dir,
- ply_buffer_t *boot_buffer,
- ply_console_t *console)
+ply_boot_splash_new (const char *theme_path,
+ const char *plugin_dir,
+ ply_buffer_t *boot_buffer,
+ ply_terminal_t *terminal)
{
ply_boot_splash_t *splash;
@@ -102,7 +102,7 @@ ply_boot_splash_new (const char *theme_path,
splash->is_shown = false;
splash->boot_buffer = boot_buffer;
- splash->console = console;
+ splash->terminal = terminal;
splash->pixel_displays = ply_list_new ();
splash->text_displays = ply_list_new ();
@@ -172,11 +172,11 @@ on_keyboard_input (ply_boot_splash_t *splash,
if (splash->should_force_text_mode)
{
- ply_console_set_mode (splash->console, PLY_CONSOLE_MODE_TEXT);
- ply_console_ignore_mode_changes (splash->console, true);
+ ply_terminal_set_mode (splash->terminal,
PLY_TERMINAL_MODE_TEXT);
+ ply_terminal_ignore_mode_changes (splash->terminal, true);
}
else
- ply_console_ignore_mode_changes (splash->console, false);
+ ply_terminal_ignore_mode_changes (splash->terminal, false);
ply_trace ("text mode toggled!");
return;
@@ -513,7 +513,7 @@ ply_boot_splash_hide (ply_boot_splash_t *splash)
splash->plugin_interface->hide_splash_screen (splash->plugin,
splash->loop);
- ply_console_set_mode (splash->console, PLY_CONSOLE_MODE_TEXT);
+ ply_terminal_set_mode (splash->terminal, PLY_TERMINAL_MODE_TEXT);
splash->is_shown = false;
@@ -698,7 +698,6 @@ main (int argc,
const char *theme_path;
ply_text_display_t *text_display;
ply_renderer_t *renderer;
- ply_console_t *console;
ply_terminal_t *terminal;
ply_keyboard_t *keyboard;
@@ -716,14 +715,6 @@ main (int argc,
else
tty_name = strdup("tty0");
- console = ply_console_new ();
-
- if (!ply_console_open (console))
- {
- perror ("could not open console");
- return errno;
- }
-
terminal = ply_terminal_new (tty_name);
if (!ply_terminal_open (terminal))
@@ -732,7 +723,7 @@ main (int argc,
return errno;
}
- renderer = ply_renderer_new (NULL, terminal, console);
+ renderer = ply_renderer_new (NULL, terminal);
free(tty_name);
if (!ply_renderer_open (renderer))
@@ -747,7 +738,7 @@ main (int argc,
(ply_keyboard_escape_handler_t) on_quit,
&state);
state.buffer = ply_buffer_new ();
- state.splash = ply_boot_splash_new (theme_path, PLYMOUTH_PLUGIN_PATH,
state.buffer, console);
+ state.splash = ply_boot_splash_new (theme_path, PLYMOUTH_PLUGIN_PATH,
state.buffer, terminal);
if (!ply_boot_splash_load (state.splash))
{
@@ -758,7 +749,7 @@ main (int argc,
ply_boot_splash_set_keyboard (state.splash, keyboard);
add_displays_to_splash_from_renderer (&state, renderer);
- text_display = ply_text_display_new (terminal, console);
+ text_display = ply_text_display_new (terminal);
ply_boot_splash_add_text_display (state.splash, text_display);
ply_boot_splash_attach_to_event_loop (state.splash, state.loop);
diff --git a/src/libply-splash-core/ply-boot-splash.h
b/src/libply-splash-core/ply-boot-splash.h
index 4cb61b7..d2c61a0 100644
--- a/src/libply-splash-core/ply-boot-splash.h
+++ b/src/libply-splash-core/ply-boot-splash.h
@@ -28,7 +28,7 @@
#include "ply-event-loop.h"
#include "ply-buffer.h"
-#include "ply-console.h"
+#include "ply-terminal.h"
#include "ply-keyboard.h"
#include "ply-pixel-display.h"
#include "ply-text-display.h"
@@ -41,10 +41,10 @@ typedef struct _ply_boot_splash ply_boot_splash_t;
typedef void (* ply_boot_splash_on_idle_handler_t) (void *user_data);
#ifndef PLY_HIDE_FUNCTION_DECLARATIONS
-ply_boot_splash_t *ply_boot_splash_new (const char *theme_path,
- const char *plugin_dir,
- ply_buffer_t *boot_buffer,
- ply_console_t *console);
+ply_boot_splash_t *ply_boot_splash_new (const char * theme_path,
+ const char * plugin_dir,
+ ply_buffer_t * boot_buffer,
+ ply_terminal_t *terminal);
bool ply_boot_splash_load (ply_boot_splash_t *splash);
void ply_boot_splash_unload (ply_boot_splash_t *splash);
void ply_boot_splash_set_keyboard (ply_boot_splash_t *splash,
diff --git a/src/libply-splash-core/ply-renderer-plugin.h
b/src/libply-splash-core/ply-renderer-plugin.h
index e4f6b37..68ac7e9 100644
--- a/src/libply-splash-core/ply-renderer-plugin.h
+++ b/src/libply-splash-core/ply-renderer-plugin.h
@@ -26,7 +26,7 @@
#include <stdint.h>
#include <unistd.h>
-#include "ply-console.h"
+#include "ply-terminal.h"
#include "ply-event-loop.h"
#include "ply-list.h"
#include "ply-region.h"
@@ -38,8 +38,7 @@ typedef struct _ply_renderer_backend ply_renderer_backend_t;
typedef struct
{
ply_renderer_backend_t * (* create_backend) (const char *device_name,
- ply_terminal_t *terminal,
- ply_console_t *console);
+ ply_terminal_t *terminal);
void (* destroy_backend) (ply_renderer_backend_t *backend);
bool (* open_device) (ply_renderer_backend_t *backend);
void (* close_device) (ply_renderer_backend_t *backend);
diff --git a/src/libply-splash-core/ply-renderer.c
b/src/libply-splash-core/ply-renderer.c
index c34dfcf..ab2012d 100644
--- a/src/libply-splash-core/ply-renderer.c
+++ b/src/libply-splash-core/ply-renderer.c
@@ -36,7 +36,7 @@
#include "ply-renderer-plugin.h"
#include "ply-buffer.h"
-#include "ply-console.h"
+#include "ply-terminal.h"
#include "ply-event-loop.h"
#include "ply-list.h"
#include "ply-logger.h"
@@ -51,7 +51,6 @@ struct _ply_renderer
char *device_name;
ply_terminal_t *terminal;
- ply_console_t *console;
uint32_t input_source_is_open : 1;
uint32_t is_mapped : 1;
@@ -63,9 +62,8 @@ typedef const ply_renderer_plugin_interface_t *
static void ply_renderer_unload_plugin (ply_renderer_t *renderer);
ply_renderer_t *
-ply_renderer_new (const char *device_name,
- ply_terminal_t *terminal,
- ply_console_t *console)
+ply_renderer_new (const char * device_name,
+ ply_terminal_t *terminal)
{
ply_renderer_t *renderer;
@@ -75,7 +73,6 @@ ply_renderer_new (const char *device_name,
renderer->device_name = strdup (device_name);
renderer->terminal = terminal;
- renderer->console = console;
return renderer;
}
@@ -138,8 +135,7 @@ ply_renderer_load_plugin (ply_renderer_t *renderer,
}
renderer->backend = renderer->plugin_interface->create_backend
(renderer->device_name,
-
renderer->terminal,
-
renderer->console);
+
renderer->terminal);
if (renderer->backend == NULL)
{
diff --git a/src/libply-splash-core/ply-renderer.h
b/src/libply-splash-core/ply-renderer.h
index c4bbdbe..ff5d5b9 100644
--- a/src/libply-splash-core/ply-renderer.h
+++ b/src/libply-splash-core/ply-renderer.h
@@ -26,7 +26,6 @@
#include <stdint.h>
#include "ply-buffer.h"
-#include "ply-console.h"
#include "ply-list.h"
#include "ply-pixel-buffer.h"
#include "ply-terminal.h"
@@ -41,9 +40,8 @@ typedef void (* ply_renderer_input_source_handler_t) (void
ply_renderer_input_source_t *input_source);
#ifndef PLY_HIDE_FUNCTION_DECLARATIONS
-ply_renderer_t *ply_renderer_new (const char *device_name,
- ply_terminal_t *terminal,
- ply_console_t *console);
+ply_renderer_t *ply_renderer_new (const char * device_name,
+ ply_terminal_t *terminal);
void ply_renderer_free (ply_renderer_t *renderer);
bool ply_renderer_open (ply_renderer_t *renderer);
void ply_renderer_close (ply_renderer_t *renderer);
diff --git a/src/libply-splash-core/ply-text-display.c
b/src/libply-splash-core/ply-text-display.c
index 5639f24..cdf78dc 100644
--- a/src/libply-splash-core/ply-text-display.c
+++ b/src/libply-splash-core/ply-text-display.c
@@ -36,7 +36,6 @@
#include <wchar.h>
#include "ply-buffer.h"
-#include "ply-console.h"
#include "ply-event-loop.h"
#include "ply-list.h"
#include "ply-logger.h"
@@ -96,7 +95,6 @@ struct _ply_text_display
ply_event_loop_t *loop;
ply_terminal_t *terminal;
- ply_console_t *console;
ply_terminal_color_t foreground_color;
ply_terminal_color_t background_color;
@@ -106,8 +104,7 @@ struct _ply_text_display
};
ply_text_display_t *
-ply_text_display_new (ply_terminal_t *terminal,
- ply_console_t *console)
+ply_text_display_new (ply_terminal_t *terminal)
{
ply_text_display_t *display;
@@ -115,7 +112,6 @@ ply_text_display_new (ply_terminal_t *terminal,
display->loop = NULL;
display->terminal = terminal;
- display->console = console;
return display;
}
@@ -254,7 +250,7 @@ ply_text_display_write (ply_text_display_t *display,
va_end (args);
if (ply_terminal_get_vt_number (display->terminal) > 0)
- ply_console_set_mode (display->console, PLY_CONSOLE_MODE_TEXT);
+ ply_terminal_set_mode (display->terminal, PLY_TERMINAL_MODE_TEXT);
write (fd, string, strlen (string));
free (string);
}
diff --git a/src/libply-splash-core/ply-text-display.h
b/src/libply-splash-core/ply-text-display.h
index 8c6870a..3fd7dab 100644
--- a/src/libply-splash-core/ply-text-display.h
+++ b/src/libply-splash-core/ply-text-display.h
@@ -27,7 +27,6 @@
#include <unistd.h>
#include "ply-buffer.h"
-#include "ply-console.h"
#include "ply-event-loop.h"
#include "ply-terminal.h"
@@ -41,8 +40,7 @@ typedef void (* ply_text_display_draw_handler_t) (void
*user_data,
int number_of_rows);
#ifndef PLY_HIDE_FUNCTION_DECLARATIONS
-ply_text_display_t *ply_text_display_new (ply_terminal_t *terminal,
- ply_console_t *console);
+ply_text_display_t *ply_text_display_new (ply_terminal_t *terminal);
void ply_text_display_free (ply_text_display_t *display);
diff --git a/src/main.c b/src/main.c
index aebab61..76ba53a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -79,7 +79,6 @@ typedef struct
typedef struct
{
ply_event_loop_t *loop;
- ply_console_t *console;
ply_boot_server_t *boot_server;
ply_list_t *pixel_displays;
ply_list_t *text_displays;
@@ -1022,11 +1021,11 @@ add_display_and_keyboard_for_terminal (state_t
*state,
state->terminal = terminal;
- ply_console_set_active_vt (state->console,
- ply_terminal_get_vt_number (terminal));
+ ply_terminal_set_active_vt (state->terminal,
+ ply_terminal_get_vt_number (state->terminal));
- keyboard = ply_keyboard_new_for_terminal (terminal);
- display = ply_text_display_new (terminal, state->console);
+ keyboard = ply_keyboard_new_for_terminal (state->terminal);
+ display = ply_text_display_new (state->terminal);
ply_list_append_data (state->text_displays, display);
state->keyboard = keyboard;
@@ -1080,7 +1079,7 @@ add_default_displays_and_keyboard (state_t *state)
return;
}
- renderer = ply_renderer_new (NULL, terminal, state->console);
+ renderer = ply_renderer_new (NULL, terminal);
if (!ply_renderer_open (renderer))
{
@@ -1099,7 +1098,7 @@ add_default_displays_and_keyboard (state_t *state)
add_pixel_displays_from_renderer (state, renderer);
- text_display = ply_text_display_new (terminal, state->console);
+ text_display = ply_text_display_new (state->terminal);
ply_list_append_data (state->text_displays, text_display);
state->renderer = renderer;
@@ -1158,7 +1157,7 @@ start_boot_splash (state_t *state,
splash = ply_boot_splash_new (theme_path,
PLYMOUTH_PLUGIN_PATH,
state->boot_buffer,
- state->console);
+ state->terminal);
if (!ply_boot_splash_load (splash))
{
@@ -1361,15 +1360,6 @@ check_for_consoles (state_t *state,
ply_trace ("checking if splash screen should be disabled");
- if (state->console == NULL)
- state->console = ply_console_new ();
-
- if (!ply_console_is_open (state->console) &&
- !ply_console_open (state->console))
- {
- ply_trace ("could not open /dev/tty0");
- }
-
remaining_command_line = state->kernel_command_line;
while ((console_key = strstr (remaining_command_line, " console=")) != NULL)
{
diff --git a/src/plugins/renderers/drm/plugin.c
b/src/plugins/renderers/drm/plugin.c
index 4bc93e4..48e9ab0 100644
--- a/src/plugins/renderers/drm/plugin.c
+++ b/src/plugins/renderers/drm/plugin.c
@@ -94,7 +94,6 @@ struct _ply_renderer_input_source
struct _ply_renderer_backend
{
ply_event_loop_t *loop;
- ply_console_t *console;
ply_terminal_t *terminal;
ply_renderer_driver_interface_t *driver_interface;
@@ -301,8 +300,7 @@ free_heads (ply_renderer_backend_t *backend)
static ply_renderer_backend_t *
create_backend (const char *device_name,
- ply_terminal_t *terminal,
- ply_console_t *console)
+ ply_terminal_t *terminal)
{
ply_renderer_backend_t *backend;
@@ -318,7 +316,6 @@ create_backend (const char *device_name,
backend->loop = ply_event_loop_get_default ();
backend->heads = ply_list_new ();
backend->input_source.key_buffer = ply_buffer_new ();
- backend->console = console;
backend->terminal = terminal;
return backend;
@@ -407,7 +404,7 @@ deactivate (ply_renderer_backend_t *backend)
static void
on_active_vt_changed (ply_renderer_backend_t *backend)
{
- if (ply_console_get_active_vt (backend->console) !=
+ if (ply_terminal_get_active_vt (backend->terminal) !=
ply_terminal_get_vt_number (backend->terminal))
{
ply_trace ("deactivating on vt change");
@@ -499,10 +496,10 @@ open_device (ply_renderer_backend_t *backend)
if (!load_driver (backend))
return false;
- ply_console_watch_for_active_vt_change (backend->console,
-
(ply_console_active_vt_changed_handler_t)
- on_active_vt_changed,
- backend);
+ ply_terminal_watch_for_active_vt_change (backend->terminal,
+
(ply_terminal_active_vt_changed_handler_t)
+ on_active_vt_changed,
+ backend);
return true;
}
@@ -512,10 +509,10 @@ close_device (ply_renderer_backend_t *backend)
{
free_heads (backend);
- ply_console_stop_watching_for_active_vt_change (backend->console,
-
(ply_console_active_vt_changed_handler_t)
- on_active_vt_changed,
- backend);
+ ply_terminal_stop_watching_for_active_vt_change (backend->terminal,
+
(ply_terminal_active_vt_changed_handler_t)
+ on_active_vt_changed,
+ backend);
unload_driver (backend);
}
@@ -809,8 +806,8 @@ map_to_device (ply_renderer_backend_t *backend)
node = next_node;
}
- ply_console_set_active_vt (backend->console,
- ply_terminal_get_vt_number (backend->terminal));
+ ply_terminal_set_active_vt (backend->terminal,
+ ply_terminal_get_vt_number (backend->terminal));
return head_mapped;
}
@@ -931,7 +928,7 @@ reset_scan_out_buffer_if_needed (ply_renderer_backend_t
*backend,
{
drmModeCrtc *controller;
- if (ply_console_get_active_vt (backend->console) !=
+ if (ply_terminal_get_active_vt (backend->terminal) !=
ply_terminal_get_vt_number (backend->terminal))
return;
@@ -965,7 +962,7 @@ flush_head (ply_renderer_backend_t *backend,
if (backend->is_inactive)
return;
- ply_console_set_mode (backend->console, PLY_CONSOLE_MODE_GRAPHICS);
+ ply_terminal_set_mode (backend->terminal, PLY_TERMINAL_MODE_GRAPHICS);
ply_terminal_set_unbuffered_input (backend->terminal);
pixel_buffer = head->pixel_buffer;
updated_region = ply_pixel_buffer_get_updated_areas (pixel_buffer);
diff --git a/src/plugins/renderers/frame-buffer/plugin.c
b/src/plugins/renderers/frame-buffer/plugin.c
index daa06bf..ff2d1dc 100644
--- a/src/plugins/renderers/frame-buffer/plugin.c
+++ b/src/plugins/renderers/frame-buffer/plugin.c
@@ -82,7 +82,6 @@ struct _ply_renderer_input_source
struct _ply_renderer_backend
{
ply_event_loop_t *loop;
- ply_console_t *console;
ply_terminal_t *terminal;
char *device_name;
@@ -245,8 +244,7 @@ flush_area_to_xrgb32_device (ply_renderer_backend_t
*backend,
static ply_renderer_backend_t *
create_backend (const char *device_name,
- ply_terminal_t *terminal,
- ply_console_t *console)
+ ply_terminal_t *terminal)
{
ply_renderer_backend_t *backend;
@@ -263,7 +261,6 @@ create_backend (const char *device_name,
backend->loop = ply_event_loop_get_default ();
backend->heads = ply_list_new ();
backend->input_source.key_buffer = ply_buffer_new ();
- backend->console = console;
backend->terminal = terminal;
return backend;
@@ -323,7 +320,7 @@ deactivate (ply_renderer_backend_t *backend)
static void
on_active_vt_changed (ply_renderer_backend_t *backend)
{
- if (ply_console_get_active_vt (backend->console) !=
+ if (ply_terminal_get_active_vt (backend->terminal) !=
ply_terminal_get_vt_number (backend->terminal))
{
deactivate (backend);
@@ -344,10 +341,10 @@ open_device (ply_renderer_backend_t *backend)
return false;
}
- ply_console_watch_for_active_vt_change (backend->console,
-
(ply_console_active_vt_changed_handler_t)
- on_active_vt_changed,
- backend);
+ ply_terminal_watch_for_active_vt_change (backend->terminal,
+
(ply_terminal_active_vt_changed_handler_t)
+ on_active_vt_changed,
+ backend);
return true;
}
@@ -356,10 +353,10 @@ static void
close_device (ply_renderer_backend_t *backend)
{
- ply_console_stop_watching_for_active_vt_change (backend->console,
-
(ply_console_active_vt_changed_handler_t)
- on_active_vt_changed,
- backend);
+ ply_terminal_stop_watching_for_active_vt_change (backend->terminal,
+
(ply_terminal_active_vt_changed_handler_t)
+ on_active_vt_changed,
+ backend);
uninitialize_head (backend, &backend->head);
close (backend->device_fd);
@@ -515,8 +512,8 @@ map_to_device (ply_renderer_backend_t *backend)
if (head->map_address == MAP_FAILED)
return false;
- ply_console_set_active_vt (backend->console,
- ply_terminal_get_vt_number (backend->terminal));
+ ply_terminal_set_active_vt (backend->terminal,
+ ply_terminal_get_vt_number (backend->terminal));
return true;
}
@@ -550,7 +547,7 @@ flush_head (ply_renderer_backend_t *backend,
if (backend->is_inactive)
return;
- ply_console_set_mode (backend->console, PLY_CONSOLE_MODE_GRAPHICS);
+ ply_terminal_set_mode (backend->terminal, PLY_TERMINAL_MODE_GRAPHICS);
ply_terminal_set_unbuffered_input (backend->terminal);
pixel_buffer = head->pixel_buffer;
updated_region = ply_pixel_buffer_get_updated_areas (pixel_buffer);
diff --git a/src/plugins/renderers/x11/plugin.c
b/src/plugins/renderers/x11/plugin.c
index 53961dc..042bdc9 100644
--- a/src/plugins/renderers/x11/plugin.c
+++ b/src/plugins/renderers/x11/plugin.c
@@ -83,7 +83,7 @@ struct _ply_renderer_backend
ply_event_loop_t *loop;
ply_renderer_input_source_t input_source;
ply_list_t *heads;
- ply_console_t *console;
+ ply_terminal_t *terminal;
ply_fd_watch_t *display_watch;
@@ -103,8 +103,7 @@ static gboolean on_key_event (GtkWidget *widget,
static ply_renderer_backend_t *
create_backend (const char *device_name,
- ply_terminal_t *terminal,
- ply_console_t *console)
+ ply_terminal_t *terminal)
{
ply_renderer_backend_t *backend;
@@ -113,7 +112,7 @@ create_backend (const char *device_name,
backend->loop = ply_event_loop_get_default ();
backend->heads = ply_list_new ();
backend->input_source.key_buffer = ply_buffer_new ();
- backend->console = console;
+ backend->terminal = terminal;
return backend;
}
@@ -233,9 +232,9 @@ map_to_device (ply_renderer_backend_t *backend)
assert (backend != NULL);
/* Prevent other parts of plymouth from trying to use
- * the console, since X draws to it.
+ * the terminal, since X draws to it.
*/
- ply_console_ignore_mode_changes (backend->console, true);
+ ply_terminal_ignore_mode_changes (backend->terminal, true);
node = ply_list_get_first_node (backend->heads);
while (node != NULL)
@@ -306,7 +305,7 @@ unmap_from_device (ply_renderer_backend_t *backend)
node = next_node;
}
- ply_console_ignore_mode_changes (backend->console, false);
+ ply_terminal_ignore_mode_changes (backend->terminal, false);
}
static void
--
1.7.0
------------------------------
_______________________________________________
plymouth mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/plymouth
End of plymouth Digest, Vol 17, Issue 8
***************************************