From: Kevin D. Quitt (KQuitt@ieeinc.com)
Date: Fri 08 Jun 2001 - 19:39:30 IDT
Here's the working routine, after much tracking through the code: void setPalette( uchar *pal ) { if ( !pal ) return; while ( !(inb( 0x3DA ) & 0x08)); /* Wait for vertical blanking */ port_out( 0x01, SEQ_I ); /* Beam off */ port_out( port_in( SEQ_D ) | 0x20, SEQ_D ); port_out( 0, PEL_IW ); /* Send the palette */ outsb( PEL_D, pal, 256 * 3 ); port_out( 0x01, SEQ_I ); /* Beam on */ port_out( port_in( SEQ_D ) & 0xDF, SEQ_D ); } The beam is turned off because this processor is so slow that it requires not only the retrace time, but several scan line times as well to write the entire palette. I would also like to point out what I consider to be a flaw in vga_waitretrace: it doesn't return until AFTER vertical retrace is over. Generally speaking, one waits for vertical retrace to start so that one can paint the palette during the free beam-off period. I suggest, therefore, that line 42 in vgamisc.c be elided. I also recommend that the routines that set the palette be modified to operate similarly to the above function as it's many times faster. The current routines call __svgalib_delay() between writes, but with the default O3 compilation, that function is empty and the compiler just removes the code and calls to it. -- _ Kevin D. Quitt KQuitt@ieeinc.com 96.37% of all statistics are made up ------------------------------------------------------------------ Unsubscribe: To: listbot@svgalib.org Body: unsubscribe linux-svgalib
This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:24 IST