Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Apr 2012 21:38:26 +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: r233894 - head/sys/dev/fb
Message-ID:  <201204042138.q34LcQVR026274@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Wed Apr  4 21:38:26 2012
New Revision: 233894
URL: http://svn.freebsd.org/changeset/base/233894

Log:
  Do not copy VESA state buffer if the VBE call has failed for any reason.
  Do not unnecessarily clear the state buffer before calling the function.

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

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Wed Apr  4 21:31:20 2012	(r233893)
+++ head/sys/dev/fb/vesa.c	Wed Apr  4 21:38:26 2012	(r233894)
@@ -542,7 +542,8 @@ vesa_bios_save_restore(int code, void *p
 	switch (code) {
 	case STATE_SAVE:
 		x86bios_intr(&regs, 0x10);
-		bcopy(vesa_state_buf, p, vesa_state_buf_size);
+		if (regs.R_AX == 0x004f)
+			bcopy(vesa_state_buf, p, vesa_state_buf_size);
 		break;
 	case STATE_LOAD:
 		bcopy(p, vesa_state_buf, vesa_state_buf_size);
@@ -1481,7 +1482,6 @@ vesa_save_state(video_adapter_t *adp, vo
 	} else
 		vesa_vmem_buf = NULL;
 	((adp_state_t *)p)->sig = V_STATE_SIG;
-	bzero(((adp_state_t *)p)->regs, vesa_state_buf_size);
 	return (vesa_bios_save_restore(STATE_SAVE, ((adp_state_t *)p)->regs));
 }
 



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