Home | History | Annotate | Line # | Download | only in src
      1  1.1  mrg 
      2  1.1  mrg 
      3  1.1  mrg This file is NOT up to date for the New Design!
      4  1.1  mrg 
      5  1.1  mrg 
      6  1.1  mrg 
      7  1.1  mrg 
      8  1.1  mrg ============== old (pre-ND) contents below ==============
      9  1.1  mrg 
     10  1.1  mrg "I just thought it would be usefull if we had some kind of TODO and BUGS
     11  1.1  mrg files in the distribution as it would make it easier to see what is needed
     12  1.1  mrg to be done and what could be done better, instead of browsing through the
     13  1.1  mrg sourcecode. And we whould be able to se the progress literally by the ever
     14  1.1  mrg decreasing TODO file :-)"
     15  1.1  mrg 
     16  1.1  mrg 
     17  1.1  mrg ## BUGS:
     18  1.1  mrg 
     19  1.1  mrg All Tseng cards:
     20  1.1  mrg 
     21  1.1  mrg * We definitely NEED to fix that color-expansion problem. See Appendix A
     22  1.1  mrg below for a detailed explanation.
     23  1.1  mrg 
     24  1.1  mrg * There are still some problems with the HW-cursor. The error message about
     25  1.1  mrg "wrong color selected" is disabled, and the limitation documented. Better
     26  1.1  mrg would be to have a way to dynamically switch to software-cursor mode if the
     27  1.1  mrg color can not be made. HW cursor doesn't work in DoubleScan modes yet (only
     28  1.1  mrg half of the cursor displayed)
     29  1.1  mrg 
     30  1.1  mrg * text font sometimes corrupted when going back to text mode. This may be
     31  1.1  mrg related to the order in which registers are restored: the ARK driver first
     32  1.1  mrg restores extended registers before restoring the standard registers for
     33  1.1  mrg excactly this reason.
     34  1.1  mrg 
     35  1.1  mrg * The code needs to be heavily reworked to fix all sorts of data type
     36  1.1  mrg problems. The current code will certainly not run on an Alpha. The first
     37  1.1  mrg step is to replace all hardware related variables by CARD8/CARD16/CARD32
     38  1.1  mrg types.
     39  1.1  mrg 
     40  1.1  mrg 
     41  1.1  mrg ET6000:
     42  1.1  mrg 
     43  1.1  mrg * The trapezoid code is disabled because it doesn't comply with the way the
     44  1.1  mrg non-accelerated ("cfb") code does things. This needs to be fixed.
     45  1.1  mrg 
     46  1.1  mrg 
     47  1.1  mrg ET-4000(W32):
     48  1.1  mrg 
     49  1.1  mrg * Hardware cursor support for the W32 is still lacking color support. We
     50  1.1  mrg need to reserve color cells #0 and #255 to make this work. From discussions
     51  1.1  mrg on the development list, it seems the best solution is to allocate these cells
     52  1.1  mrg read-write, and then use them for the HW cursor. We MUST however document
     53  1.1  mrg that this will break some clients which depend on a fixed color in cell #0,
     54  1.1  mrg and some others that rely on the presence of 256 color cells. It will also
     55  1.1  mrg cause cursor color problems when someone uses a local color map.
     56  1.1  mrg 
     57  1.1  mrg 
     58  1.1  mrg ## TODO:
     59  1.1  mrg 
     60  1.1  mrg All cards:
     61  1.1  mrg 
     62  1.1  mrg * The accelerator on the Tseng devices is capable of much more. Especially
     63  1.1  mrg the pattern support is not used most of the time: It can render a pattern in
     64  1.1  mrg just about every accelerated operation. This means patterned lines, bitblts,
     65  1.1  mrg screencopies, etc. are possible. However, operations like these are very
     66  1.1  mrg uncommon in normal server use, so the speed benefit would go largely unnoticed.
     67  1.1  mrg 
     68  1.1  mrg 
     69  1.1  mrg ET4000:
     70  1.1  mrg 
     71  1.1  mrg * support needs to be added for several clockchips and RAMDACs:
     72  1.1  mrg         - 8-bit RAMDAC support for >8bpp modes: Sierra DACs and possibly others
     73  1.1  mrg         - AT&T 20C49x RAMDAC support is not correct.
     74  1.1  mrg 
     75  1.1  mrg * SuperProbe could use an update. It doesn't detect some of the RAMDACs that
     76  1.1  mrg are detected by the driver.
     77  1.1  mrg 
     78  1.1  mrg * Several of the color expansion-related accelerations are still only 8bpp.
     79  1.1  mrg It should be easy to use the same trick on those as on the standard color
     80  1.1  mrg expand code (use intermediate buffer, expand data before blitting).
     81  1.1  mrg 
     82  1.1  mrg * many of the operations that the W32 family can't support natively (e.g.
     83  1.1  mrg FillRectSolid for 24bpp) can be performed using CPU-to-screen operations,
     84  1.1  mrg feeding the correct (color) information through the ACL aperture.
     85  1.1  mrg 
     86  1.1  mrg 
     87  1.1  mrg ET6000:
     88  1.1  mrg 
     89  1.1  mrg * someone might want to look at how the bitBLT engine of the ET6000 is
     90  1.1  mrg constructed, and come up with some fancy ways of abusing it. We're still
     91  1.1  mrg only using a small part of it (I'm thinking about the compare map and the
     92  1.1  mrg extensions to the MIX hardware compared to the ET4000).
     93  1.1  mrg 
     94  1.1  mrg * Mclk support is still lacking (that would also allow MClk-dependent
     95  1.1  mrg maximum bandwidth).
     96  1.1  mrg 
     97  1.1  mrg * Apart from the things mentionned above, I think the ET6000 server is
     98  1.1  mrg pretty complete. Some optimisations could possibly be added. Like for
     99  1.1  mrg example some assembler code for calculating a framebuffer address from X/Y
    100  1.1  mrg coordinates. That would help to speed up small blits.
    101  1.1  mrg 
    102  1.1  mrg 
    103  1.1  mrg =======================================================================
    104  1.1  mrg APPENDIX A: the color expansion problem
    105  1.1  mrg ----------------------------------------
    106  1.1  mrg 
    107  1.1  mrg As suggested in the data book, we're doing font rendering using the
    108  1.1  mrg color-expansion (MIX map) capabilities of the Tseng accelerator.
    109  1.1  mrg 
    110  1.1  mrg We're using a ping-pong buffer scheme (triple buffering actually) in
    111  1.1  mrg off-screen memory to store one scanline worth of font data at a time. each
    112  1.1  mrg of these scanlines is "blitted" to on-screen memory using the accelerator.
    113  1.1  mrg The scanline is the MIX map, and there's also a 4x1 solid foreground color
    114  1.1  mrg (SRC map), and a 4x1 solid background color (PAT map). 
    115  1.1  mrg 
    116  1.1  mrg Basically, the flow is as follows:
    117  1.1  mrg 
    118  1.1  mrg 	- setup accelerator for font-expansion
    119  1.1  mrg 	
    120  1.1  mrg 	- store scanline 1 in off-screen memory buffer 1
    121  1.1  mrg 	
    122  1.1  mrg 	- start operation
    123  1.1  mrg 	
    124  1.1  mrg 	- store scanline 2 in off-screen memory buffer 2
    125  1.1  mrg 	
    126  1.1  mrg 	- start operation
    127  1.1  mrg 	
    128  1.1  mrg 	- store scanline 3 in off-screen memory buffer 3
    129  1.1  mrg 	
    130  1.1  mrg 	- start operation
    131  1.1  mrg 	
    132  1.1  mrg 	- store scanline 4 in off-screen memory buffer 1
    133  1.1  mrg 	
    134  1.1  mrg 	- start operation
    135  1.1  mrg 	
    136  1.1  mrg 	... etc, until the whole line of text is drawn.
    137  1.1  mrg 	
    138  1.1  mrg There is no explicit "waiting" for the accelerator to finish an operation
    139  1.1  mrg before starting a new one, because it has been set up to add "wait-states"
    140  1.1  mrg when the queue is full. We're aiming to use concurrency between the
    141  1.1  mrg accelerator and the storing of scanlines in the buffers. Anyway, waiting
    142  1.1  mrg after each operation doesn't help.
    143  1.1  mrg 
    144  1.1  mrg Now, in 99% of all cases, text is rendered OK. But in some cases, we're
    145  1.1  mrg seeing severe font corruption.
    146  1.1  mrg 
    147  1.1  mrg What we're seeing is this: sometimes, exactly 32 pixels of a scanline are
    148  1.1  mrg rendered with the scanline data that was there BEFORE, instead of the one
    149  1.1  mrg that was just written into the scanline buffer. In other words, 32 pixels of
    150  1.1  mrg line 2 (for example) are rendered at line 5. The rest of the scanline can be
    151  1.1  mrg OK (i.e. data from scanline 5 is actually written there).
    152  1.1  mrg 
    153  1.1  mrg Here's an attempt at showing you what _should_ have been rendered:
    154  1.1  mrg 
    155  1.1  mrg 1
    156  1.1  mrg 2   #####################################################################
    157  1.1  mrg 3
    158  1.1  mrg 4
    159  1.1  mrg 5
    160  1.1  mrg 6   #####################################################################
    161  1.1  mrg 7
    162  1.1  mrg 8
    163  1.1  mrg 9
    164  1.1  mrg 10  #####################################################################
    165  1.1  mrg 11
    166  1.1  mrg 12
    167  1.1  mrg 13
    168  1.1  mrg 14  #####################################################################
    169  1.1  mrg 15
    170  1.1  mrg 
    171  1.1  mrg 
    172  1.1  mrg 
    173  1.1  mrg and what _is_ rendered sometimes (only an example):
    174  1.1  mrg 
    175  1.1  mrg 1  
    176  1.1  mrg 2   #####################################################################
    177  1.1  mrg 3
    178  1.1  mrg 4
    179  1.1  mrg 5 
    180  1.1  mrg 6   ########################                                #############
    181  1.1  mrg 7
    182  1.1  mrg 8
    183  1.1  mrg 9
    184  1.1  mrg 10  #####################################################################
    185  1.1  mrg 11
    186  1.1  mrg 12
    187  1.1  mrg 13  ########################
    188  1.1  mrg 14  #####################################################################
    189  1.1  mrg 15  
    190  1.1  mrg 
    191  1.1  mrg At line 6, 32 pixels of the "black" scanline data from line 3 is rendered
    192  1.1  mrg instead of the actual full-white that would normally have to be there. At
    193  1.1  mrg line 13, the opposite happened (data from line 10 rendered at line 13). This
    194  1.1  mrg 32-pixel width of the "bug" is independent of the color depth: we're seeing
    195  1.1  mrg this at 8bpp as well as at 16bpp, 24bpp and 32bpp. 32 pixels each time.
    196  1.1  mrg 
    197  1.1  mrg Remember, we're talking triple-buffering here, so the "wrongly" rendered
    198  1.1  mrg data is in fact the data that was in the scanline-buffer from the PREVIOUS
    199  1.1  mrg operation that used that buffer.
    200  1.1  mrg 
    201  1.1  mrg In fact, my best explanation is that sometimes, a whole DWORD (32 bits) of
    202  1.1  mrg data isn't in the video memory yet by the time the accelerator starts
    203  1.1  mrg rendering with it.
    204  1.1  mrg 
    205  1.1  mrg But the data _is_ being written to there by the driver software, because if
    206  1.1  mrg you restart the scanline-operation again, without writing any more data to
    207  1.1  mrg the scanline buffers (only the MIX address and the destination address are
    208  1.1  mrg reprogrammed to restart the scanline color expansion operation -- see code
    209  1.1  mrg in tseng_acl.c), data _is_ rendered correctly.
    210  1.1  mrg 
    211  1.1  mrg 
    212  1.1  mrg 
    213  1.1  mrg I have investigated this as far as I possibly can. I checked if the data was
    214  1.1  mrg actually written in video memory. It was. I checked all kinds of PCI-related
    215  1.1  mrg things, like write-gathering or write-reordering of the PCI chipset, etc. I
    216  1.1  mrg disabled all possible enhanced features, both on the PCI chipset, inside the
    217  1.1  mrg CPU, and on the ET6000.
    218  1.1  mrg 
    219  1.1  mrg What strikes me, is that the exact same problems are seen on ET4000W32p as
    220  1.1  mrg on the ET6000. This immediately rules out any special features that were
    221  1.1  mrg only added with the ET6000, like problems with the MDRAM cache buffers, etc.
    222  1.1  mrg It seems to be a generic problem to all Tseng accelerators.
    223  1.1  mrg 
    224  1.1  mrg The exact same higher-level code is being used for other chipsets as well
    225  1.1  mrg (i.e. the system of writing scanlines of data to off-screen memory and
    226  1.1  mrg making the accelerator expand it into on-screen memory), and there are no
    227  1.1  mrg problems on these other chipsets. The acceleration architecture we're using
    228  1.1  mrg is completely device-independent up to the point where each chip needs to
    229  1.1  mrg provide a
    230  1.1  mrg 
    231  1.1  mrg 	SetupForScanlineScreenToScreenColorExpand()
    232  1.1  mrg 
    233  1.1  mrg and a
    234  1.1  mrg 
    235  1.1  mrg 	SubsequentScanlineScreenToScreenColorExpand()
    236  1.1  mrg function.
    237  1.1  mrg 
    238  1.1  mrg Since the higher-level code is being used by other chip drivers as well, it
    239  1.1  mrg seems to be OK.
    240  1.1  mrg 
    241  1.1  mrg So the problem is either in those device-dependent functions, or in the
    242  1.1  mrg hardware itself.
    243  1.1  mrg 
    244  1.1  mrg 
    245  1.1  mrg I have found one kludge to work around this problem, and it should (?) tell
    246  1.1  mrg you a lot about the problem: if I start each scanline-colorexpand operation
    247  1.1  mrg TWICE, rendering is suddenly perfect (at least there are so little rendering
    248  1.1  mrg errors that I haven't seen any yet).
    249  1.1  mrg 
    250  1.1  mrg 
    251  1.1  mrg I am including the two device-depending functions so that you may be able to
    252  1.1  mrg follow what I'm saying here:
    253  1.1  mrg 
    254  1.1  mrg 
    255  1.1  mrg 
    256  1.1  mrg One entire line of text is drawn by calling the Setup() function ONCE. All
    257  1.1  mrg scanlines of text (16 of them in case of a 8x16 font) are drawn by filling
    258  1.1  mrg the off-screen scanline buffers and calling the Subsequent() function.
    259  1.1  mrg 
    260  1.1  mrg 
    261  1.1  mrg 
    262  1.1  mrg 
    263  1.1  mrg 
    264  1.1  mrg $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/README,v 1.12 2000/08/08 08:58:06 eich Exp $
    265