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 08/21] [terminal] don't keep track of active vt,   just
      if vt is active (Scott James Remnant)
   2. [PATCH 03/21] [console] remove console files (Scott James Remnant)
   3. [PATCH 10/21] [terminal] don't treat ttySx as VT
      (Scott James Remnant)
   4. [PATCH 12/21] [drm] don't run on non-virtual terminals
      (Scott James Remnant)


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

Message: 1
Date: Thu, 18 Mar 2010 04:29:36 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 08/21] [terminal] don't keep track of active vt,        just
        if vt is active
To: [email protected]
Message-ID:
        
<4fdb4b4ba8d0fb84166ec4e94848aca4e76397b5.1268889867.git.sc...@ubuntu.com>
        

Trying to keep track of whatever VT is actually active is inherently
racy; instead just keep track of whether our VT is the active one.
Since we guarantee that's the VT in VT_PROCESS now, this is easy.

Rather simplifies the on_vt_changed functions in renderers too.
---
 src/libply-splash-core/ply-terminal.c       |   38 +++++++++++++++------------
 src/libply-splash-core/ply-terminal.h       |    2 +-
 src/plugins/renderers/drm/plugin.c          |   15 +++++-----
 src/plugins/renderers/frame-buffer/plugin.c |   12 +++++---
 4 files changed, 36 insertions(+), 31 deletions(-)

diff --git a/src/libply-splash-core/ply-terminal.c 
b/src/libply-splash-core/ply-terminal.c
index 771f2bc..e0baf2e 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   active_vt;
   int   next_active_vt;
 
   ply_list_t *vt_change_closures;
@@ -82,6 +81,7 @@ struct _ply_terminal
   uint32_t original_term_attributes_saved : 1;
   uint32_t supports_text_color : 1;
   uint32_t is_open : 1;
+  uint32_t is_active : 1;
   uint32_t is_watching_for_vt_changes : 1;
   uint32_t should_ignore_mode_changes : 1;
 };
@@ -299,15 +299,15 @@ ply_terminal_check_for_vt (ply_terminal_t *terminal)
     terminal->vt_number = -1;
 }
 
-static void
-ply_terminal_look_up_active_vt (ply_terminal_t *terminal)
+static int
+get_active_vt (ply_terminal_t *terminal)
 {
-  struct vt_stat terminal_state = { 0 };
+  struct vt_stat vt_state = { 0 };
 
-  if (ioctl (terminal->fd, VT_GETSTATE, &terminal_state) < 0)
-    return;
+  if (ioctl (terminal->fd, VT_GETSTATE, &vt_state) < 0)
+    return -1;
 
-  terminal->active_vt = terminal_state.v_active;
+  return vt_state.v_active;
 }
 
 static void
@@ -342,7 +342,7 @@ on_leave_vt (ply_terminal_t *terminal)
       terminal->next_active_vt = 0;
     }
 
-  ply_terminal_look_up_active_vt (terminal);
+  terminal->is_active = false;
   do_active_vt_changed (terminal);
 }
 
@@ -351,7 +351,7 @@ on_enter_vt (ply_terminal_t *terminal)
 {
   ioctl (terminal->fd, VT_RELDISP, VT_ACKACQ);
 
-  ply_terminal_look_up_active_vt (terminal);
+  terminal->is_active = true;
   do_active_vt_changed (terminal);
 }
 
@@ -431,7 +431,6 @@ ply_terminal_open_device (ply_terminal_t *terminal)
                                                    terminal);
 
   ply_terminal_check_for_vt (terminal);
-  ply_terminal_look_up_active_vt (terminal);
 
   if (!ply_terminal_set_unbuffered_input (terminal))
     ply_trace ("terminal '%s' will be line buffered", terminal->name);
@@ -466,6 +465,11 @@ ply_terminal_open (ply_terminal_t *terminal)
   if (ply_terminal_is_vt (terminal))
     {
       ply_terminal_watch_for_vt_changes (terminal);
+
+      if (get_active_vt (terminal) == terminal->vt_number)
+        terminal->is_active = true;
+      else
+        terminal->is_active = false;
     }
 
   terminal->is_open = true;
@@ -491,6 +495,12 @@ ply_terminal_is_open (ply_terminal_t *terminal)
   return terminal->is_open;
 }
 
+bool
+ply_terminal_is_active (ply_terminal_t *terminal)
+{
+  return terminal->is_active;
+}
+
 void
 ply_terminal_close (ply_terminal_t *terminal)
 {
@@ -671,12 +681,6 @@ ply_terminal_get_vt_number (ply_terminal_t *terminal)
   return terminal->vt_number;
 }
 
-int
-ply_terminal_get_active_vt (ply_terminal_t *terminal)
-{
-  return terminal->active_vt;
-}
-
 static bool
 set_active_vt (ply_terminal_t *terminal,
                int             vt_number)
@@ -697,7 +701,7 @@ ply_terminal_activate_vt (ply_terminal_t *terminal)
   if (!ply_terminal_is_vt (terminal))
     return false;
 
-  if (terminal->vt_number == terminal->active_vt)
+  if (terminal->is_active)
     return true;
 
   if (!set_active_vt (terminal, terminal->vt_number))
diff --git a/src/libply-splash-core/ply-terminal.h 
b/src/libply-splash-core/ply-terminal.h
index d3ac89b..8ac47c6 100644
--- a/src/libply-splash-core/ply-terminal.h
+++ b/src/libply-splash-core/ply-terminal.h
@@ -62,6 +62,7 @@ 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);
+bool ply_terminal_is_active (ply_terminal_t *terminal);
 void ply_terminal_close (ply_terminal_t *terminal);
 void ply_terminal_reset_colors (ply_terminal_t *terminal);
 
@@ -90,7 +91,6 @@ void ply_terminal_ignore_mode_changes (ply_terminal_t 
*terminal,
                                        bool            should_ignore);
 
 int ply_terminal_get_vt_number (ply_terminal_t *terminal);
-int ply_terminal_get_active_vt (ply_terminal_t *terminal);
 bool ply_terminal_activate_vt (ply_terminal_t *terminal);
 
 void ply_terminal_watch_for_active_vt_change (ply_terminal_t *terminal,
diff --git a/src/plugins/renderers/drm/plugin.c 
b/src/plugins/renderers/drm/plugin.c
index 549955d..21d727d 100644
--- a/src/plugins/renderers/drm/plugin.c
+++ b/src/plugins/renderers/drm/plugin.c
@@ -404,16 +404,16 @@ deactivate (ply_renderer_backend_t *backend)
 static void
 on_active_vt_changed (ply_renderer_backend_t *backend)
 {
-  if (ply_terminal_get_active_vt (backend->terminal) !=
-      ply_terminal_get_vt_number (backend->terminal))
+  if (ply_terminal_is_active (backend->terminal))
+    {
+      ply_trace ("activating on vt change");
+      activate (backend);
+    }
+  else
     {
       ply_trace ("deactivating on vt change");
       deactivate (backend);
-      return;
     }
-
-  ply_trace ("activating on vt change");
-  activate (backend);
 }
 
 static bool
@@ -927,8 +927,7 @@ reset_scan_out_buffer_if_needed (ply_renderer_backend_t 
*backend,
 {
   drmModeCrtc *controller;
 
-  if (ply_terminal_get_active_vt (backend->terminal) !=
-      ply_terminal_get_vt_number (backend->terminal))
+  if (!ply_terminal_is_active (backend->terminal))
     return;
 
   controller = drmModeGetCrtc (backend->device_fd, head->controller_id);
diff --git a/src/plugins/renderers/frame-buffer/plugin.c 
b/src/plugins/renderers/frame-buffer/plugin.c
index 1c0e34b..3152bf7 100644
--- a/src/plugins/renderers/frame-buffer/plugin.c
+++ b/src/plugins/renderers/frame-buffer/plugin.c
@@ -320,14 +320,16 @@ deactivate (ply_renderer_backend_t *backend)
 static void
 on_active_vt_changed (ply_renderer_backend_t *backend)
 {
-  if (ply_terminal_get_active_vt (backend->terminal) !=
-      ply_terminal_get_vt_number (backend->terminal))
+  if (ply_terminal_is_active (backend->terminal))
     {
+      ply_trace ("activating on vt change");
+      activate (backend);
+    }
+  else
+    {
+      ply_trace ("deactivating on vt change");
       deactivate (backend);
-      return;
     }
-
-  activate (backend);
 }
 
 static bool
-- 
1.7.0



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

Message: 2
Date: Thu, 18 Mar 2010 03:46:11 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 03/21] [console] remove console files
To: [email protected]
Message-ID:
        
<848e6ff36a548debf6dfb369e8e5a9d914a74204.1268889867.git.sc...@ubuntu.com>
        

Now that everything's switched over to using ply_terminal_t, we
can remove the console files.
---
 src/libply-splash-core/Makefile.am   |    2 -
 src/libply-splash-core/ply-console.c |  410 ----------------------------------
 src/libply-splash-core/ply-console.h |   70 ------
 src/tests/ply-boot-splash-test.am    |    2 -
 4 files changed, 0 insertions(+), 484 deletions(-)
 delete mode 100644 src/libply-splash-core/ply-console.c
 delete mode 100644 src/libply-splash-core/ply-console.h

diff --git a/src/libply-splash-core/Makefile.am 
b/src/libply-splash-core/Makefile.am
index c8fb2a0..b289b65 100644
--- a/src/libply-splash-core/Makefile.am
+++ b/src/libply-splash-core/Makefile.am
@@ -15,7 +15,6 @@ libply_splash_coredir = 
$(includedir)/plymouth-1/ply-splash-core
 libply_splash_core_HEADERS = \
                    ply-boot-splash.h                                         \
                    ply-boot-splash-plugin.h                                  \
-                   ply-console.h                                             \
                    ply-keyboard.h                                            \
                    ply-pixel-buffer.h                                        \
                    ply-pixel-display.h                                       \
@@ -36,7 +35,6 @@ libply_splash_core_la_LDFLAGS = -export-symbols-regex 
'^[^_].*' \
                    -no-undefined
 libply_splash_core_la_SOURCES = \
                    $(libply_splash_core_HEADERS)                              \
-                   ply-console.c                                            \
                    ply-keyboard.c                                           \
                    ply-pixel-display.c                                      \
                    ply-text-display.c                                       \
diff --git a/src/libply-splash-core/ply-console.c 
b/src/libply-splash-core/ply-console.c
deleted file mode 100644
index 6157571..0000000
--- a/src/libply-splash-core/ply-console.c
+++ /dev/null
@@ -1,410 +0,0 @@
-/* ply-console.c - console APIs
- *
- * Copyright (C) 2009 Red Hat, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * Written by: Ray Strode <[email protected]>
- */
-#include "config.h"
-#include "ply-console.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <termios.h>
-#include <unistd.h>
-#include <wchar.h>
-
-#include <linux/kd.h>
-#include <linux/major.h>
-#include <linux/vt.h>
-
-#include "ply-event-loop.h"
-#include "ply-list.h"
-#include "ply-logger.h"
-#include "ply-utils.h"
-
-#ifndef TEXT_PALETTE_SIZE
-#define TEXT_PALETTE_SIZE 48
-#endif
-
-typedef struct
-{
-  ply_console_active_vt_changed_handler_t handler;
-  void *user_data;
-} ply_console_active_vt_changed_closure_t;
-
-struct _ply_console
-{
-  ply_event_loop_t *loop;
-
-  int fd;
-  int active_vt;
-  int next_active_vt;
-
-  ply_list_t *vt_change_closures;
-  ply_fd_watch_t *fd_watch;
-
-  uint32_t is_open : 1;
-  uint32_t is_watching_for_vt_changes : 1;
-  uint32_t should_ignore_mode_changes : 1;
-};
-
-static bool ply_console_open_device (ply_console_t *console);
-
-ply_console_t *
-ply_console_new (void)
-{
-  ply_console_t *console;
-
-  console = calloc (1, sizeof (ply_console_t));
-
-  console->loop = ply_event_loop_get_default ();
-  console->vt_change_closures = ply_list_new ();
-  console->fd = -1;
-
-  return console;
-}
-
-static void
-ply_console_look_up_active_vt (ply_console_t *console)
-{
-  struct vt_stat console_state = { 0 };
-
-  if (ioctl (console->fd, VT_GETSTATE, &console_state) < 0)
-    return;
-
-  console->active_vt = console_state.v_active;
-}
-
-void
-ply_console_set_mode (ply_console_t     *console,
-                      ply_console_mode_t mode)
-{
-
-  assert (console != NULL);
-  assert (mode == PLY_CONSOLE_MODE_TEXT || mode == PLY_CONSOLE_MODE_GRAPHICS);
-
-  if (console->should_ignore_mode_changes)
-    return;
-
-  switch (mode)
-    {
-      case PLY_CONSOLE_MODE_TEXT:
-        if (ioctl (console->fd, KDSETMODE, KD_TEXT) < 0)
-          return;
-        break;
-
-      case PLY_CONSOLE_MODE_GRAPHICS:
-        if (ioctl (console->fd, KDSETMODE, KD_GRAPHICS) < 0)
-          return;
-        break;
-    }
-}
-
-void
-ply_console_ignore_mode_changes (ply_console_t *console,
-                                 bool           should_ignore)
-{
-  console->should_ignore_mode_changes = should_ignore;
-}
-
-static void
-on_tty_disconnected (ply_console_t *console)
-{
-  ply_trace ("console tty disconnected (fd %d)", console->fd);
-  console->fd_watch = NULL;
-  console->fd = -1;
-
-  ply_trace ("trying to reopen console");
-  ply_console_open_device (console);
-}
-
-static void
-do_active_vt_changed (ply_console_t *console)
-{
-  ply_list_node_t *node;
-
-  node = ply_list_get_first_node (console->vt_change_closures);
-  while (node != NULL)
-    {
-      ply_console_active_vt_changed_closure_t *closure;
-      ply_list_node_t *next_node;
-
-      closure = ply_list_node_get_data (node);
-      next_node = ply_list_get_next_node (console->vt_change_closures, node);
-
-      if (closure->handler != NULL)
-        closure->handler (closure->user_data, console);
-
-      node = next_node;
-    }
-}
-
-static void
-on_leave_vt (ply_console_t *console)
-{
-  ioctl (console->fd, VT_RELDISP, 1);
-
-  if (console->next_active_vt > 0)
-    {
-      ioctl (console->fd, VT_WAITACTIVE, console->next_active_vt);
-      console->next_active_vt = 0;
-    }
-
-  ply_console_look_up_active_vt (console);
-  do_active_vt_changed (console);
-}
-
-static void
-on_enter_vt (ply_console_t *console)
-{
-  ioctl (console->fd, VT_RELDISP, VT_ACKACQ);
-
-  ply_console_look_up_active_vt (console);
-  do_active_vt_changed (console);
-}
-
-static void
-ply_console_watch_for_vt_changes (ply_console_t *console)
-{
-  assert (console != NULL);
-
-  struct vt_mode mode = { 0 };
-
-  if (console->fd < 0)
-    return;
-
-  if (console->is_watching_for_vt_changes)
-    return;
-
-  mode.mode = VT_PROCESS;
-  mode.relsig = SIGUSR1;
-  mode.acqsig = SIGUSR2;
-
-  if (ioctl (console->fd, VT_SETMODE, &mode) < 0)
-    return;
-
-  ply_event_loop_watch_signal (console->loop,
-                               SIGUSR1,
-                               (ply_event_handler_t)
-                               on_leave_vt, console);
-
-  ply_event_loop_watch_signal (console->loop,
-                               SIGUSR2,
-                               (ply_event_handler_t)
-                               on_enter_vt, console);
-
-  console->is_watching_for_vt_changes = true;
-}
-
-static void
-ply_console_stop_watching_for_vt_changes (ply_console_t *console)
-{
-  struct vt_mode mode = { 0 };
-
-  if (!console->is_watching_for_vt_changes)
-    return;
-
-  console->is_watching_for_vt_changes = false;
-
-  ply_event_loop_stop_watching_signal (console->loop, SIGUSR1);
-  ply_event_loop_stop_watching_signal (console->loop, SIGUSR2);
-
-  mode.mode = VT_AUTO;
-  ioctl (console->fd, VT_SETMODE, &mode);
-}
-
-static bool
-ply_console_open_device (ply_console_t *console)
-{
-  assert (console != NULL);
-  assert (console->fd < 0);
-  assert (console->fd_watch == NULL);
-
-  console->fd = open ("/dev/tty0", O_RDWR | O_NOCTTY);
-
-  if (console->fd < 0)
-    return false;
-
-  console->fd_watch = ply_event_loop_watch_fd (console->loop, console->fd,
-                                                   
PLY_EVENT_LOOP_FD_STATUS_NONE,
-                                                   (ply_event_handler_t) NULL,
-                                                   (ply_event_handler_t) 
on_tty_disconnected,
-                                                   console);
-
-  ply_console_look_up_active_vt (console);
-
-  return true;
-}
-
-bool
-ply_console_open (ply_console_t *console)
-{
-  assert (console != NULL);
-
-  if (!ply_console_open_device (console))
-    {
-      ply_trace ("could not open console: %m");
-      return false;
-    }
-
-  ply_console_watch_for_vt_changes (console);
-
-  console->is_open = true;
-
-  return true;
-}
-
-
-int
-ply_console_get_fd (ply_console_t *console)
-{
-  return console->fd;
-}
-
-bool
-ply_console_is_open (ply_console_t *console)
-{
-  return console->is_open;
-}
-
-void
-ply_console_close (ply_console_t *console)
-{
-  console->is_open = false;
-
-  ply_console_stop_watching_for_vt_changes (console);
-
-  if (console->fd_watch != NULL)
-    {
-      ply_trace ("stop watching tty fd");
-      ply_event_loop_stop_watching_fd (console->loop, console->fd_watch);
-      console->fd_watch = NULL;
-    }
-
-  close (console->fd);
-  console->fd = -1;
-}
-
-static void
-free_vt_change_closures (ply_console_t *console)
-{
-  ply_list_node_t *node;
-
-  node = ply_list_get_first_node (console->vt_change_closures);
-  while (node != NULL)
-    {
-      ply_console_active_vt_changed_closure_t *closure;
-      ply_list_node_t *next_node;
-
-      closure = ply_list_node_get_data (node);
-      next_node = ply_list_get_next_node (console->vt_change_closures, node);
-
-      free (closure);
-      node = next_node;
-    }
-  ply_list_free (console->vt_change_closures);
-}
-
-void
-ply_console_free (ply_console_t *console)
-{
-  if (console == NULL)
-    return;
-
-  ply_console_close (console);
-
-  free_vt_change_closures (console);
-  free (console);
-}
-
-int
-ply_console_get_active_vt (ply_console_t *console)
-{
-  return console->active_vt;
-}
-
-bool
-ply_console_set_active_vt (ply_console_t *console,
-                           int            vt_number)
-{
-  assert (console != NULL);
-
-  if (vt_number <= 0)
-    return false;
-
-  if (vt_number == console->active_vt)
-    return true;
-
-  if (ioctl (console->fd, VT_ACTIVATE, vt_number) < 0)
-    return false;
-
-  console->next_active_vt = vt_number;
-
-  return true;
-}
-
-void
-ply_console_watch_for_active_vt_change (ply_console_t *console,
-                                        
ply_console_active_vt_changed_handler_t active_vt_changed_handler,
-                                        void *user_data)
-{
-  ply_console_active_vt_changed_closure_t *closure;
-
-  closure = calloc (1, sizeof (*closure));
-  closure->handler = active_vt_changed_handler;
-  closure->user_data = user_data;
-
-  ply_list_append_data (console->vt_change_closures, closure);
-}
-
-void
-ply_console_stop_watching_for_active_vt_change (ply_console_t *console,
-                                                
ply_console_active_vt_changed_handler_t active_vt_changed_handler,
-                                                void *user_data)
-{
-  ply_list_node_t *node;
-
-  node = ply_list_get_first_node (console->vt_change_closures);
-  while (node != NULL)
-    {
-      ply_console_active_vt_changed_closure_t *closure;
-      ply_list_node_t *next_node;
-
-      closure = ply_list_node_get_data (node);
-      next_node = ply_list_get_next_node (console->vt_change_closures, node);
-
-      if (closure->handler == active_vt_changed_handler &&
-          closure->user_data == user_data)
-        {
-          free (closure);
-          ply_list_remove_node (console->vt_change_closures, node);
-        }
-
-      node = next_node;
-    }
-}
-
-/* vim: set ts=4 sw=4 et ai ci 
cino={.5s,^-2,+.5s,t0,g0,e-2,n-2,p2s,(0,=.5s,:.5s */
diff --git a/src/libply-splash-core/ply-console.h 
b/src/libply-splash-core/ply-console.h
deleted file mode 100644
index 4b45c86..0000000
--- a/src/libply-splash-core/ply-console.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ply-console.h - APIs for consoleing text
- *
- * Copyright (C) 2009 Red Hat, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- *
- * Written By: Ray Strode <[email protected]>
- */
-#ifndef PLY_CONSOLE_H
-#define PLY_CONSOLE_H
-
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <unistd.h>
-
-typedef struct _ply_console ply_console_t;
-typedef void (* ply_console_active_vt_changed_handler_t) (void           
*user_data,
-                                                          ply_console_t 
*console);
-
-typedef enum
-{
-  PLY_CONSOLE_MODE_TEXT,
-  PLY_CONSOLE_MODE_GRAPHICS
-} ply_console_mode_t;
-
-#ifndef PLY_HIDE_FUNCTION_DECLARATIONS
-ply_console_t *ply_console_new (void);
-
-void ply_console_free (ply_console_t *console);
-
-bool ply_console_open (ply_console_t *console);
-bool ply_console_is_open (ply_console_t *console);
-void ply_console_close (ply_console_t *console);
-
-void ply_console_set_mode (ply_console_t     *console,
-                           ply_console_mode_t mode);
-
-void ply_console_ignore_mode_changes (ply_console_t *console,
-                                      bool           should_ignore);
-
-int ply_console_get_fd (ply_console_t *console);
-int ply_console_get_active_vt (ply_console_t *console);
-bool ply_console_set_active_vt (ply_console_t *console,
-                                int            vt_number);
-
-void ply_console_watch_for_active_vt_change (ply_console_t *console,
-                                             
ply_console_active_vt_changed_handler_t active_vt_changed_handler,
-                                             void *user_data);
-void ply_console_stop_watching_for_active_vt_change (ply_console_t *console,
-                                             
ply_console_active_vt_changed_handler_t active_vt_changed_handler,
-                                             void *user_data);
-
-#endif
-
-#endif /* PLY_CONSOLE_H */
-/* vim: set ts=4 sw=4 et ai ci 
cino={.5s,^-2,+.5s,t0,g0,e-2,n-2,p2s,(0,=.5s,:.5s */
diff --git a/src/tests/ply-boot-splash-test.am 
b/src/tests/ply-boot-splash-test.am
index cad36d8..9dd1598 100644
--- a/src/tests/ply-boot-splash-test.am
+++ b/src/tests/ply-boot-splash-test.am
@@ -9,8 +9,6 @@ ply_boot_splash_test_LDADD = $(PLYMOUTH_LIBS) 
../libply/libply.la
 
 ply_boot_splash_test_SOURCES =                                                 
  \
                           
$(srcdir)/../libply-splash-core/ply-boot-splash-plugin.h \
-                          $(srcdir)/../libply-splash-core/ply-console.h        
    \
-                          $(srcdir)/../libply-splash-core/ply-console.c        
    \
                           $(srcdir)/../libply-splash-core/ply-keyboard.h       
    \
                           $(srcdir)/../libply-splash-core/ply-keyboard.c       
    \
                           $(srcdir)/../libply-splash-core/ply-pixel-buffer.h   
    \
-- 
1.7.0



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

Message: 3
Date: Thu, 18 Mar 2010 04:34:31 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 10/21] [terminal] don't treat ttySx as VT
To: [email protected]
Message-ID:
        
<6d0e13b604e23bb78a3b633efbc34fc1dcd99e3a.1268889867.git.sc...@ubuntu.com>
        

Only devices with TTY_MAJOR and minor from 0-63 are VTs, 64 onwards
are serial consoles.
---
 src/libply-splash-core/ply-terminal.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/libply-splash-core/ply-terminal.c 
b/src/libply-splash-core/ply-terminal.c
index 3e54075..8f76ff0 100644
--- a/src/libply-splash-core/ply-terminal.c
+++ b/src/libply-splash-core/ply-terminal.c
@@ -292,7 +292,7 @@ ply_terminal_check_for_vt (ply_terminal_t *terminal)
   major_number = major (file_attributes.st_rdev);
   minor_number = minor (file_attributes.st_rdev);
 
-  if (major_number == TTY_MAJOR)
+  if ((major_number == TTY_MAJOR) && (minor_number < 64))
     terminal->vt_number = minor_number;
   else
     terminal->vt_number = -1;
-- 
1.7.0



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

Message: 4
Date: Thu, 18 Mar 2010 04:47:23 +0000
From: Scott James Remnant <[email protected]>
Subject: [PATCH 12/21] [drm] don't run on non-virtual terminals
To: [email protected]
Message-ID:
        
<acaa1dc8872ec8b5b89282511865c6fce545e992.1268889867.git.sc...@ubuntu.com>
        

We only need support DRM on virtual terminals, those that are not
such as serial consoles, can be trivially skipped.
---
 src/plugins/renderers/drm/plugin.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/plugins/renderers/drm/plugin.c 
b/src/plugins/renderers/drm/plugin.c
index f4e3dde..6d4ce9b 100644
--- a/src/plugins/renderers/drm/plugin.c
+++ b/src/plugins/renderers/drm/plugin.c
@@ -502,6 +502,13 @@ open_device (ply_renderer_backend_t *backend)
       return false;
     }
 
+  if (!ply_terminal_is_vt (backend->terminal))
+    {
+      ply_trace ("terminal is not a VT");
+      ply_terminal_close (backend->terminal);
+      return false;
+    }
+
   ply_terminal_watch_for_active_vt_change (backend->terminal,
                                            
(ply_terminal_active_vt_changed_handler_t)
                                            on_active_vt_changed,
-- 
1.7.0



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

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


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

Reply via email to