From owner-svn-src-all@FreeBSD.ORG Tue Jan 26 19:17:14 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 8AFCE106566C; Tue, 26 Jan 2010 19:17:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Alexey Dokuchaev Date: Tue, 26 Jan 2010 14:16:49 -0500 User-Agent: KMail/1.6.2 References: <200911032022.nA3KM96H003434@svn.freebsd.org> <86aaw0kjko.fsf@ds4.des.no> <20100126153027.GA65470@FreeBSD.org> In-Reply-To: <20100126153027.GA65470@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_y+zXLB2u5Sm4pdb" Message-Id: <201001261417.06116.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, Dag-Erling Sm??rgrav , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r198858 - in head/sys: dev/fb dev/syscons sys 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: Tue, 26 Jan 2010 19:17:14 -0000 --Boundary-00=_y+zXLB2u5Sm4pdb Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tuesday 26 January 2010 10:30 am, Alexey Dokuchaev wrote: > On Tue, Jan 26, 2010 at 03:49:11PM +0100, Dag-Erling Sm??rgrav wrote: > > Alexey Dokuchaev writes: > > > Considering number of recent vesa/saver breaks, I am thinking > > > about some regression test suit that could at least check for > > > "8-bit vs. 6-bit" type of things. Is it feasible? > > > > Not unless you can figure our a way to programmatically look at > > the screen and check that the colors aren't too dark... IIUC, > > this is a BIOS issue, not a driver issue. > > I understand; I was thinking if maybe there are some "hackish" or > indirect way to tell that BIOS is lying. Probably you mean something like the attached patch? Basically, with this patch, we ignore the VGA compatibility flag if the DAC mode is higher than 6-bit. Let me know if it works for you. Jung-uk Kim --Boundary-00=_y+zXLB2u5Sm4pdb Content-Type: text/plain; charset="iso-8859-1"; name="vesa.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="vesa.diff" --- sys/dev/fb/vesa.c +++ sys/dev/fb/vesa.c @@ -1367,10 +1367,11 @@ vesa_save_palette(video_adapter_t *adp, u_char *pa { int bits; - if ((adp == vesa_adp) && - (adp->va_info.vi_flags & V_INFO_NONVGA) != 0 && - (bits = vesa_bios_get_dac()) >= 6) - return (vesa_bios_save_palette(0, 256, palette, bits)); + if (adp == vesa_adp && VESA_MODE(adp->va_mode)) { + bits = vesa_bios_get_dac(); + if ((adp->va_info.vi_flags & V_INFO_NONVGA) != 0 || bits > 6) + return (vesa_bios_save_palette(0, 256, palette, bits)); + } return ((*prevvidsw->save_palette)(adp, palette)); } @@ -1380,10 +1381,11 @@ vesa_load_palette(video_adapter_t *adp, u_char *pa { int bits; - if ((adp == vesa_adp) && - (adp->va_info.vi_flags & V_INFO_NONVGA) != 0 && - (bits = vesa_bios_get_dac()) >= 6) - return (vesa_bios_load_palette(0, 256, palette, bits)); + if (adp == vesa_adp && VESA_MODE(adp->va_mode)) { + bits = vesa_bios_get_dac(); + if ((adp->va_info.vi_flags & V_INFO_NONVGA) != 0 || bits > 6) + return (vesa_bios_load_palette(0, 256, palette, bits)); + } return ((*prevvidsw->load_palette)(adp, palette)); } @@ -1581,13 +1583,15 @@ get_palette(video_adapter_t *adp, int base, int co int bits; int error; - if ((base < 0) || (base >= 256) || (count < 0) || (count > 256)) + if (base < 0 || base >= 256 || count < 0 || count > 256) return (1); if ((base + count) > 256) return (1); - if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0 || - (bits = vesa_bios_get_dac()) < 6) + if (!VESA_MODE(adp->va_mode)) return (1); + bits = vesa_bios_get_dac(); + if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0 && bits <= 6) + return (1); r = malloc(count * 3, M_DEVBUF, M_WAITOK); g = r + count; @@ -1617,11 +1621,15 @@ set_palette(video_adapter_t *adp, int base, int co int bits; int error; - if ((base < 0) || (base >= 256) || (base + count > 256)) + if (base < 0 || base >= 256 || count < 0 || count > 256) return (1); - if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0 || - (bits = vesa_bios_get_dac()) < 6) + if ((base + count) > 256) return (1); + if (!VESA_MODE(adp->va_mode)) + return (1); + bits = vesa_bios_get_dac(); + if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0 && bits <= 6) + return (1); r = malloc(count * 3, M_DEVBUF, M_WAITOK); g = r + count; --Boundary-00=_y+zXLB2u5Sm4pdb--