Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Nov 2004 13:44:03 +0700
From:      Eugene Grosbein <eugen@grosbein.pp.ru>
To:        bug-followup@freebsd.org
Cc:        multimedia@freebsd.org
Subject:   Re: kern/64114: [PATCH] bad vertical refresh for console using Radeon 9200 VIVO
Message-ID:  <20041127064403.GA1116@grosbein.pp.ru>

next in thread | raw e-mail | index | archive | help
Michael Joyner <mjoyner@vbservices.net> wrote:

> eh?
> 
> plain text please!

Here it comes:

--- sys/conf/options.i386.orig	Sat Mar  6 14:33:55 2004
+++ sys/conf/options.i386	Fri Mar 12 00:48:44 2004
@@ -101,6 +101,7 @@
 VGA_NO_MODE_CHANGE	opt_vga.h
 VGA_SLOW_IOACCESS	opt_vga.h
 VGA_WIDTH90		opt_vga.h
+VGA_PREFER_BIOSMODE	opt_vga.h
 
 VESA			opt_vesa.h
 VESA_DEBUG		opt_vesa.h
--- sys/i386/conf/LINT.orig	Sat Mar  6 14:34:13 2004
+++ sys/i386/conf/LINT	Fri Mar 12 00:54:21 2004
@@ -1141,6 +1141,11 @@
 # The following option probably won't work with the LCD displays.
 options 	VGA_WIDTH90		# support 90 column modes
 
+# Try the following option if an initial video mode does not satisfy you.
+# The vga(4) driver will prefer BIOS mode settings that are better for some
+# cards provided with video-out (f.e. ATI Radeon)
+options		VGA_PREFER_BIOSMODE
+
 # To include support for VESA video modes
 options 	VESA
 
--- sys/dev/fb/vga.c.orig	Sat Aug 11 10:58:44 2001
+++ sys/dev/fb/vga.c	Thu Oct  7 02:20:39 2004
@@ -1105,6 +1105,13 @@
 		    rows_offset = adpstate.regs[1] + 1 - mp[1];
 		    break;
 
+#ifdef VGA_PREFER_BIOSMODE
+		case COMP_DIFFERENT: /* one may prefer BIOS register values */
+		default:
+		    bcopy(adpstate2.regs, adpstate.regs, sizeof(adpstate.regs));
+		    /* FALL THROUGH */
+#endif
+
 		case COMP_SIMILAR:
 		    /*
 		     * Not exactly the same, but similar enough to be
@@ -1117,6 +1124,7 @@
 		    adpstate.regs[1] -= rows_offset - 1;
 		    break;
 
+#ifndef VGA_PREFER_BIOSMODE 
 		case COMP_DIFFERENT:
 		default:
 		    /*
@@ -1130,6 +1138,7 @@
 		    mode_map[adp->va_initial_mode] = adpstate.regs;
 		    rows_offset = 1;
 		    break;
+#endif
 		}
 	    }
 #endif /* VGA_NO_BIOS || VGA_NO_MODE_CHANGE */
@@ -1379,6 +1388,16 @@
 		return ENXIO;
 	adp->va_flags |= V_ADP_REGISTERED;
     }
+
+#ifdef VGA_PREFER_BIOSMODE
+    /* 
+	reset parameter values immediately if initial mode
+	was not changed by splash(4) or by other means
+    */
+    if (adp->va_mode == adp->va_initial_mode)
+	vga_set_mode(adp, adp->va_initial_mode);
+#endif
+
     if (vga_sub_configure != NULL)
 	(*vga_sub_configure)(0);
 
--- share/man/man4/vga.4.orig	Fri Mar 12 01:37:08 2004
+++ share/man/man4/vga.4	Fri Mar 12 01:48:52 2004
@@ -38,6 +38,7 @@
 .Cd "options VGA_ALT_SEQACCESS"
 .Cd "options VGA_NO_FONT_LOADING"
 .Cd "options VGA_NO_MODE_CHANGE"
+.Cd "options VGA_PREFER_BIOSMODE"
 .Cd "options VGA_SLOW_IOACCESS"
 .Cd "options VGA_WIDTH90"
 .Cd "device vga0 at isa? port ?
@@ -82,6 +83,13 @@
 You may want to try this option if the mouse pointer is not drawn correctly
 or the font does not seem to be loaded properly on the VGA card.
 However, it may cause flicker on some systems.
+.It Dv VGA_PREFER_BIOSMODE
+This option changes default behaviour of the driver when the settings
+of the initial video mode differ from BIOS setting for that mode greatly.
+By default the driver will ignore BIOS settings. The option forces
+it to ignore initial settings and use ones supplied by BIOS.
+Try this option if you experience very low refresh rate using
+standard video console.
 .It Dv VGA_SLOW_IOACCESS
 Older VGA cards may require this option for proper operation.
 It makes the driver perform byte-wide I/O to VGA registers and
 


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