LSI problem, endianness & cleanups
Benjamin Herrenschmidt
benh at kernel.crashing.org
Wed Jul 13 14:44:43 PDT 2011
On Wed, 2011-07-13 at 11:33 -0400, Alex Deucher wrote:
> > I'm thinking about instead defining in a .h something like
> >
> > #ifdef __BIG_ENDIAN
> > #define CP_RB_SWAP CP_RB_SWAP_32BIT
> > #else
> > #define CP_RB_SWAP 0
> > #endif
> >
> > And using CP_RB_SWAP everywhere, removing all the dups (which are bug prone
> > as always with dups). I'd like to make sure you are ok with that before I
> > jump and do it, and especially ok with having a _single_ instance of that bit
> > def for all radeon variants since the bits are in the same place everywhere.
> >
>
> Seems ok to me. But as you mentioned in IRC, I think in most cases we
> should just do the swap on the CPU. Also we generally use the same
> bits for all the endian swap fields so we could do something like:
>
> #define ENDIAN_NONE 0
> #define ENDIAN_8IN16 1
> #define ENDIAN_8IN32 2
>
> #ifdef __BIG_ENDIAN
> #define DFLT_SWAP ENDIAN_8IN32
> #else
> #define DFLT_SWAP ENDIAN_NONE
> #endif
>
> And use it for all the relevant fields.
Right.
As far as the CPU side swap, well, I agree mostly, but for the ring and
IB this is a much bigger undertaking. We'd have to "fix" everything that
writes (or reads, ie. validation) to ring and IB in kernel and
userspace, so I'll leave that one alone for now.
The IH and writeback were easy because they are contained within the
kernel driver.
Cheers,
Ben.
More information about the xorg-driver-ati
mailing list