/* * linux/drivers/video/sstfb.c -- voodoo graphics frame buffer * * Copyright (c) 2000,2001 Ghozlane Toumi * * Created 15 Jan 2000 by Ghozlane Toumi * * Contributions (and many thanks) : * * 03/2001 James Simmons * 04/2001 Paul Mundt * 05/2001 Urs Ganse * (initial work on voodoo2 port) * * * $Id: sstfb.c,v 1.26.4.1 2001/08/29 01:30:37 ghoz Exp $ */ /* * The voodoo1 has the following memory mapped adress space: * 0x000000 - 0x3fffff : registers (4Mb) * 0x400000 - 0x7fffff : linear frame buffer (4Mb) * 0x800000 - 0xffffff : texture memory (8Mb) */ /* * misc notes, TODOs, toASKs, and deep thoughts -TODO: at one time or another test that the mode is acceptable by the monitor -ASK: I can choose different ordering for the color bitfields (rgba argb ...) wich one should i use ? is there any preferred one ? It seems ARGB is the one ... -ASK: later: how to cope with endianness ? the fbi chip has builtin functions to do byte swizling /swapping, maybe use that ... -TODO: check the error paths . if something get wrong, the error doesn't seem to be very well handled...if handled at all.. not good. -ASK: ioremap ou ioremap_nocache ? : nocache is safe -TODO: in set_var check the validity of timings (hsync vsync)... -FIXME: I'm not sure i like all the functions with no parameters.. change them to use a sstfb_par or sstfb_info or something like that. -TODO: check and recheck the use of sst_wait_idle : we dont flush the fifo via a nop command . so it's ok as long as the commands we pass don't go through the fifo. warning: issuing a nop command seems to need pci_fifo enabled -ASK: the 24 bits mode is NOT packed . how do i differenciate from a packed mode ? set a pseudo alpha value not used ? -ASK: how does the 32 bpp work ? should i enable the pipeline so alpha values are used ? -TODO: check how the voodoo graphics can cope with 24/32 bpp (engine is 16bpp only) -ASK: Do i ioremap the complete area devoted to the lfb (4Mb), or check the real size, then unmap and remap to the real size of the lfb ? ... map all the area. -FIXME: in case of failure in the init sequence, be sure we return to a safe state. -FIXME: 4MB boards have banked memory (FbiInit2 bits 1 & 20) -ASK: I stole "inverse" but seems it doesn't work... check what it realy does... Notes -TODO: change struct sst_info fb_info from static to array/dynamic TTT comments is for code i've put there for debuging the "weird peinguin syndrome", it should disapear soon * */ /* * debug info * SST_DEBUG : enable debugging * SST_DEBUG_REG : debug registers * 0 : no debug * 1 : dac calls, [un]set_bits, FbiInit * 2 : insane debug level (log every register read/write) * SST_DEBUG_FUNC : functions * 0 : no debug * 1 : function call / debug ioctl * 2 : variables * 3 : flood . you don't want to do that. trust me. * SST_DEBUG_VAR : debug display/var structs * 0 : no debug * 1 : dumps display, fb_var * SST_DEBUG_IOCTL : enable sstfb specific ioctls * 0 : disable * 1 : enable debug ioctls : * toggle vga (0x46db) : toggle vga_pass_through * fill fb (0x46dc) : fills fb * dump var (0x46dd) : logs display[0-5].var * test disp (0x46de) : draws a test motif */ /* #define SST_DEBUG */ #undef SST_DEBUG #define SST_DEBUG_REG 0 #define SST_DEBUG_FUNC 0 #define SST_DEBUG_VAR 0 #define SST_DEBUG_IOCTL 1 /* #define EN_24_32_BPP *//* enable 24/32 bpp functions for testing only */ #undef EN_24_32_BPP /* Default video mode . 0 800x600@60 took from glide 1 640x480@75 took from glide 2 1024x768@76 std fb.mode 3 640x480@60 glide default */ #define DEFAULT_MODE 1 /* * Includes */ #include #include #include #include #include #include #include #include #include #include #include #include #include