[PATCH] neofb patches
STALE8183d
From: Alex Stewart <hidden>
Date: 2004-04-21 01:14:21
Sorry I took a little while to get these out.. Had a bit busier weekend than I expected.. Attached are my patches for the neofb driver. All of these are against the 2.6.5 kernel. I'm still kinda new to the whole framebuffer subsystem, so if I've done something horribly wrong, let me know. All of my testing has been against the Neomagic NM2200 (MagicMedia 256AV) chip in my laptop. I think all of these changes should be safe for other chips too, although it's possible a couple of the workarounds for bugs implemented here aren't necessary with some of the other chips and could be more carefully special-cased.. Anyway, the attached patches are as follows: neofb.1.copyarea.patch - Fix copyarea positioning bug It appears that the naming of the NEO_BC0_X_DEC and NEO_BC0_Y_*_DEC bitflags is wrong, or at the very least misleading, as their behavior is not as one would expect from the names. On the NM2200, NEO_BC0_X_DEC apparently enables both X and Y decrementing of addresses during a copy, so the positioning is relative to the lower right corner, not the upper right. I don't know exactly what the other flags do do, but they apparently don't affect Y decrementing, so the case where we were setting just these flags without NEO_BC0_X_DEC didn't work and corrupted the data while copying (are these flags perhaps used differently in later chips than in the 2200 I'm testing against?) In any case, I didn't look into it horribly deeply, I just changed the routine to be a little less clever about what it tries to do (this is consistent with what the XFree86 driver does as well, and will hopefully work with all chips, whichever way they might treat these flags) neofb.2.imageblit.patch - Fix imageblit for color images It looks like the imageblit routine was written with only mono blits in mind. This patch adds support for color image transfers (Hi Tux!). neofb.3.16bit.patch - Misc fixes for 16-bit mode Changed the visual reported for 16-bit mode from DirectColor to TrueColor, since we don't support changing the colormap, which means we don't really support DirectColor. Also changed the palette entries for to be 32 bits wide even for 16-bit mode because this is what the logo code expects, and appears to be the correct way of doing things. neofb.4.24bit.patch - Make 24-bit mode work Added a couple of switch cases needed to make 24-bit mode actually work. The colormap setting code also needed to be moved to be after vgaHWRestore, so that the DAC would be configured properly (8-bit lookups) for 24-bit color before writing to the lookup table. Also, it looks like there's a hardware bug with the NM2200 if you try to do a color-expanded transfer in 24-bit mode and the width of the image is less than 16 pixels wide (The left few pixels of the image seem to get partially wrapped onto the right side. I haven't tested all cases, actually.. I know it breaks with 8-pixel-width blits), so in that case we just fall back to cfb_imageblit instead. Actually, the imageblit bug could conceivably be there with color transfers too, I haven't tried it. Would require something trying to imageblit a 8-pixel-wide 24-bit image, in 24-bit mode. I suspect the bug is probably related to the source-data width in bits and/or the hardware mono->color translation, though, and in either case this wouldn't be an issue for 24-bit color. neofb.5.modedb.patch - Change to use modedb for video mode selection Allows specifying the video mode on the kernel/insmod command line now too. I have also attached an additional patch which is mostly, but not quite entirely, complete. I thought it was working until I was packaging all of this up and discovered that it's actually intermittent. If anybody has suggestions for what's missing, please let me know: neofb.6.blanking.patch - Add support for DPMS blanking I just copied the logic from the XFree86 driver to add DPMS support. This currently works for me some of the time and doesn't other times, and I'm still tracking down why. It looks like I probably need to do something more in the initialization stage to turn on this functionality properly (I note that there are a _lot_ of registers which the BIOS and the XFree86 driver have values set for which show up as zero under the neofb driver. I'm guessing this is part of the problem.) (Oh, and I also changed the wording of the comments at the beginning of things to make a bit more sense in this context. Between an unfortunate renaming one of the function parameters and the fact that the comments were copied from a different part of the code (and thus speak from a different perspective), these comments were initially very confusing to read. Hopefully now they are somewhat less so.) I'm also still looking into a couple of minor "annoyance" bugs, but these patches fix most of the real functionality deficiencies I've found so far (or will, once I figure out why blanking is buggy.. grumble).. Feedback is welcome. -alex
Attachments
- neofb.1.copyarea.patch [text/plain] 730 bytes · preview
- neofb.2.imageblit.patch [text/plain] 1335 bytes · preview
- neofb.3.16bit.patch [text/plain] 1294 bytes · preview
- neofb.4.24bit.patch [text/plain] 3405 bytes · preview
- neofb.5.modedb.patch [text/plain] 6155 bytes · preview
- neofb.6.blanking.patch [text/plain] 3608 bytes · preview