Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Dec 2012 10:44:16 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r244249 - projects/calloutng/sys/dev/syscons
Message-ID:  <201212151044.qBFAiG70038633@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Dec 15 10:44:16 2012
New Revision: 244249
URL: http://svnweb.freebsd.org/changeset/base/244249

Log:
  Switch syscons from timeout() to callout_reset_flags() and specify that
  precision is not important there -- anything from 20 to 30Hz will be fine.

Modified:
  projects/calloutng/sys/dev/syscons/syscons.c
  projects/calloutng/sys/dev/syscons/syscons.h

Modified: projects/calloutng/sys/dev/syscons/syscons.c
==============================================================================
--- projects/calloutng/sys/dev/syscons/syscons.c	Sat Dec 15 10:30:06 2012	(r244248)
+++ projects/calloutng/sys/dev/syscons/syscons.c	Sat Dec 15 10:44:16 2012	(r244249)
@@ -504,6 +504,8 @@ sc_attach_unit(int unit, int flags)
 
     sc = sc_get_softc(unit, flags & SC_KERNEL_CONSOLE);
     sc->config = flags;
+    callout_init(&sc->ctimeout, FALSE);
+    callout_init(&sc->cblink, FALSE);
     scp = sc_get_stat(sc->dev[0]);
     if (sc_console == NULL)	/* sc_console_unit < 0 */
 	sc_console = scp;
@@ -1831,7 +1833,8 @@ scrn_timer(void *arg)
     /* don't do anything when we are performing some I/O operations */
     if (suspend_in_progress || sc->font_loading_in_progress) {
 	if (again)
-	    timeout(scrn_timer, sc, hz / 10);
+	    callout_reset_flags(&sc->ctimeout, hz / 15, scrn_timer, sc,
+		C_PRELSET(0));
 	return;
     }
     s = spltty();
@@ -1881,7 +1884,8 @@ scrn_timer(void *arg)
     if (sc->blink_in_progress || sc->switch_in_progress
 	|| sc->write_in_progress) {
 	if (again)
-	    timeout(scrn_timer, sc, hz / 10);
+	    callout_reset_flags(&sc->ctimeout, hz / 15, scrn_timer, sc,
+		C_PRELSET(0));
 	splx(s);
 	return;
     }
@@ -1899,7 +1903,8 @@ scrn_timer(void *arg)
 #endif
 
     if (again)
-	timeout(scrn_timer, sc, hz / 25);
+	callout_reset_flags(&sc->ctimeout, hz / 30, scrn_timer, sc,
+	    C_PRELSET(1));
     splx(s);
 }
 
@@ -3844,7 +3849,8 @@ blink_screen(void *arg)
 	(*scp->rndr->draw)(scp, 0, scp->xsize*scp->ysize, 
 			   scp->sc->blink_in_progress & 1);
 	scp->sc->blink_in_progress--;
-	timeout(blink_screen, scp, hz / 10);
+	callout_reset_flags(&scp->sc->cblink, hz / 15, blink_screen, scp,
+	    C_PRELSET(0));
     }
 }
 

Modified: projects/calloutng/sys/dev/syscons/syscons.h
==============================================================================
--- projects/calloutng/sys/dev/syscons/syscons.h	Sat Dec 15 10:30:06 2012	(r244248)
+++ projects/calloutng/sys/dev/syscons/syscons.h	Sat Dec 15 10:44:16 2012	(r244249)
@@ -269,6 +269,8 @@ typedef struct sc_softc {
 #ifdef KDB
 	int		sc_altbrk;
 #endif
+	struct callout	ctimeout;
+	struct callout	cblink;
 } sc_softc_t;
 
 /* virtual screen */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212151044.qBFAiG70038633>