From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <02580f2e9d1062be41b15fe4acf73ae0@plan9.bell-labs.com> Subject: Re: [9fans] What a poor VGA support ! From: presotto@plan9.bell-labs.com To: 9fans@cse.psu.edu MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Thu, 13 Jun 2002 10:21:32 -0400 Topicbox-Message-UUID: abe60996-eaca-11e9-9e20-41e7f4b1d025 > Simple, because it is supported by the 28 other > operating systems I managed to install on that machine. My interest is clearly piqued. What are those 28 OS's and what to you use to boot them all? > But , please, tell me, because I'm curious : Why is it so difficult, so > impossible to add some kind of minimum VGA support ? We used to have minimum support, i.e., 640x480x{1,2,4}. Those modes are standard and normally grey scale. You can use a color map with them but 16 or fewer colors doesn't make for great viewing, red letters on a blue backround was my favorite headache producer. We nuked support for the standard modes because a) it was very odd to implement especially after we changed graphics models. It doesn't really fit the model of a frame buffer. Instead you had to do odd things to write the different bits to diferent planes. b) it was made clear to us that supporting 640x480x4 grey scale was so inferior to what people wanted that it wasn't worth the effort. All other modes are non-standard, i.e., different from card type to card type. There are a smaller number of VGA chips than cards though even that number is unwieldy. How the differenty card manufacturers map the chips and plug them together varies. Often the only extra info we have to know about a card is how to recognize it. PCI is helping there though in the past we had to look at the onboard BIOS and look for patterns; half of /lib/vgadb is just trying to figure out what's there. If you wc /sys/src/cmd/aux/vga you'll see that the ammount of code per chip type is pretty small (often with an equivalent amount in the kernel to support cursors and such). However figuring out that code is hard: - documentation is usually poor or non-existant. Drivers from more popular OS's (or X) are often the only documentation - Some registers bits lock out other registers; just reading the settings used by windows and rewriting them back is usually impossible. - setup requires writing values into MANY registers, most of which are different from chip to chip. The values are dependent on clock speed, bit depth, screen size, and chip version. Just getting them working on one machine doesn't ensure they'll work on another. In some cases it takes futzing with a number of machines and board revs to get a `stable' implementation. Our most popular laptop is the T23 (because of a company deal with IBM) and we set it up by being careful not to touch too many registers since we have no idea what the LCD extension registers do. In our group, we have one person, jmk, who sepnds a considerable amount of time just getting the cards we have working. However, that's in addition to what he's supposed to be doing, not what he's paid for. Some of the community is also nice enough to send us the /lib/vgadb info + drivers to get other cards working. However, because the Plan 9 distribution is a 'free time' effort at the Labs we can't aim one person to doing full time VGA support. If the community were larger, we'ld probably get enough contributions to cover a larger percentage of the cards or if Plan 9 were actually popular we might be able to get manufacturers to write drivers. It would be useful if the manufacturers could get together and come up with another VGA standard so that we would waste less time and angst. However, there's no real motivation for this. To first order, there's only one OS for PC's, and to second order only two. It's not that hard for a manufacturer to put together drivers for their new board for 2 OS's. I'm pretty impressed that there are 26 others that manage to support all cards. Besides, if you ever got your ATI Xpert (Rage Pro) working, we'ld have to go through this conversation again explaining why we don't have a web browser worth using.