From nobody@FreeBSD.org  Tue Apr  3 11:07:53 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 0A2AC16A402
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  3 Apr 2007 11:07:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id D688013C489
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  3 Apr 2007 11:07:52 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l33B7qUc064482
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 3 Apr 2007 11:07:52 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l33B2pPH063606;
	Tue, 3 Apr 2007 11:02:51 GMT
	(envelope-from nobody)
Message-Id: <200704031102.l33B2pPH063606@www.freebsd.org>
Date: Tue, 3 Apr 2007 11:02:51 GMT
From: "Jukka A. Ukkonen"<jau@iki.fi>
To: freebsd-gnats-submit@FreeBSD.org
Subject: console color depth set to 0 at boot causes flat screens and MS-Virtual-PC screen go black (power save?)
X-Send-Pr-Version: www-3.0

>Number:         111185
>Category:       kern
>Synopsis:       console color depth set to 0 at boot causes flat screens and MS-Virtual-PC screen go black (power save?)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 03 11:10:06 GMT 2007
>Closed-Date:    
>Last-Modified:  Sun Apr 22 07:51:14 GMT 2007
>Originator:     Jukka A. Ukkonen
>Release:        FreeBSD 6.2-STABLE
>Organization:
private
>Environment:
FreeBSD mjolnir 6.2-STABLE FreeBSD 6.2-STABLE #1: Mon Apr  2 08:29:42 EET DST 2007     root@mjolnir:/usr/obj/usr/src/sys/Mjolnir  i386
>Description:
Some flat screen display devices as well as MS-Virtual-PC screen go black
during the boot sequence. The problem has been around since 4.x. I found
the reason by accident when trying PC-BSD on MS-Virtual-PC.

It is very seldom I applaud for anything coming out from MS, but in this
case the Virtual-PC properties window proved to be very handy indeed. It
seems that the console color depth gets suddenly set to 0 bits during boot.

Initially when the system boots the console color depth is 8, but around
the time when the boot mode menu is displayed or during the auto-configure
something touches the screen settings. Unless the console colors have been
hard-coded in the kernel some display devices go black.

At this moment also Virtual-PC properties window changes the reported
display dimensions to read "640 x 480 x 0".

In fact it is quite reasonable for the display devices to blacken the screen
and try to save power when there is no usable color depth.

I have not even tried to read the code yet, but I can assume that as a
side effect of some screen property change (reset, dimension change, etc.)
some graphics cards reset color depth to 0 causing some display devices
go black.

Unless color depth gets then set again back to the depth it was before or
to at least some sane value there is no guarantee that the screen will
remain in readable condition.

>How-To-Repeat:
Try installing either FreeBSD or PC-BSD as an MS-Virtual-PC instance
while holding the Virtual-PC properties window open.

Watch carefully the display dimensions reported by Virtual-PC.

>Fix:
Explicitly set the console color depth to a sane value when the display
has been reset or display dimensions have been changed.

There is also a partial workaround to the problem. By hard-coding the
display colors in the kernel one can force the kernel to set the color
depth to something useful.

Personally I have been using black text for user space and red text for
kernel messages on white background for years to overcome this problem.

>Release-Note:
>Audit-Trail:
>Unformatted:
