Re: [Dri-devel] Radeon PCI Fix

2003-02-04 Thread Benjamin Herrenschmidt
On Tue, 2003-02-04 at 21:25, Pawel Salek wrote: > On 2003.02.04 19:06 Michel Dänzer wrote: > > > > And there's even more: newer compilers seem to optimize away some of > > the > > reads with strict aliasing. I thought I'd steal some code from the > > kernel to detect if the compiler supports -fno-

Re: [Dri-devel] Radeon PCI Fix

2003-02-04 Thread Pawel Salek
On 2003.02.04 19:06 Michel Dänzer wrote: And there's even more: newer compilers seem to optimize away some of the reads with strict aliasing. I thought I'd steal some code from the kernel to detect if the compiler supports -fno-strict-aliasing, but it looks like it just uses that unconditionally

Re: [Dri-devel] Radeon PCI Fix

2003-02-04 Thread Michel Dänzer
On Die, 2003-02-04 at 20:09, Leif Delgass wrote: > On 4 Feb 2003, Michel Dänzer wrote: > > > On Die, 2003-02-04 at 19:36, Keith Whitwell wrote: > > > Michel Dänzer wrote: > > > > On Die, 2003-02-04 at 19:06, Michel Dänzer wrote: > > > > > > > > > > > >>After various tests, it looks like all of t

Re: [Dri-devel] Radeon PCI Fix

2003-02-04 Thread Leif Delgass
On 4 Feb 2003, Michel Dänzer wrote: > On Die, 2003-02-04 at 19:36, Keith Whitwell wrote: > > Michel Dänzer wrote: > > > On Die, 2003-02-04 at 19:06, Michel Dänzer wrote: > > > > > > > > >>After various tests, it looks like all of this is indeed necessary even > > >>with AGP. > > > > > > > > >

Re: [Dri-devel] Radeon PCI Fix

2003-02-04 Thread Keith Whitwell
Michel Dänzer wrote: On Die, 2003-02-04 at 19:36, Keith Whitwell wrote: Michel Dänzer wrote: On Die, 2003-02-04 at 19:06, Michel Dänzer wrote: After various tests, it looks like all of this is indeed necessary even with AGP. Also, I think at least the r128 driver could use the same trea

Re: [Dri-devel] Radeon PCI Fix

2003-02-04 Thread Michel Dänzer
On Die, 2003-02-04 at 19:36, Keith Whitwell wrote: > Michel Dänzer wrote: > > On Die, 2003-02-04 at 19:06, Michel Dänzer wrote: > > > > > >>After various tests, it looks like all of this is indeed necessary even > >>with AGP. > > > > > > Also, I think at least the r128 driver could use the same

Re: [Dri-devel] Radeon PCI Fix

2003-02-04 Thread Keith Whitwell
Michel Dänzer wrote: On Die, 2003-02-04 at 19:06, Michel Dänzer wrote: After various tests, it looks like all of this is indeed necessary even with AGP. Also, I think at least the r128 driver could use the same treatment, but we probably want to split COMMIT_RING() off ADVANCE_RING() as well

Re: [Dri-devel] Radeon PCI Fix

2003-02-04 Thread Michel Dänzer
On Die, 2003-02-04 at 19:06, Michel Dänzer wrote: > After various tests, it looks like all of this is indeed necessary even > with AGP. Also, I think at least the r128 driver could use the same treatment, but we probably want to split COMMIT_RING() off ADVANCE_RING() as well for that, and I'm not

Re: [Dri-devel] Radeon PCI Fix

2003-02-04 Thread Michel Dänzer
On Mon, 2003-02-03 at 18:09, Benjamin Herrenschmidt wrote: > On Mon, 2003-02-03 at 17:05, Michel Dänzer wrote: > > On Mon, 2003-02-03 at 17:34, Alan Cox wrote: > > > On Mon, 2003-02-03 at 15:02, Keith Whitwell wrote: > > > > > > > > > > -#define COMMIT_RING() do {

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Chris Ison
This has been seen before, and fixes a known issue with PCI cards locking up, the same fix possably fixes an issue occassionaly seen with AGP card locking up. It wasn't easy to track down and the fix was only found by accident, it could well of remained alot longer if I hadn't gotten impatient and

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Michel Dänzer
On Mon, 2003-02-03 at 22:59, Keith Whitwell wrote: > Michel Dänzer wrote: > > On Mon, 2003-02-03 at 22:31, Chris Ison wrote: > > > >>Yeah, it works, > > > > > > Great! > > > > > >>just a little weary of it cause remembering without the read it won't work, > >>but it still appears to work wit

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Keith Whitwell
Michel Dänzer wrote: On Mon, 2003-02-03 at 22:31, Chris Ison wrote: Yeah, it works, Great! just a little weary of it cause remembering without the read it won't work, but it still appears to work with the read at the end. Well, I think Ben has given the best explanation of what's going

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Michel Dänzer
On Mon, 2003-02-03 at 22:31, Chris Ison wrote: > Yeah, it works, Great! > just a little weary of it cause remembering without the read it won't work, > but it still appears to work with the read at the end. Well, I think Ben has given the best explanation of what's going on so far. Keith, are

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Chris Ison
Yeah, it works, just a little weary of it cause remembering without the read it won't work, but it still appears to work with the read at the end. > > You mean like this? Chris, does that work for you? > > -- > Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer > XFree86 an

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Michel Dänzer
On Mon, 2003-02-03 at 18:09, Benjamin Herrenschmidt wrote: > On Mon, 2003-02-03 at 17:05, Michel Dänzer wrote: > > On Mon, 2003-02-03 at 17:34, Alan Cox wrote: > > > On Mon, 2003-02-03 at 15:02, Keith Whitwell wrote: > > > > > > > > > > -#define COMMIT_RING() do {

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Benjamin Herrenschmidt
On Mon, 2003-02-03 at 17:05, Michel Dänzer wrote: > On Mon, 2003-02-03 at 17:34, Alan Cox wrote: > > On Mon, 2003-02-03 at 15:02, Keith Whitwell wrote: > > > > > > > > -#define COMMIT_RING() do { \ > > > > - RADEON_WRITE( RADEON_CP_RB_WPTR, dev_priv->

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Michel Dänzer
On Mon, 2003-02-03 at 17:47, Keith Whitwell wrote: > Michel Dänzer wrote: > > On Mon, 2003-02-03 at 15:53, Chris Ison wrote: > > > >>please find attached a complete patch that allows pci Radeon cards to > >>work with DRI. It was created against the DRI CVS xc branch/trunk. > > > > > > Thanks, I'

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Keith Whitwell
Michel Dänzer wrote: On Mon, 2003-02-03 at 15:53, Chris Ison wrote: please find attached a complete patch that allows pci Radeon cards to work with DRI. It was created against the DRI CVS xc branch/trunk. Thanks, I'll commit this unless someone else comes up with a better solution. Well, I'

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Michel Dänzer
On Mon, 2003-02-03 at 15:53, Chris Ison wrote: > please find attached a complete patch that allows pci Radeon cards to > work with DRI. It was created against the DRI CVS xc branch/trunk. Thanks, I'll commit this unless someone else comes up with a better solution. > Note: also contains the pcig

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Michel Dänzer
On Mon, 2003-02-03 at 17:34, Alan Cox wrote: > On Mon, 2003-02-03 at 15:02, Keith Whitwell wrote: > > > > > > -#define COMMIT_RING() do { \ > > > - RADEON_WRITE( RADEON_CP_RB_WPTR, dev_priv->ring.tail ); \ > > > +#define COMMIT_RING() do {

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Alan Cox
On Mon, 2003-02-03 at 15:02, Keith Whitwell wrote: > > > > -#define COMMIT_RING() do { \ > > - RADEON_WRITE( RADEON_CP_RB_WPTR, dev_priv->ring.tail ); \ > > +#define COMMIT_RING() do { \ > > + /* read from

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Michel Dänzer
On Mon, 2003-02-03 at 16:02, Keith Whitwell wrote: > > > > -#define COMMIT_RING() do { \ > > - RADEON_WRITE( RADEON_CP_RB_WPTR, dev_priv->ring.tail ); \ > > +#define COMMIT_RING() do { \ > > + /* read from

Re: [Dri-devel] Radeon PCI Fix

2003-02-03 Thread Keith Whitwell
-#define COMMIT_RING() do { \ - RADEON_WRITE( RADEON_CP_RB_WPTR, dev_priv->ring.tail ); \ +#define COMMIT_RING() do { \ + /* read from PCI bus to ensure correct posting */ \ + RADEON_READ( RADEON_CP_RB_WPTR ); \ + RADEON_WRITE