From owner-svn-src-all@FreeBSD.ORG Thu Mar 25 17:51:05 2010 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 ADA31106566B; Thu, 25 Mar 2010 17:51:05 +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 839D68FC17; Thu, 25 Mar 2010 17:51:05 +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 o2PHp5kC093572; Thu, 25 Mar 2010 17:51:05 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2PHp5hu093570; Thu, 25 Mar 2010 17:51:05 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201003251751.o2PHp5hu093570@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 25 Mar 2010 17:51:05 +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: r205653 - 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: Thu, 25 Mar 2010 17:51:05 -0000 Author: jkim Date: Thu Mar 25 17:51:05 2010 New Revision: 205653 URL: http://svn.freebsd.org/changeset/base/205653 Log: Do not penalize correct or correctable VESA mode tables by calling another VBE function. Most problems should be corrected by the mode table sanity check and we only need the paranoid in extremely rare cases. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Thu Mar 25 17:24:03 2010 (r205652) +++ head/sys/dev/fb/vesa.c Thu Mar 25 17:51:05 2010 (r205653) @@ -189,7 +189,9 @@ static int vesa_bios_load_palette2(int s #define STATE_ALL (STATE_HW | STATE_DATA | STATE_DAC | STATE_REG) static ssize_t vesa_bios_state_buf_size(void); static int vesa_bios_save_restore(int code, void *p, size_t size); +#ifdef MODE_TABLE_BROKEN static int vesa_bios_get_line_length(void); +#endif static int vesa_bios_set_line_length(int pixel, int *bytes, int *lines); #if 0 static int vesa_bios_get_start(int *x, int *y); @@ -558,6 +560,7 @@ vesa_bios_save_restore(int code, void *p return (regs.R_AX != 0x004f); } +#ifdef MODE_TABLE_BROKEN static int vesa_bios_get_line_length(void) { @@ -574,6 +577,7 @@ vesa_bios_get_line_length(void) return (regs.R_BX); } +#endif static int vesa_bios_set_line_length(int pixel, int *bytes, int *lines) @@ -1213,7 +1217,6 @@ static int vesa_set_mode(video_adapter_t *adp, int mode) { video_info_t info; - int bpsl; if (adp != vesa_adp) return ((*prevvidsw->set_mode)(adp, mode)); @@ -1295,14 +1298,18 @@ vesa_set_mode(video_adapter_t *adp, int if ((info.vi_flags & V_INFO_GRAPHICS) != 0) vesa_adp->va_line_width /= info.vi_planes; +#ifdef MODE_TABLE_BROKEN /* If VBE function returns bigger bytes per scan line, use it. */ - bpsl = vesa_bios_get_line_length(); - if (bpsl > vesa_adp->va_line_width) { - vesa_adp->va_line_width = bpsl; - info.vi_buffer_size = bpsl * info.vi_height; - if ((info.vi_flags & V_INFO_GRAPHICS) != 0) - info.vi_buffer_size *= info.vi_planes; + { + int bpsl = vesa_bios_get_line_length(); + if (bpsl > vesa_adp->va_line_width) { + vesa_adp->va_line_width = bpsl; + info.vi_buffer_size = bpsl * info.vi_height; + if ((info.vi_flags & V_INFO_GRAPHICS) != 0) + info.vi_buffer_size *= info.vi_planes; + } } +#endif if (info.vi_flags & V_INFO_LINEAR) { #if VESA_DEBUG > 1