[6145] in Athena Bugs
rt 7.1H: Xplx bug fix
daemon@ATHENA.MIT.EDU (russ@ATHENA.MIT.EDU)
Mon Oct 1 12:40:19 1990
From: russ@ATHENA.MIT.EDU
To: bugs@ATHENA.MIT.EDU
Cc: dccjfcmckiephilsjudhodgesmichon@ATHENA.MIT.EDU
Date: Mon, 01 Oct 90 12:39:50 EDT
System name: e40-342g-1
Type and version: RT 7.1H
Display type: PLX
What were you trying to do?
XGetImage from a VAX; then use XPutImage to transfer
the same image to an RT Parallax
What's wrong:
destination image on RT is byte-swapped
Dave Carver and I tracked this down and discovered the fix. I'm
sending this to bugs so it gets into the next release.
The problem is that the Parallax hardware needs to byte-swap 8-bit
images on big-endian architectures. The byte-swap flag in the server,
which is set to a default at compile time, is correct for VAXen,
Suns, etc.; but the RT (ibm032 flag) is tossed in with the
little-endian architectures and not the big-endian; hence, a BUG.
As a result, for the past 2 years, anyone doing imaging work between
VAX and RT Parallaxes (like in CRL) has had to byte-swap their 8-bit
VAX images in the client, before sending them to RT Parallax displays
(if they want the image to look right, that is). Ditto with RT images
gotten via XGetImage which are later sent to VAXen.
Here's the offending portion of plxMisc.c, which applies to either
the R3 or R4 server.
===== unmodified source excerpt: plxMisc.c ===============
/* Model 1280 device setup */
if (bswapflag != -1) {
plxdefaultbswap = bswapflag;
} else {
#if defined(vax) || defined(i386) || defined(ibm032)
plxdefaultbswap = 0;
#endif
#if defined(sun) || defined(is68k) || defined(motorola131) || defined(hpux)
plxdefaultbswap = 1;
#endif
}
plxbyteswap(plxdefaultbswap);
========= fixed version ===============
/* Model 1280 device setup */
if (bswapflag != -1) {
plxdefaultbswap = bswapflag;
} else {
#if defined(vax) || defined(i386)
plxdefaultbswap = 0;
#endif
#if defined(ibm032) || defined(sun) || defined(is68k) || defined(motorola131) || defined(hpux)
plxdefaultbswap = 1;
#endif
}
plxbyteswap(plxdefaultbswap);
===========
--Russ