aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/xf4bpp/NOTES
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-06-28 22:07:26 +0000
committermarha <marha@users.sourceforge.net>2009-06-28 22:07:26 +0000
commit3562e78743202e43aec8727005182a2558117eca (patch)
tree8f9113a77d12470c5c851a2a8e4cb02e89df7d43 /xorg-server/hw/xfree86/xf4bpp/NOTES
downloadvcxsrv-3562e78743202e43aec8727005182a2558117eca.tar.gz
vcxsrv-3562e78743202e43aec8727005182a2558117eca.tar.bz2
vcxsrv-3562e78743202e43aec8727005182a2558117eca.zip
Checked in the following released items:
xkeyboard-config-1.4.tar.gz ttf-bitstream-vera-1.10.tar.gz font-alias-1.0.1.tar.gz font-sun-misc-1.0.0.tar.gz font-sun-misc-1.0.0.tar.gz font-sony-misc-1.0.0.tar.gz font-schumacher-misc-1.0.0.tar.gz font-mutt-misc-1.0.0.tar.gz font-misc-misc-1.0.0.tar.gz font-misc-meltho-1.0.0.tar.gz font-micro-misc-1.0.0.tar.gz font-jis-misc-1.0.0.tar.gz font-isas-misc-1.0.0.tar.gz font-dec-misc-1.0.0.tar.gz font-daewoo-misc-1.0.0.tar.gz font-cursor-misc-1.0.0.tar.gz font-arabic-misc-1.0.0.tar.gz font-winitzki-cyrillic-1.0.0.tar.gz font-misc-cyrillic-1.0.0.tar.gz font-cronyx-cyrillic-1.0.0.tar.gz font-screen-cyrillic-1.0.1.tar.gz font-xfree86-type1-1.0.1.tar.gz font-adobe-utopia-type1-1.0.1.tar.gz font-ibm-type1-1.0.0.tar.gz font-bitstream-type1-1.0.0.tar.gz font-bitstream-speedo-1.0.0.tar.gz font-bh-ttf-1.0.0.tar.gz font-bh-type1-1.0.0.tar.gz font-bitstream-100dpi-1.0.0.tar.gz font-bh-lucidatypewriter-100dpi-1.0.0.tar.gz font-bh-100dpi-1.0.0.tar.gz font-adobe-utopia-100dpi-1.0.1.tar.gz font-adobe-100dpi-1.0.0.tar.gz font-util-1.0.1.tar.gz font-bitstream-75dpi-1.0.0.tar.gz font-bh-lucidatypewriter-75dpi-1.0.0.tar.gz font-adobe-utopia-75dpi-1.0.1.tar.gz font-bh-75dpi-1.0.0.tar.gz bdftopcf-1.0.1.tar.gz font-adobe-75dpi-1.0.0.tar.gz mkfontscale-1.0.6.tar.gz openssl-0.9.8k.tar.gz bigreqsproto-1.0.2.tar.gz xtrans-1.2.2.tar.gz resourceproto-1.0.2.tar.gz inputproto-1.4.4.tar.gz compositeproto-0.4.tar.gz damageproto-1.1.0.tar.gz zlib-1.2.3.tar.gz xkbcomp-1.0.5.tar.gz freetype-2.3.9.tar.gz pthreads-w32-2-8-0-release.tar.gz pixman-0.12.0.tar.gz kbproto-1.0.3.tar.gz evieext-1.0.2.tar.gz fixesproto-4.0.tar.gz recordproto-1.13.2.tar.gz randrproto-1.2.2.tar.gz scrnsaverproto-1.1.0.tar.gz renderproto-0.9.3.tar.gz xcmiscproto-1.1.2.tar.gz fontsproto-2.0.2.tar.gz xextproto-7.0.3.tar.gz xproto-7.0.14.tar.gz libXdmcp-1.0.2.tar.gz libxkbfile-1.0.5.tar.gz libfontenc-1.0.4.tar.gz libXfont-1.3.4.tar.gz libX11-1.1.5.tar.gz libXau-1.0.4.tar.gz libxcb-1.1.tar.gz xorg-server-1.5.3.tar.gz
Diffstat (limited to 'xorg-server/hw/xfree86/xf4bpp/NOTES')
-rw-r--r--xorg-server/hw/xfree86/xf4bpp/NOTES194
1 files changed, 194 insertions, 0 deletions
diff --git a/xorg-server/hw/xfree86/xf4bpp/NOTES b/xorg-server/hw/xfree86/xf4bpp/NOTES
new file mode 100644
index 000000000..e3b77dcfd
--- /dev/null
+++ b/xorg-server/hw/xfree86/xf4bpp/NOTES
@@ -0,0 +1,194 @@
+This code originally hails from IBM. It was ported to an early XFree86 by
+Gertjan Akkerman, whose BUGS file I append here.
+
+In turn, this is a port of Gertjan's work to the new server design. Among the
+changes are:
+
+- The removal of almost all unreferenced code.
+- The removal of this code's own copy of mfb (xf1bpp is used instead).
+- The removal of banking support (mibank is used instead).
+- External symbols were made static where this was sufficient.
+- The remaining external names were renamed to xf4bpp*.
+- Several minor cleanups too many to mention here.
+
+To understate the matter, this code is >UGLY<. This seems inherent in IBM's
+corporate culture. Be that as it may, it *does* survive X11R4's xtest
+(whatever that means these days...). For now, this is sufficient for 4bpp
+support in the new design, but at some point, I'll have to sit down and
+rewrite this from scratch. A more technical justification for a rewrite is
+that the pixmap format is 8bpp, instead of 4bpp, which is causing me to
+pepper the rest of the server with unclean accomodations.
+
+Marc.
+
+===============================================================================
+Section 1: From IBM's X11R4 contribution towards XFree86.
+
+This section describes what I did to obtain a 16 colour vga server.
+
+I started with the SYSV, ppc, vga and common directories from IBM's X11R4
+contribution. Those directories have the following function:
+1. SYSV implements the mouse and keyboard.
+2. ppc is a generic layer implementing ddx in terms of drawing operations
+ through rectangles. (With spans as a boundary case: height = 1.)
+3. vga implements a layer of operations drawing through rectangles.
+4. common implements ddx initialization and quitting, and screen saving.
+
+I eliminated SYSV and common since the functionality provided therein is
+already provided in XFree86. Since XFree86 is actively being ported to
+new operating systems, while X11R4 is out of date, I preferred the XFree86
+code here above the SYSV and common code.
+Whatever functionality was still needed from common (default colormap
+initialization -- not much code) was moved into ppc.
+
+Since XFree86 uses the mi-provided software cursor code, IBM's software
+cursor code was deleted from ppc and vga. This is a pity, since it is
+expected that it is more efficient than mi's code, but the XFree86 mouse and
+keyboard code directly call mi, and I do not want to maintain the XFree86
+mouse and keyboard code.
+
+Since we cannot support a monolithic multi-screen server using all of the
+x11r4 contributed code yet, all multi screen code was deleted. This includes
+one header file containing a nasty copyright statement.
+
+Since glyph handling has changed between X11R4 and X11R5, the code handling
+glyphs was replaced by appropriate calls to mi.
+I hope it can be modified and put back one day.
+
+Provisionally, some code was added (viz. file vga/offscreen.c) to intercept
+calls to the rectangle drawing code when we are switched out of the VT.
+I hope this can be replaced by some window tree invalidation and GC validation
+scheme.
+
+
+Section 2: BUGS
+
+This section describes fixed and still unfixed bugs in this code.
+All bugs not labeled otherwise also occur in IBM's X11R4 code, and may be of
+interest to anybody using that code.
+
+1. (Fixed.)
+I found (and provisionally fixed) a bug in the IBM bitblit code:
+In file ddx/ibm/vga/vgaImages.c a function vgaReadColorImage is defined.
+When this function is used to read less than 8 pixels starting on a byte
+boundary it will always read precisely 8 pixels.
+Thus, when space is allocated for 4 or less pixels, it will write beyond
+the allocated space.
+Since the code is rather convoluted, this may not be apparent at first sight,
+but going through the code with an example shows the error.
+
+2. (Fixed.)
+In ppcPixmapFS.c, function ppcStipplePixmapFS there was a bug
+regarding the stipple origin: The horizontal origin is added while
+the vertical one is subtracted. The horizontal origin should be subtracted
+instead of added here.
+This bug gets visible when backing-store is enabled and one uses twm:
+the submenu icons get truncated on their left hand side.
+(In case you wonder why this bug appears: under those circumstances
+twm prepares its menus by drawing into an unmapped window.
+The miCopyPlane function uses the ppcStipplePixmap (and many others)
+to get the plane copied.)
+I also fixed this bug in the other routines (ppcOpStipplePixmapFS,
+ppcTilePixmapFS) in this file, although I had no visible clues for this.
+I hope this is appropriate.
+
+3. (Fixed.)
+I find it suspect that ppcSetSpans gives different output when one
+claims that an actually sorted list of spans is unsorted.
+The unsorted code is wrong, and should be made to look more like the sorted
+code. I.e., use ( xStart - ppt->x ) instead of ( xStart - pbox->x1 )
+
+4. (Fixed.)
+There used to be another bug that became visible when using twm and backing
+store: popping up a submenu, and moving the cursor upwards til it leaves the
+submenu, the submenu would disappears, as it should.
+But the submenu icon would not get restored, while it should be.
+10b. By replacing the clip-computing code in ppcValidateGC by that in
+cfbValidateGC, I *finally* fixed the disappearing twm menu icon problem.
+
+5. Added mfbRegisterCopyplaneProc call. [Its omission was an error on my
+ part.]
+ Fixing a server core dump in XTest.
+
+6. Fixed not-very-high tile bug in function ppcTileRect, file emulTile.c
+ (I.e., if the tile was higher than the area to be tiled, far too much
+ was drawn, causing server core dumps in XTest.)
+ Actually, "savey" ought to be used to determine the height of the tiles in
+ the top line to be tiled, instead of "pTile->drawable.height".
+7. A use of height where width was intended was fixed in ppcTileRect:
+ "savehcount = w / pTile->drawable.height;" should use "... .width" and
+ "savehcount = ( x + w - htarget ) / pTile->drawable.height;" too.
+
+8. Deleted overly clever code in ppcCReduce.c
+ (All code that tried to pre-compute how alu's could be replaced by
+ other alu's with inverted colors, etc. was deleted. I think it is
+ at least wrong for FillSolid.)
+
+9. Looked at suspicious code in ppcSetSp.c
+ "tmpx = *pdst;" was never updated during the loop. We took it out of the
+ initialization position of the for and moved it into the loop.
+
+10. Add xSrc := GC->patOrg.x + pDrawable.x and ySrc := ... in ppcPixmapFS.c,
+ functions ppcStipplePixmapFS, ppcOpStipplePixmapFS, and ppcTilePixmapFS.
+ This because stipple and tile origins are taken relative to the drawable.
+ Also use a "modulo" function that gets the cases of a negative stipple
+ or tile offset right. (When the stipple origin is to the right of or
+ below the origin of the drawable.)
+
+11. File vgaSolid.c, function vgaFillSolid:
+ Inverting is XORing with all ones. Not with the color we want to AND/OR
+ later. So we'll have to set the color to VGA_ALLPLANES
+ whenever we want to invert existing data, and reset it before the
+ AND/OR is done.
+ Also we replaced an outb( 0x3CF, tmp2 ) by the SetVideoGraphicsData( tmp2 )
+ it is representing. (Just a cosmetic replacement.)
+
+12. File vgaImages, function vgaDrawColorImage.
+ Moved a line "invert_existing_data = TRUE;" two lines down, past a case
+ label. Now it is also part of the code executed for GXorReverse, as it
+ should be.
+
+13. The pixmap FillSpans routines (file ppcPixmapFS.c) got somewhat better
+ after importing some code from ddx/ibm/vga. (A getbits function that does
+ wrapping.)
+ They were wrong for the FillStippled and FillOpaqueStippled modes.
+ I don't understand the old code. How could it handle stipples of a size not
+ an exact multiple of 32? (or 8, for that matter.)
+
+14. In function vgaBitBlt file vgaBitBlt.c, in the shortcuts for
+ GXSet, GXClear and GXInvert, the source (x0,y0) is accidentally operated
+ upon by vgaFillSolid, instead of the destination (x1,y1).
+
+15. Notice that in DoMonoSingle and DoMonoMany in file vgaStipple.c, the left
+ edge of the square to be stippled is treated wrong.
+ Correct would be to get the bits with getbits using offset xshift, and
+ to shift them right (x & 07) places.
+ [One might wish to use the variable tmp1 at this place, since it had been
+ set to (x & 07) at this place; but that is already re-used at this point.]
+ Also note that NeedValX is set wrong: The implicit assumption was that
+ stipples are more than 8 wide.
+ This only fixes the problem when miPushPixel is used instead of ppcPushPixel.
+ I think I should look some more into this.
+
+16. I took out some code of the CopyArea function, in which a no-op function
+ was called while a real one was needed. My fix does not completely work,
+ although it improved the behaviour of GetImage somewhat.
+
+17. After finding three kinds of errors in this single function,
+ -- the new kinds being the right side not being always written due to
+ an incorrect if scope, and the lower end not always being written due
+ to variables being updated at the wrong place --
+ (requiring modifications to be made at at least 10 places,
+ I decided to REWRITE the body of the ppcTileRect function from scratch.
+ This version simply computes all relevant margins in advance, and does
+ not try to reuse temporary variables. I leave that to the compiler.
+ (This was a maintenance and robustness nightmare anyway.)
+
+MORE NOTES:
+ It is funny that there are two files in mi that require compilation
+ with the proper #defines ( -DXF86VGA16 in my case ):
+ Besides the obvious mibitblt.c, there is also mipushpxl.c.
+
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/NOTES,v 1.1.2.2 1998/06/27 15:15:45 dawes Exp $