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 03/20] [main] fix bug with multiple deactivate
      commands (Scott James Remnant)
   2. [PATCH 02/20] [main] pull deactivate trigger in
      quit_program() (Scott James Remnant)
   3. [PATCH 01/20] [main] give quit command precedence over
      deactivate (Scott James Remnant)
   4. [PATCH 04/20] [main] fix bug with multiple quit commands
      (Scott James Remnant)
   5. [PATCH 05/20] [main] Ignore --show-splash while deactivated
      (Scott James Remnant)
   6. [PATCH 06/20] [main] Ignore --hide-splash while deactivated
      (Scott James Remnant)
   7. [PATCH 00/20] Fix deactivate/quit races and improve
      deactivate        handling (Scott James Remnant)
   8. [PATCH 07/20] [main] Ignore deactivate while deactivated
      (Scott James Remnant)
   9. [PATCH 08/20] [terminal] export functions to enable/disable
      VT        watching (Scott James Remnant)
  10. [PATCH 09/20] [main] add deactivate_splash() function
      (Scott James Remnant)
  11. [PATCH 11/20] [main] don't quit splash on deactivate
      (Scott James Remnant)


----------------------------------------------------------------------

Message: 1
Date: Thu, 18 Mar 2010 20:27:06 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 03/20] [main] fix bug with multiple deactivate
        commands
To: [email protected]
Message-ID:
        
<4d9483b6ad907edf14ee0d601924770f04164fec.1268946934.git.sc...@ubuntu.com>
        

If plymouth deactivate is called when we're waiting for the boot
splash to become idle, we end up asserting that there's not
already an idle trigger.

Fix it by checking for an existing deactive trigger, and if there
is, ignoring the new deactivate command (except for pulling its
trigger so it doesn't block).
---
 src/main.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/main.c b/src/main.c
index 62af0a9..bb8ab4f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -758,10 +758,17 @@ static void
 on_deactivate (state_t       *state,
                ply_trigger_t *deactivate_trigger)
 {
+  if (state->deactivate_trigger != NULL)
+    {
+      ply_trigger_pull (deactivate_trigger, NULL);
+      return;
+    }
+
+  state->deactivate_trigger = deactivate_trigger;
+
   ply_trace ("deactivating");
   if (state->boot_splash != NULL)
     {
-      state->deactivate_trigger = deactivate_trigger;
       ply_boot_splash_become_idle (state->boot_splash,
                                    (ply_boot_splash_on_idle_handler_t)
                                    on_boot_splash_idle,
@@ -769,7 +776,8 @@ on_deactivate (state_t       *state,
     }
   else
     {
-      ply_trigger_pull (deactivate_trigger, NULL);
+      ply_trigger_pull (state->deactivate_trigger, NULL);
+      state->deactivate_trigger = NULL;
     }
 }
 
-- 
1.7.0



------------------------------

Message: 2
Date: Thu, 18 Mar 2010 20:24:57 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 02/20] [main] pull deactivate trigger in
        quit_program()
To: [email protected]
Message-ID:
        
<f992e487560199c8c269599c6839c83deb7a844c.1268946934.git.sc...@ubuntu.com>
        

To avoid a "plymouth deactivate" command hanging forever in the case
of the program quitting, pull the trigger before the quit trigger.
---
 src/main.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/main.c b/src/main.c
index bc896a0..62af0a9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -702,6 +702,11 @@ quit_program (state_t *state)
     }
 #endif
 
+  if (state->deactivate_trigger != NULL)
+    {
+      ply_trigger_pull (state->deactivate_trigger, NULL);
+      state->deactivate_trigger = NULL;
+    }
   if (state->quit_trigger != NULL)
     {
       ply_trigger_pull (state->quit_trigger, NULL);
-- 
1.7.0



------------------------------

Message: 3
Date: Thu, 18 Mar 2010 20:22:53 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 01/20] [main] give quit command precedence over
        deactivate
To: [email protected]
Message-ID:
        
<b374398d3970c7b9129386a83c63fa9ca95bff4c.1268946934.git.sc...@ubuntu.com>
        

In the cases where the boot splash plugin does not become idle
immediately, we go back into the main loop and can receive additional
commands.

Since quit and deactive both use this facility, one scenario is the
quit command arriving after the deactivate command, but before the
deactivate command has actually been run.

In that situation, we want to quit, not deactivate.
---
 src/main.c |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/src/main.c b/src/main.c
index a865a1d..bc896a0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -712,10 +712,26 @@ quit_program (state_t *state)
 static void
 on_boot_splash_idle (state_t *state)
 {
-
   ply_trace ("boot splash idle");
 
-  if (state->deactivate_trigger != NULL)
+  /* In the case where we've received both a deactivate command and a
+   * quit command, the quit command takes precedence.
+   */
+  if (state->quit_trigger != NULL)
+    {
+      if (!state->should_retain_splash)
+        {
+          ply_trace ("hiding splash");
+          if (state->boot_splash != NULL)
+            ply_boot_splash_hide (state->boot_splash);
+        }
+
+      ply_trace ("quitting splash");
+      quit_splash (state);
+      ply_trace ("quitting program");
+      quit_program (state);
+    }
+  else if (state->deactivate_trigger != NULL)
     {
       if (state->renderer != NULL)
         {
@@ -729,21 +745,7 @@ on_boot_splash_idle (state_t *state)
       ply_trigger_pull (state->deactivate_trigger, NULL);
       state->deactivate_trigger = NULL;
       state->is_inactive = true;
-
-      return;
     }
-
-  if (!state->should_retain_splash)
-    {
-      ply_trace ("hiding splash");
-      if (state->boot_splash != NULL)
-          ply_boot_splash_hide (state->boot_splash);
-    }
-
-  ply_trace ("quitting splash");
-  quit_splash (state);
-  ply_trace ("quitting program");
-  quit_program (state);
 }
 
 
-- 
1.7.0



------------------------------

Message: 4
Date: Thu, 18 Mar 2010 20:29:05 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 04/20] [main] fix bug with multiple quit commands
To: [email protected]
Message-ID:
        
<00bf5cc9a60c8d51f570777de60f908c770d2687.1268946935.git.sc...@ubuntu.com>
        

Likewise if plymouth quit is called when we're waiting for the boot
splash to become idle, we also end up asserting that there's not
already an idle trigger.

Fix it in the same way as deactive, ignore the second quit command
except for pulling its trigger.
---
 src/main.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/main.c b/src/main.c
index bb8ab4f..f914a37 100644
--- a/src/main.c
+++ b/src/main.c
@@ -786,15 +786,20 @@ on_quit (state_t       *state,
          bool           retain_splash,
          ply_trigger_t *quit_trigger)
 {
+  if (state->quit_trigger != NULL)
+    {
+      ply_trigger_pull (quit_trigger, NULL);
+      return;
+    }
+
+  state->quit_trigger = quit_trigger;
+  state->should_retain_splash = retain_splash;
+
   ply_trace ("time to quit, closing log");
   if (state->session != NULL)
     ply_terminal_session_close_log (state->session);
   ply_trace ("unloading splash");
 
-  state->should_retain_splash = retain_splash;
-
-  state->quit_trigger = quit_trigger;
-
   if (state->boot_splash != NULL)
     {
       ply_boot_splash_become_idle (state->boot_splash,
-- 
1.7.0



------------------------------

Message: 5
Date: Thu, 18 Mar 2010 20:30:25 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 05/20] [main] Ignore --show-splash while deactivated
To: [email protected]
Message-ID:
        
<62a50fcc7807c73125b4f8d204ec25ee3507f8cf.1268946935.git.sc...@ubuntu.com>
        

The last thing we want to do after plymouth deactivate is called by
the X display manager is listen to calls to show the splash screen
again.

So don't.
---
 src/main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/main.c b/src/main.c
index f914a37..9be2e82 100644
--- a/src/main.c
+++ b/src/main.c
@@ -578,6 +578,9 @@ on_show_splash (state_t *state)
 {
   bool has_display;
 
+  if (state->is_inactive)
+    return;
+
   if (plymouth_should_ignore_show_splash_calls (state))
     {
       dump_details_and_quit_splash (state);
-- 
1.7.0



------------------------------

Message: 6
Date: Thu, 18 Mar 2010 20:31:12 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 06/20] [main] Ignore --hide-splash while deactivated
To: [email protected]
Message-ID:
        
<bb54c13e65667721a89354e387ac79103c644ff5.1268946935.git.sc...@ubuntu.com>
        

Since we ignore --show-splash, it makes no sense to process
--hide-splash either; in theory this does nothing already because
we won't have a boot_splash in our state - but that changes with
future patches and it's worth being safe.
---
 src/main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/main.c b/src/main.c
index 9be2e82..628500a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -667,6 +667,9 @@ dump_details_and_quit_splash (state_t *state)
 static void
 on_hide_splash (state_t *state)
 {
+  if (state->is_inactive)
+    return;
+
   if (state->boot_splash == NULL)
     return;
 
-- 
1.7.0



------------------------------

Message: 7
Date: Thu, 18 Mar 2010 21:15:34 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 00/20] Fix deactivate/quit races and improve
        deactivate      handling
To: [email protected]
Message-ID: <[email protected]>

After correcting the VT issues, I started work on the issues with using
"plymouth deactivate" to transition to X.  This set of patches is a bit
less of a single story, but each builds on the next.

The first set corrects a set of races with different commands running
at different times producing unexpected side effects; since we use
Upstart for our boot, we can't really predict what order things come in.

Next I replace the existing semantics of deactivate with something that
simply deactivates the renderers and stops watching the terminal enough
for X to take over.

A companion reactivate command is added for debugging and future
shutdown transitions.

Finally a new has active vt? request is added to solve the issue where
the transition runs without Plymouth ever having shown a splash.

Scott James Remnant (20):
  [main] give quit command precedence over deactivate
  [main] pull deactivate trigger in quit_program()
  [main] fix bug with multiple deactivate commands
  [main] fix bug with multiple quit commands
  [main] Ignore --show-splash while deactivated
  [main] Ignore --hide-splash while deactivated
  [main] Ignore deactivate while deactivated
  [terminal] export functions to enable/disable VT watching
  [main] add deactivate_splash() function
  [main] call deactivate_splash() even when no splash
  [main] don't quit splash on deactivate
  [daemon] add reactivate command
  [client] Add new reactivate command
  [main] update display after reactivate
  [fade-throbber] resume animations on display_normal
  [space-flares] resume animations on display_normal
  [throbgress] resume animations on display_normal
  [two-step] resume animations on display_normal
  [daemon] add "has active vt?" request
  [client] add has active vt? request

 src/client/ply-boot-client.c              |   22 ++++
 src/client/ply-boot-client.h              |    8 ++
 src/client/plymouth.c                     |   31 ++++++-
 src/libply-splash-core/ply-terminal.c     |    4 +-
 src/libply-splash-core/ply-terminal.h     |    3 +
 src/main.c                                |  157 ++++++++++++++++++++++++-----
 src/plugins/splash/fade-throbber/plugin.c |   14 +--
 src/plugins/splash/space-flares/plugin.c  |   11 +-
 src/plugins/splash/throbgress/plugin.c    |   11 +-
 src/plugins/splash/two-step/plugin.c      |   10 +-
 src/ply-boot-protocol.h                   |    2 +
 src/ply-boot-server.c                     |   52 +++++++++-
 src/ply-boot-server.h                     |    6 +
 13 files changed, 272 insertions(+), 59 deletions(-)



------------------------------

Message: 8
Date: Thu, 18 Mar 2010 20:39:01 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 07/20] [main] Ignore deactivate while deactivated
To: [email protected]
Message-ID:
        
<cae95c7bdb7e369d1644c0095151fe373181fdc7.1268946935.git.sc...@ubuntu.com>
        

The other obvious command we should ignore while deactivated is
deactivate itself.
---
 src/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/main.c b/src/main.c
index 628500a..cb56506 100644
--- a/src/main.c
+++ b/src/main.c
@@ -764,7 +764,7 @@ static void
 on_deactivate (state_t       *state,
                ply_trigger_t *deactivate_trigger)
 {
-  if (state->deactivate_trigger != NULL)
+  if ((state->deactivate_trigger != NULL) || state->is_inactive)
     {
       ply_trigger_pull (deactivate_trigger, NULL);
       return;
-- 
1.7.0



------------------------------

Message: 9
Date: Thu, 18 Mar 2010 20:32:59 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 08/20] [terminal] export functions to enable/disable
        VT      watching
To: [email protected]
Message-ID:
        
<ede572b390812ce22abba2158e11818712ca68aa.1268946935.git.sc...@ubuntu.com>
        

In order to deactivate without pulling everything, we need to be able
to take the terminal in and out of VT_PROCESS mode directly; so change
the two functions from static to exported.
---
 src/libply-splash-core/ply-terminal.c |    4 ++--
 src/libply-splash-core/ply-terminal.h |    3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/libply-splash-core/ply-terminal.c 
b/src/libply-splash-core/ply-terminal.c
index 4b4b287..0f70bf7 100644
--- a/src/libply-splash-core/ply-terminal.c
+++ b/src/libply-splash-core/ply-terminal.c
@@ -348,7 +348,7 @@ on_enter_vt (ply_terminal_t *terminal)
   do_active_vt_changed (terminal);
 }
 
-static void
+void
 ply_terminal_watch_for_vt_changes (ply_terminal_t *terminal)
 {
   assert (terminal != NULL);
@@ -384,7 +384,7 @@ ply_terminal_watch_for_vt_changes (ply_terminal_t *terminal)
   terminal->is_watching_for_vt_changes = true;
 }
 
-static void
+void
 ply_terminal_stop_watching_for_vt_changes (ply_terminal_t *terminal)
 {
   struct vt_mode mode = { 0 };
diff --git a/src/libply-splash-core/ply-terminal.h 
b/src/libply-splash-core/ply-terminal.h
index 8ac47c6..5e4f1fc 100644
--- a/src/libply-splash-core/ply-terminal.h
+++ b/src/libply-splash-core/ply-terminal.h
@@ -93,6 +93,9 @@ void ply_terminal_ignore_mode_changes (ply_terminal_t 
*terminal,
 int ply_terminal_get_vt_number (ply_terminal_t *terminal);
 bool ply_terminal_activate_vt (ply_terminal_t *terminal);
 
+void ply_terminal_watch_for_vt_changes (ply_terminal_t *terminal);
+void ply_terminal_stop_watching_for_vt_changes (ply_terminal_t *terminal);
+
 void ply_terminal_watch_for_active_vt_change (ply_terminal_t *terminal,
                                               
ply_terminal_active_vt_changed_handler_t active_vt_changed_handler,
                                               void *user_data);
-- 
1.7.0



------------------------------

Message: 10
Date: Thu, 18 Mar 2010 20:38:13 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 09/20] [main] add deactivate_splash() function
To: [email protected]
Message-ID:
        
<723f09d38cd4b813dc30b7951b010b648b4bee20.1268946935.git.sc...@ubuntu.com>
        

To make it easier to alter the deactivate path, split into its own
function.
---
 src/main.c |   34 ++++++++++++++++++++++------------
 1 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/src/main.c b/src/main.c
index cb56506..c320842 100644
--- a/src/main.c
+++ b/src/main.c
@@ -33,6 +33,7 @@
 #include <unistd.h>
 #include <wchar.h>
 #include <paths.h>
+#include <assert.h>
 
 #include <linux/kd.h>
 #include <linux/vt.h>
@@ -721,6 +722,25 @@ quit_program (state_t *state)
 }
 
 static void
+deactivate_splash (state_t *state)
+{
+  assert (!state->is_inactive);
+
+  if (state->renderer != NULL)
+    {
+      ply_trace ("deactivating renderer");
+      ply_renderer_deactivate (state->renderer);
+    }
+
+  ply_trace ("quitting splash");
+  quit_splash (state);
+
+  ply_trigger_pull (state->deactivate_trigger, NULL);
+  state->deactivate_trigger = NULL;
+  state->is_inactive = true;
+}
+
+static void
 on_boot_splash_idle (state_t *state)
 {
   ply_trace ("boot splash idle");
@@ -744,18 +764,8 @@ on_boot_splash_idle (state_t *state)
     }
   else if (state->deactivate_trigger != NULL)
     {
-      if (state->renderer != NULL)
-        {
-          ply_trace ("deactivating renderer");
-          ply_renderer_deactivate (state->renderer);
-        }
-
-      ply_trace ("quitting splash");
-      quit_splash (state);
-
-      ply_trigger_pull (state->deactivate_trigger, NULL);
-      state->deactivate_trigger = NULL;
-      state->is_inactive = true;
+      ply_trace ("deactivating splash");
+      deactivate_splash (state);
     }
 }
 
-- 
1.7.0



------------------------------

Message: 11
Date: Thu, 18 Mar 2010 20:43:48 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 11/20] [main] don't quit splash on deactivate
To: [email protected]
Message-ID:
        
<78691bf5118d1cb0728c4e674b97d37ae82260be.1268946935.git.sc...@ubuntu.com>
        

Currently deactivate is mostly like hide splash, except it deactivates
the renderer first and doesn't reset the VT to text mode and dump the
details plugin over top.

Unfortunately this means that the renderer is closed and freed, and in
the case of the Intel DRM renderer, closing the DRM file descriptor
means that the kernel frees the buffers and restores the fbcon buffer
on our screen - losing the smooth transition.

This now changes deactivate such that it leaves the boot splash open,
but in an inactivate state, with the DRM connection still open, etc.
now the fbcon contents are not restored.

We deliberately stop watching for keyboard input, detach any logging
session from the console, take the VT out of VT_PROCESS mode and
put it back into cooked mode, etc.

This means the X server can be started, and this state can be cleaned
up by calling plymouth quit with affecting X.
---
 src/main.c |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/main.c b/src/main.c
index 4b06309..29408d3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -732,8 +732,27 @@ deactivate_splash (state_t *state)
       ply_renderer_deactivate (state->renderer);
     }
 
-  ply_trace ("quitting splash");
-  quit_splash (state);
+  if (state->keyboard != NULL)
+    {
+      ply_trace ("deactivating keyboard");
+      ply_keyboard_stop_watching_for_input (state->keyboard);
+    }
+
+  if ((state->session != NULL) && state->is_attached)
+    {
+      ply_trace ("deactivating terminal session");
+      ply_terminal_session_detach (state->session);
+      state->is_redirected = false;
+      state->is_attached = false;
+    }
+
+  if (state->terminal != NULL)
+    {
+      ply_trace ("deactivating terminal");
+      ply_terminal_stop_watching_for_vt_changes (state->terminal);
+      ply_terminal_set_buffered_input (state->terminal);
+      ply_terminal_ignore_mode_changes (state->terminal, true);
+    }
 
   state->is_inactive = true;
 
-- 
1.7.0



------------------------------

_______________________________________________
plymouth mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/plymouth


End of plymouth Digest, Vol 17, Issue 13
****************************************

Reply via email to