Svgalib and modern video cards

Search this archive.

From: Jan Hubicka (hubicka@atrey.karlin.mff.cuni.cz)
Date: Tue 24 Mar 1998 - 16:51:22 IDT


HI
As I told in my last post, I am making an driver for Pyramid. It is very
nice 3d accelerator complettly uncompatible with SVGAlib.

It is not hard to see, that SVGAlib was not designed for such card. It does
lots of inputs/outputs to vga registers, without porividng any way to disable
this. Mach32 problem ran into same problems and had to hack lots of Mach32
stuff into waitretrace, setpalette and other stuff.

Since pyramid is already the second such card, I decided to make thinks cleaner
and give drivers way to handly such stuff manually. I think it should be nice
to add this into SVGAlib before pyramid drivers will be released (since
it should take a while, until Pyramid will be released and it should help
to other developers too). Looking forward for your ideas, comments and so on.
If someone is interested, I should make a patch...

For now, I've done following changes:

First I've added variable __svgalib_novga, wich just disables all vga IO,
so SVGAlib don't confuses my text mode at s3 videocard.
This feature don't cost much, so I think I should keep it.

For other functions I've added structure Emulate into driver's specs, wich
works in similar way, ass AccelSpecs - it contains flags and pointers to
functions. Flags specifies, wich families of functions are available.
For now it supports folloving families:
EMULATE_PALETTE (set_lut/get_lut)
EMULATE_RETRACE (wait_retrace)
EMULATE_SCREEN (screen on, screen off)
EMULATE_FONT (savefont/restorefont)
EMULATE_SAVEPALETTE (savepalette/restorepalette stuff)
If the flag is set, SVGAlib don't use standard vga code and calls
driver's function instead. For example mach32 should use EMULATE_PALETTE|
EMULATE_RETRACE

Pyramid also don't have videoram at a000, so I've added variable 
__svgalib_graph_base, wich by defaults points to vga videoram. Driver
should change it, and svgalib then mmaps another region. This seems
to works w/o any problems :) I've also added __svgalib_secondary,
wich is set in case, that svgalib is using secondary videocard. It
should not blank original screen then or so, but it is ignored for now

Another problem is linear framebuffer. Pyramid has just linear framebuffer
(luck is, taht it is possible to emulate banks using APT registers).
vga_setlinear function works well (and program testlinear), but most
programs don't use it at all. I think, svgalib should enable it at default
(at least vgagl should do this). But I am not sure, if it will not break
some application. In vga_gl is line for enabling linear framebuffer, but
it is commented out and comment says, that svgalib don't do correct console
switching with linear framebuffer enabled. Whats worng with this?

Last think is, that pyramid supports line widths just as powers of two.
Svgalib assumes, that linewidth=width*bytesperpixel, wich is not true
anymore. I've patched vga_setmode and vga_getmodeinfo to let driver
specify an linewidth. It seems to work well with vgagl, vgatest
and my program XaoS (do you have any other programs for svgalib
supporting truecolor? - pyramid don't have 256 color modes yet)

Thats all for now... looking forward for comments.

Honza
-- 


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:22 IST