From owner-freebsd-stable Tue Apr 23 7:14:55 2002 Delivered-To: freebsd-stable@freebsd.org Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by hub.freebsd.org (Postfix) with ESMTP id 84A9D37B404 for ; Tue, 23 Apr 2002 07:14:47 -0700 (PDT) Received: from max ([12.254.136.195]) by rwcrmhc53.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with SMTP id <20020423141446.WNES12144.rwcrmhc53.attbi.com@max>; Tue, 23 Apr 2002 14:14:46 +0000 Message-ID: <001301c1ead1$3b6ce020$0900a8c0@max> From: "John Nielsen" To: "Vladislav V. Zhuk" , References: <20020423060700.GD8644@dru.dn.ua> <031f01c1eabe$9dc984c0$0900a8c0@max> Subject: Re: screen refresh rate Date: Tue, 23 Apr 2002 08:14:50 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="KOI8-R" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ----- Original Message ----- From: "John Nielsen" To: "Vladislav V. Zhuk" ; Sent: Tuesday, April 23, 2002 6:01 AM Subject: Re: screen refresh rate > ----- Original Message ----- > From: "Vladislav V. Zhuk" > To: > Sent: Tuesday, April 23, 2002 12:07 AM > Subject: screen refresh rate > > Hi! > > > > I'm work at the computer up to 12 hours per day. The refresh > > rate of textmodes in FreeBSD is too low (60-70 Hz). But i want > > to safe my eyes. > > > > How I can to raise refresh rate to (for example) 85-90 Hz > > on text modes (80x25, 80x30, 80x43, 80x50 and other) ?? > > > > FreeBSD 4.5-STABLE #0: Tue Apr 9 16:24:26 EEST 2002 > > Vanilla FreeBSD does not offer this functionality. I seem to recall seeing > a link to a patch that would do this a while back, but I can't find it now. > I did find a patch here, > http://www.opennet.ru/base/patch/100x37-800x600-100Hz.txt.html > but I haven't tried it and can't vouch for its usability. Be aware that if > your hardware doesn't support the new defaults set by this patch that your > system may become unusable even in single-user mode. I love talking to myself on public forums. :) I applied the patch below to one of my systems here (with a Radeon all-in-wonder card and a generic 19" monitor) and it works fine. At least, I assume it's working (I'm not as sensitive to refresh rates in console mode as some). There weren't any errors, anyway. vidcontrol.c has been cleaned up a bit since the patch at the URL above was produced, so I had to modify that part of the patch to accomodate for the changes. According to the webpage, the default mode is supposed to change to 100x37, but I didn't see a change in that regard (and in fact couldn't change to that mode). Anyway, here's what I used. Once again, use at your own risk. JN --- src,orig/sys/i386/isa/vesa.c Sat Jan 29 18:08:40 2000 +++ src/sys/i386/isa/vesa.c Thu Mar 16 11:44:31 2000 @@ -1016,7 +1016,25 @@ if (!(info.vi_flags & V_INFO_GRAPHICS)) info.vi_flags &= ~V_INFO_LINEAR; - if (vesa_bios_set_mode(mode | ((info.vi_flags & V_INFO_LINEAR) ? 0x4000 : 0))) + if (mode == M_VESA_800x600) { /* XXX ignores V_INFO_LINEAR */ + unsigned char crtc[0x19]; + unsigned char reg; + if (vesa_bios_set_mode(mode)) + return 1; + for (reg=0;reg<0x19;++reg) { + outb(0x3d4,reg); + crtc[reg]=inb(0x3d5); + } + if (!vesa_bios_set_mode(M_VESA_1024x768)) { + outb(0x3d4,0x11); + outb(0x3d5,crtc[0x11]&0x7f); + for (reg=0;reg<0x19;++reg) { + outb(0x3d4,reg); + outb(0x3d5,crtc[reg]); + } + } + } else + if (vesa_bios_set_mode(mode | ((info.vi_flags & V_INFO_LINEAR) ? 0x4000 : 0))) return 1; if (adp->va_info.vi_flags & V_INFO_LINEAR) --- /usr/src/usr.sbin/vidcontrol/vidcontrol.c.orig Tue Apr 23 07:02:22 2002 +++ /usr/src/usr.sbin/vidcontrol/vidcontrol.c Tue Apr 23 07:09:43 2002 @@ -46,8 +46,13 @@ #include "path.h" #include "decode.h" +/* Pre-patch defaults: #define _VESA_800x600_DFL_COLS 80 #define _VESA_800x600_DFL_ROWS 25 +#define _VESA_800x600_DFL_FNSZ 16 +*/ +#define _VESA_800x600_DFL_COLS 100 +#define _VESA_800x600_DFL_ROWS 37 #define _VESA_800x600_DFL_FNSZ 16 #define DUMP_RAW 0 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message