On Tue, 2002-04-30 at 15:26, Jos� Fonseca wrote:
> On 2002.04.30 14:16 Michel D�nzer wrote:
> > On Tue, 2002-04-30 at 10:45, Jos� Fonseca wrote:
> > > .... This is still not very clear - yesterday we
> > > discussed this in the IRC meeting -, because the colors are ok. Looking
> > > careful to the picture is seems that we have to word swap and not byte
> > > swap. Perhaps because within a pixel, the color disposition isn't
> > changed
> > > across little/big endian architectures.
> >
> > I was going to explain this is due to 32 bit swapping exchanging 16 bit
> > texels, but on second thought it should work if both the texture and
> > framebuffer use the same bpp.
> >
> > Where can I see that screenshot? :)
>
> Is in Peter's last message with attachement.
I don't seem to have gotten that.
> I still don't know how to define the MMIO to be portable... Shouldn't we
> use the read/write* macros instead of cpu_to_le32/le32_to_cpu?
Good idea! I've been missing those.
> Shouldn't be a wmb() on writes and a mb() on reads ?
Most definitely.
> Everywhere I look I read a different way of how to do... it's insane!
Indeed, so let me repeat my proposal to do something like this for all
drivers on all architectures:
#define ##_READ(reg) (_##_READ(##_ADDR(reg)))
static inline u32 _##_READ(u32 *addr)
{
mb();
return readl(addr);
}
#define ##_WRITE(reg,val) \
do { \
wmb(); \
writel(val,##_ADDR(reg)); \
} while (0)
(I wonder if the wmb() shouldn't rather be after the writel() in
##_WRITE() ...)
Looks like this could even be templated?
--
Earthling Michel D�nzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member / CS student, Free Software enthusiast
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel