rpms/kdebase-workspace/F-13 kdebase-workspace-4.4.2-novt.patch, NONE, 1.1 kubuntu_34_kdm_plymouth_transition.diff, NONE, 1.1 kdebase-workspace.spec, 1.377, 1.378

Rex Dieter rdieter at fedoraproject.org
Tue Apr 6 17:25:28 UTC 2010


Author: rdieter

Update of /cvs/pkgs/rpms/kdebase-workspace/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv7237

Modified Files:
	kdebase-workspace.spec 
Added Files:
	kdebase-workspace-4.4.2-novt.patch 
	kubuntu_34_kdm_plymouth_transition.diff 
Log Message:
* Tue Apr 06 2010 Rex Dieter <rdieter at fedoraproject.org> - 4.4.2-2
- try to workaround "X server hogs the CPU (#577482)" by letting X
  choose vt itself
- include (but not yet apply) kubuntu_34_kdm_plymouth_transition.diff


kdebase-workspace-4.4.2-novt.patch:
 server.c |    6 ------
 1 file changed, 6 deletions(-)

--- NEW FILE kdebase-workspace-4.4.2-novt.patch ---
--- kdebase-workspace-4.4.2/kdm/backend/server.c.novt	2009-10-26 03:14:47.000000000 -0600
+++ kdebase-workspace-4.4.2/kdm/backend/server.c	2010-04-05 13:28:56.982657954 -0600
@@ -59,12 +59,6 @@
 	    !(argv = parseArgs( argv, args )) ||
 	    !(argv = addStrArr( argv, d->name, -1 )))
 		exit( 47 );
-#ifdef HAVE_VTS
-	if (d->serverVT &&
-	    !(argv = addStrArr( argv, vtstr,
-	                        sprintf( vtstr, "vt%d", d->serverVT ) )))
-		exit( 47 );
-#endif
 	return argv;
 }
 

kubuntu_34_kdm_plymouth_transition.diff:
 dm.c     |   95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 dm.h     |    6 +++
 server.c |   19 +++++++++++-
 3 files changed, 117 insertions(+), 3 deletions(-)

--- NEW FILE kubuntu_34_kdm_plymouth_transition.diff ---
Description: Add support for smooth transition from Plymouth's bootsplash
 If possible, KDM will try to deactivate plymouth, start X (with -nr) on
 the active vt and leave the bootsplash on the screen until the graphical
 login takes place.
Forwarded: no
Bug: https://bugs.launchpad.net/ubuntu/+source/kdebase-workspace/+bug/540177
Author: Alberto Milone <alberto.milone at canonical.com>

diff -Nurp kdebase-workspace-4.4.1.orig/kdm/backend/dm.c kdebase-workspace-4.4.1/kdm/backend/dm.c
--- kdebase-workspace-4.4.1.orig/kdm/backend/dm.c	2009-10-26 10:14:47.000000000 +0100
+++ kdebase-workspace-4.4.1/kdm/backend/dm.c	2010-03-25 12:48:13.861357254 +0100
@@ -1066,8 +1066,8 @@ reapChildren( void )
 				/* don't kill again */
 				break;
 			case running:
-				if (startingServer == d && d->serverStatus != ignore) {
-					if (d->serverStatus == starting && waitCode( status ) != 47)
+				if (startingServer == d /* && d->serverStatus != ignore */) {
+					if (/*d->serverStatus == starting &&*/ waitCode( status ) != 47)
 						logError( "X server died during startup\n" );
 					startServerFailed();
 					break;
@@ -1330,6 +1330,71 @@ getBusyVTs( void )
 	return activeVTs;
 }
 
+/* Return the active VT as an integer */
+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 int
+plymouth_is_running (void)
+{
+        int status;
+        status = system ("/bin/plymouth --ping");
+
+        return WIFEXITED (status) && WEXITSTATUS (status) == 0;
+}
+
+static int
+plymouth_has_active_vt (void)
+{
+        int status;
+        status = system ("/bin/plymouth --has-active-vt");
+
+        return WIFEXITED (status) && WEXITSTATUS (status) == 0;
+}
+
+static int
+plymouth_prepare_for_transition (void)
+{
+        int status;
+        status = system ("/bin/plymouth deactivate");
+
+        return WIFEXITED (status) && WEXITSTATUS (status) == 0;
+}
+
+int
+plymouth_quit_with_transition (void)
+{
+        int status;
+        status = system ("/bin/plymouth quit --retain-splash");
+
+        return WIFEXITED (status) && WEXITSTATUS (status) == 0;
+}
+
+int
+plymouth_quit_without_transition (void)
+{
+        int status;
+        status = system ("/bin/plymouth quit");
+
+        return WIFEXITED (status) && WEXITSTATUS (status) == 0;
+}
+
 static void
 allocateVT( struct display *d )
 {
@@ -1339,6 +1404,32 @@ allocateVT( struct display *d )
 	if ((d->displayType & d_location) == dLocal &&
 	    d->status == notRunning && !d->serverVT && d->reqSrvVT >= 0)
 	{
+		d->plymouth_is_running = plymouth_is_running ();
+		if (d->plymouth_is_running) {
+			/* call plymouth deactivate */
+			plymouth_prepare_for_transition ();
+			if (plymouth_has_active_vt ()) {
+				/* plymouth was displaying a splash screen and has
+				 * terminated leaving it on screen
+				 */
+				int vt;
+				vt = get_active_vt ();
+				if (vt > 0) {
+					/* start the X server on the active vt */
+					d->serverVT = vt;
+					return;
+				}
+			}
+			else {
+				/* plymouth might have been running but did not display
+				 * a splash screen.
+				 */ 
+				
+				 /* call plymouth quit and start the X server as usual */
+				d->plymouth_is_running = !plymouth_quit_without_transition ();
+			}
+		}
+
 		if (d->reqSrvVT && d->reqSrvVT < 16)
 			d->serverVT = d->reqSrvVT;
 		else {
diff -Nurp kdebase-workspace-4.4.1.orig/kdm/backend/dm.h kdebase-workspace-4.4.1/kdm/backend/dm.h
--- kdebase-workspace-4.4.1.orig/kdm/backend/dm.h	2009-10-26 10:14:47.000000000 +0100
+++ kdebase-workspace-4.4.1/kdm/backend/dm.h	2010-03-25 12:46:54.171786017 +0100
@@ -288,6 +288,8 @@ struct display {
 	Xauth **authorizations;     /* authorization data */
 	int authNum;                /* number of authorizations */
 	char *authFile;             /* file to store authorization in */
+
+	int plymouth_is_running;    /* Plymouth's status */
 };
 
 #define d_location   1
@@ -400,6 +402,10 @@ int anyDisplaysLeft( void );
 void forEachDisplay( void (*f)( struct display * ) );
 #ifdef HAVE_VTS
 void forEachDisplayRev( void (*f)( struct display * ) );
+/* functions for plymouth */
+int get_active_vt (void);
+int plymouth_quit_with_transition (void);
+int plymouth_quit_without_transition (void);
 #endif
 void removeDisplay( struct display *old );
 struct display
diff -Nurp kdebase-workspace-4.4.1.orig/kdm/backend/server.c kdebase-workspace-4.4.1/kdm/backend/server.c
--- kdebase-workspace-4.4.1.orig/kdm/backend/server.c	2009-10-26 10:14:47.000000000 +0100
+++ kdebase-workspace-4.4.1/kdm/backend/server.c	2010-03-25 12:53:06.561387817 +0100
@@ -43,6 +43,9 @@ from the copyright holder.
 #include <stdio.h>
 #include <signal.h>
 
+/* These are for bulletproof X */
+/* #define SERVER_ATTEMPTS 3 */
+/* char* failsafeXServer[] = {"/etc/gdm/failsafeXServer", 0}; */
 
 struct display *startingServer;
 time_t serverTimeout = TO_INF;
@@ -50,11 +53,11 @@ time_t serverTimeout = TO_INF;
 char **
 prepareServerArgv( struct display *d, const char *args )
 {
+	debug( "Preparing X server arguments...\n" );
 	char **argv;
 #ifdef HAVE_VTS
 	char vtstr[8];
 #endif
-
 	if (!(argv = parseArgs( 0, d->serverCmd )) ||
 	    !(argv = parseArgs( argv, args )) ||
 	    !(argv = addStrArr( argv, d->name, -1 )))
@@ -110,6 +113,7 @@ startServer( struct display *d )
 {
 	startingServer = d;
 	d->startTries = 0;
+	/* d->serverAttempts = SERVER_ATTEMPTS; */
 	startServerOnce();
 }
 
@@ -134,6 +138,14 @@ startServerSuccess()
 	struct display *d = startingServer;
 	d->serverStatus = ignore;
 	serverTimeout = TO_INF;
+	if (d->plymouth_is_running) {
+		/* The xserver was started successfully on 1st try
+		 * as we stop plymouth before entering failsafe X
+		 */
+		debug( "Quitting Plymouth with transition\n" );
+		d->plymouth_is_running = !plymouth_quit_with_transition ();
+		debug ("Is Plymouth still running? %s\n", d->plymouth_is_running ? "yes" : "no");
+	}
 	debug( "X server ready, starting session\n" );
 	startDisplayP2( d );
 }
@@ -144,6 +156,11 @@ startServerFailed()
 	struct display *d = startingServer;
 	if (!d->serverAttempts || d->startTries < d->serverAttempts) {
 		d->serverStatus = pausing;
+		/* Run Failsafe X here */
+		logError("Failed to start X server. Starting failsafe X server.\n");
+		/* Stop plymouth before entering failsafe X */
+		d->plymouth_is_running = !plymouth_quit_without_transition ();
+		/* runAndWait(failsafeXServer, 0); */
 		serverTimeout = d->openDelay + now;
 	} else {
 		d->serverStatus = ignore;


Index: kdebase-workspace.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kdebase-workspace/F-13/kdebase-workspace.spec,v
retrieving revision 1.377
retrieving revision 1.378
diff -u -p -r1.377 -r1.378
--- kdebase-workspace.spec	3 Apr 2010 11:30:38 -0000	1.377
+++ kdebase-workspace.spec	6 Apr 2010 17:25:27 -0000	1.378
@@ -22,7 +22,7 @@
 Summary: KDE Workspace
 Name:    kdebase-workspace
 Version: 4.4.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 
 License: GPLv2
 Group:   User Interface/Desktops
@@ -62,13 +62,17 @@ Patch21: kdebase-workspace-4.3.98-platfo
 # fix the Games menu in the classic menu mixing up Name and Description
 Patch22: kdebase-workspace-4.4.0-classicmenu-games.patch
 
-# upstream patches:
+# upstreamable patches:
 # "keyboard stops working", https://bugs.kde.org/show_bug.cgi?id=171685#c135
 Patch50: kdebase-workspace-4.3.3-kde#171685.patch
 # kubuntu working to upstream this
 # FIXME: Not upstreamed yet --Ben (4.3.80)
 #Patch51: http://bazaar.launchpad.net/~kubuntu-members/kdebase-workspace/ubuntu/annotate/head%3A/debian/patches/kubuntu_101_brightness_fn_keys_and_osd.diff
 Patch51: kdebase-workspace-4.3.95-brightness_keys.patch
+# HACK/FIXME, drop vt handling from kdm, let X choose itself 
+Patch52: kdebase-workspace-4.4.2-novt.patch
+# kubuntu kudos! , slightly modified to comment-out bulletproof-X bits
+Patch53: kubuntu_34_kdm_plymouth_transition.diff
 
 # 4.4 patches
 Patch100: kdebase-workspace-4.4.2-qt47.patch
@@ -330,6 +334,12 @@ Requires: akonadi
 %patch50 -p1 -b .kde#171685
 # kubuntu patches
 %patch51 -p1 -b .brightness_keys
+%if 0%{?fedora} > 12
+%patch52 -p1 -b .novt
+%endif
+%if 0%{?plymouth_hack_ping}
+%patch53 -p1 -b .kdm_plymouth
+%endif
 # 4.4 patches
 %patch100 -p1 -b .qt47
 
@@ -684,6 +694,11 @@ fi
 
 
 %changelog
+* Tue Apr 06 2010 Rex Dieter <rdieter at fedoraproject.org> - 4.4.2-2
+- try to workaround "X server hogs the CPU (#577482)" by letting X
+  choose vt itself
+- include (but not yet apply) kubuntu_34_kdm_plymouth_transition.diff
+
 * Mon Mar 29 2010 Lukas Tinkl <ltinkl at redhat.com> - 4.4.2-1
 - 4.4.2
 



More information about the scm-commits mailing list