Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Nov 2009 17:30:49 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r198911 - head/sys/dev/fb
Message-ID:  <200911041730.nA4HUnjW040150@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Wed Nov  4 17:30:48 2009
New Revision: 198911
URL: http://svn.freebsd.org/changeset/base/198911

Log:
  Do not probe video mode if we are not going to use it.

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Wed Nov  4 17:00:24 2009	(r198910)
+++ head/sys/dev/fb/vesa.c	Wed Nov  4 17:30:48 2009	(r198911)
@@ -1450,10 +1450,11 @@ vesa_load_state(video_adapter_t *adp, vo
 	 * If the current mode is not the same, probably it was powered down.
 	 * Try BIOS POST to restore a sane state.
 	 */
-	mode = vesa_bios_get_current_mode();
-	if (mode >= 0 && (mode & 0x1ff) != adp->va_mode &&
-	    VESA_MODE(adp->va_mode))
-		(void)vesa_bios_post();
+	if (VESA_MODE(adp->va_mode)) {
+		mode = vesa_bios_get_current_mode();
+		if (mode >= 0 && (mode & 0x1ff) != adp->va_mode)
+			(void)vesa_bios_post();
+	}
 
 	ret = vesa_bios_save_restore(STATE_LOAD, ((adp_state_t *)p)->regs,
 	    vesa_state_buf_size);
@@ -1461,9 +1462,10 @@ vesa_load_state(video_adapter_t *adp, vo
 	/*
 	 * If the desired mode is not restored, force setting the mode.
 	 */
-	mode = vesa_bios_get_current_mode();
-	if (mode >= 0 && (mode & 0x1ff) != adp->va_mode &&
-	    VESA_MODE(adp->va_mode)) {
+	if (VESA_MODE(adp->va_mode)) {
+		mode = vesa_bios_get_current_mode();
+		if (mode < 0 || (mode & 0x1ff) == adp->va_mode)
+			return (ret);
 		mode = adp->va_mode;
 		flags = adp->va_info.vi_flags;
 		if ((flags & V_INFO_GRAPHICS) != 0 &&



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