From owner-svn-src-all@FreeBSD.ORG Wed Nov 4 17:30:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 392B71065696; Wed, 4 Nov 2009 17:30:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 287E08FC0A; Wed, 4 Nov 2009 17:30:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nA4HUn12040152; Wed, 4 Nov 2009 17:30:49 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA4HUnjW040150; Wed, 4 Nov 2009 17:30:49 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200911041730.nA4HUnjW040150@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 4 Nov 2009 17:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198911 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2009 17:30:49 -0000 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 &&