Re: rasops15 byte order bug

2016-09-16 Thread Michael
Hello,

On Fri, 16 Sep 2016 20:29:32 +0300
Valery Ushakov  wrote:

> On Fri, Sep 16, 2016 at 13:05:16 -0400, Michael wrote:
> 
> > On Fri, 16 Sep 2016 11:11:34 +0200
> > Manuel Bouyer  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.

I think we need something like RI_FB_IS_BE and adjust the endianness
checks accordingly. That would also solve the igsfb thing.

have fun
Michael


Re: rasops15 byte order bug

2016-09-16 Thread Valery Ushakov
On Fri, Sep 16, 2016 at 13:05:16 -0400, Michael wrote:

> On Fri, 16 Sep 2016 11:11:34 +0200
> Manuel Bouyer  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


Re: rasops15 byte order bug

2016-09-16 Thread scole_mail
Valery Ushakov  writes:

> On Wed, Sep 14, 2016 at 13:40:50 -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
>
> Are you sure it's not the case of missing RI_BSWAP flag in your
> framebuffer attachment?
>

I'll have to look at this again when I have time...

I recall RI_BSWAP didn't help but the kernel option RASOPS_SMALL did.

I'll add a note in driver about it for now and leave rasops15.c alone.

Thanks



Re: rasops15 byte order bug

2016-09-16 Thread Michael
On Fri, 16 Sep 2016 11:11:34 +0200
Manuel Bouyer  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.

have fun
Michael




Re: rasops15 byte order bug

2016-09-16 Thread Valery Ushakov
On Wed, Sep 14, 2016 at 13:40:50 -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

Are you sure it's not the case of missing RI_BSWAP flag in your
framebuffer attachment?

-uwe


Re: rasops15 byte order bug

2016-09-16 Thread Manuel Bouyer
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.

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--