Re: Console rotation problems

From: Benjamin Herrenschmidt
Date: Wed Nov 23 2005 - 20:52:32 EST

On Thu, 2005-11-24 at 11:52 +1100, Benjamin Herrenschmidt wrote:
> On Thu, 2005-11-24 at 11:45 +1100, Benjamin Herrenschmidt wrote:
> > Hi Antonio !
> >
> > I decided to give a quick test to console rotation on my g5 (radeonfb)
> > and couldn't get it to work.
> >
> > When I tried echo'ing something in con_rotate, something very strange
> > happened:
> >
> > pogo:/sys/class/graphics/fb0# echo "1" >con_rotate
> > benh@pogo:~$
> .../...
> And here is the Oops that explains the shell exit and that I didn't see
> the first time :)
> Trap 0x600 is an alignment exception, which is a bit weird, I'll try to
> dig a bit more, it could be a problem with the alignment trap handler on
> ppc.

Ok, looks like an unaligned set_bit() or atomic_or(). You can't do
atomic operations on non-aligned quantities. Let me check the code ...


Is there any reason why you are using set_bit & friends all over the
place over there in fbcon_rotate.h ? Are you actually trying to perform
atomic operations ?

set_bit(), clear_bit() etc... are

1) atomic. that mean slow, won't work on uncached memory (like
framebuffer), and won't work if not aligned propertly

2) won't guarantee the bit position, they are consistent within an
architecture but not accross.

If you want bit manipulation of pixel data, use your own routines, using
set_bit/clear_bit & friends is completely bogus.

The __xxx versions will fix 1), but not 2) btw.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at