home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!munnari.oz.au!metro!news
- From: dawes@physics.su.OZ.AU (David Dawes)
- Subject: XPutImage and server with bit_order!=byte_order
- Message-ID: <1992Aug26.143515.24065@ucc.su.OZ.AU>
- Sender: news@ucc.su.OZ.AU
- Nntp-Posting-Host: physics.su.oz.au
- Organization: School of Physics, University of Sydney, Australia
- Date: Wed, 26 Aug 1992 14:35:15 GMT
- Lines: 61
-
- I've been working on a mono VGA version of X386. The 386 has a little
- endian byte-order, but the VGA's mono frame buffer uses a big endian bit-order.
- The mfb code can handle this, but there seems to be a problem with
- the conversions done in XPutImage (Xlib).
-
- I've looked at the code -- and the reasoning given in XPutImage.c, and I
- believe there is a problem.
-
- Here is an extract:
-
- -> The following table gives the bit ordering within bytes (when accessed
- -> sequentially) for a scanline containing 32 bits, with bits numbered 0 to
- -> 31, where bit 0 should be leftmost on the display. For a given byte
- -> labelled A-B, A is for the most significant bit of the byte, and B is
- -> for the least significant bit.
- ->
- -> legend:
- -> 1 scanline-unit = 8
- -> 2 scanline-unit = 16
- -> 4 scanline-unit = 32
- -> M byte-order = MostSignificant
- -> L byte-order = LeastSignificant
- -> m bit-order = MostSignificant
- -> l bit-order = LeastSignificant
- ->
- ->
- -> format ordering
- ->
- -> 1Mm 00-07 08-15 16-23 24-31
- -> 2Mm 00-07 08-15 16-23 24-31
- -> 4Mm 00-07 08-15 16-23 24-31
- -> 1Ml 07-00 15-08 23-16 31-24
- -> 2Ml 15-08 07-00 31-24 23-16
- -> 4Ml 31-24 23-16 15-08 07-00
- -> 1Lm 00-07 08-15 16-23 24-31
- -> 2Lm 08-15 00-07 24-31 16-23
- -> 4Lm 24-31 16-23 08-15 00-07
- -> 1Ll 07-00 15-08 23-16 31-24
- -> 2Ll 07-00 15-08 23-16 31-24
- -> 4Ll 07-00 15-08 23-16 31-24
-
- It seems to me that the lines for 2Ml, 4Ml, 2Lm, 4Lm are not correct.
- The only difference between 1Ll and 1Lm is that the bit order within
- each byte is reversed. The same is true for 4Ll and 4Lm (at least
- that's how the mfb code works). Why then is the ordering given for 1Lm
- different to that for 4Lm when 1Ll and 4Ll are the same? The above
- table is showing the byte order reversed as well as the bit order (and
- this is what is causing problems with the mono VGA server which uses
- bitmaps of the 4Lm type).
-
- Is there something that I'm missing?
-
- (Modifying XPutImage along these lines fixes the problem -- but the server
- will have problems with clients built with the unmodified version.)
-
- David
- --
- ------------------------------------------------------------------------------
- David Dawes (dawes@physics.su.oz.au) DoD#210 | Phone: +61 2 692 2639
- School of Physics, University of Sydney, Australia | Fax: +61 2 660 2903
- ------------------------------------------------------------------------------
-