[haiku-development] Re: S3 Video Driver

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 05 Mar 2008 10:42:10 +0100 CET

Gerald Zajac <zajacg@xxxxxxxxxxxxx> wrote:
> > The PIO mode is a performance problem in itself - using a syscall 
> > per 
> > port access isn't that problematic; and you could always turn off 
> > acceleration if it really would be a problem. Being able to change 
> > the 
> > resolution would be a good start, though, I think.
> > But it's your decision, anyway! :-)
> Hi Axel!  How do you envision accessing the PIO ports in the kernel 
> module?  Would it be done by creating a pci_module_info object during 
> startup, and then using the pci_module_info read_io and write_io 
> functions to access the PIO ports?  I'm currently using this method 
> during startup to enable MMIO on the Trio and Virge chips.  Or is 
> there 
> another simpler way of accessing these ports?

You would need to use the ISA bus module, and then add ioctl's to your 
driver that lets the accelerant use the {write|read}_io_{8|16|32} 
functions much like SAVAGE_{GET|SET}_PCI.
In the accelerant, you could then have a handy function that hides the 
ioctl() from you again.

> If acceleration for this chip is turned off and this way of accessing 
> the PIO ports is used only for changing the resolution, I'm wondering 
> why the VESA driver could not be enhanced to change the resolution?  
> That way the VESA driver could handle all these older video chips 
> where 
> it is questionable whether it is worth the effort to write  code to 
> handle them in other video drivers.

Every graphics card is programmed differently when you're using PIO. 
There is a VESA VBE interface that you can use on most cards to change 
the resolution, but that requires you to use x86 real mode (or virtual 
x86 mode) - and it's quite an effort to add virtual mode support just 
for this IMO.

There is a newer VBE3 interface that also offers a protected mode 
environment, but AFAIU only very few graphics cards implement this 
correctly or completely. Even though it might be enough for mode 
setting, I haven't looked at it that closely (VBE3 also allows for 
hardware acceleration). In any case, this wouldn't work with older 
cards, anyway.

Bye,
   Axel.


Other related posts: