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