Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rasops15 byte order bug



On Fri, Sep 16, 2016 at 13:05:16 -0400, Michael wrote:

> On Fri, 16 Sep 2016 11:11:34 +0200
> Manuel Bouyer <bouyer%antioche.eu.org@localhost> wrote:
> 
> > On Wed, Sep 14, 2016 at 01:40:50PM -0700, scole_mail wrote:
> > > Anyone using a 15/16 bit rasops console without issues?  I think there is
> > > a byte order error in rasops15.c .
> > > 
> > > This patch worked for me, wondering if anyone else can confirm the error
> > > and/or verify this fix.
> > 
> > It's been a while since I played with this, but I think this is used for
> > tifb (am335x SoCs, as found on the beaglebone). AFAIK It works fine for me
> > with a 16bit display.
> 
> I suspect the #ifdef shouldn't check just host byte order but host byte
> order vs. video hardware byte order. Probably needs a new rasops_info flag.

I haven't touched this in a *very* long time, but (about early 2002)
in rasops8.c I ended up with

#if BYTE_ORDER == BIG_ENDIAN
#define NEED_LITTLE_ENDIAN_STAMP RI_BSWAP
#else
#define NEED_LITTLE_ENDIAN_STAMP 0
#endif
	if ((ri->ri_flg & RI_BSWAP) == NEED_LITTLE_ENDIAN_STAMP)
	    ...

Don't know how correct that was, but it's been working for the endian
permutations we have.

Note that we apply RI_BSWAP to 32 and 15/16 bit cases in rasops.c, not
when building stamps.

-uwe


Home | Main Index | Thread Index | Old Index