Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-13 Thread Keith Whitwell
Eric Anholt wrote:
On Wed, 2003-03-12 at 05:57, Keith Whitwell wrote: 

OK, now that the recycle lockup has been found  fixed, I don't see any 
problems with this patch.  Has anyone got any objections to merging it to the 
trunk?

Eric, do you think this will be impossible to support on bsd?  It seems to fix 
some fundamental braino's in the orignal drm...


It's the second thing on my list, after some mopup after the XFree86
4.3.0 update.  I haven't looked at it seriously enough yet.  Please give
me a few days to get it at least building again on BSD.
OK, No worries.

Keith



---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-13 Thread Eric Anholt
On Thu, 2003-03-13 at 00:51, Keith Whitwell wrote:
 Eric Anholt wrote:
  On Wed, 2003-03-12 at 05:57, Keith Whitwell wrote: 
  
 OK, now that the recycle lockup has been found  fixed, I don't see any 
 problems with this patch.  Has anyone got any objections to merging it to the 
 trunk?
 
 Eric, do you think this will be impossible to support on bsd?  It seems to fix 
 some fundamental braino's in the orignal drm...
  
  
  It's the second thing on my list, after some mopup after the XFree86
  4.3.0 update.  I haven't looked at it seriously enough yet.  Please give
  me a few days to get it at least building again on BSD.
 
 OK, No worries.

Okay, it's possible on FreeBSD, and will also clean up some other
ugliness in the BSD DRM.  However, it's going to require some
significant work.  Haven't looked at NetBSD yet.

-- 
Eric Anholt[EMAIL PROTECTED]  
http://people.freebsd.org/~anholt/ [EMAIL PROTECTED]



---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-12 Thread Keith Whitwell
Keith Whitwell wrote:
Keith Whitwell wrote:

Linus Torvalds wrote:

On Sun, 2 Mar 2003, Linus Torvalds wrote:

The _second_ DRI-enabled X startup caused problems, even if I had done
multiple non-DRI X sessions in between. This is what makes me think 
that
the DRI kernel modules keep some history around that they 
shouldn't.  And
maybe the problem is hidden if you actually unload and re-load the
modules (is that what most people do?)




Ok, I went in and looked for suspicious behaviour, and I found some.

Look at AGP and MTRR behaviour: both of them are initialized by 
drm_init() at module load time.

Both of them are _de-initialized_ by the DRM(takedown)() code, and 
never
re-initialized by the DRM(setup)() code.

So an example of badness would be:

 - load DRM modules (in my case as part of kernel bootup, since they 
arecompiled in):

- initialize MTRR and AGP mappings

 - run X with DRI.

- Everything is happy.

 - exit DRI X

- we are the last close case for DRI, so DRM(release)() calls 
  DRM(takedown)(), which frees AGP and MTRR

 - restart non-DRI X

- nothing happens

 - kill non-DRI X

- nothing happens

 - run X with DRI again

- oops. We now have neither AGP nor MTRR's set up, even though
  the code looks like it is assuming it.
Yeah, maybe I'm missing where somebody else re-initializes AGP and 
MTRR, but my point is that these things do not seem to nest 
correctly.  That mtrr_del() in particular seems to be wrong, and I do 
indeed get a

mtrr: MTRR 2 not used

when shutting down X normally.

Comments? I haven't really gone through the whole path of what 
happens at open()/release() time, and these are really nothing more 
than that looks suspicious, maybe somebody who knows the code 
better than I can take a better look at it.


Yes it looks suspicious, but I don't think it's the cause of the 
lockups on X recycle.

Evidence for this:
- The lockup is new, while the code has been suspicious forever...
- I can exit and restart X just fine, it's only recycle that 
locks.  From the kernel point of view, these should be the same.
- In the Mesa embedded branch, I have a demo that closes  reopens 
its connections to the kernel without exiting.  Again this works fine.

I've also verified that this lockup wasn't introduced in the filp 
work, ie. it had already sneaked into the trunk somehow. 


OK, I've had some time to track this down.  It comes down to the changes 
introduced to radeon_driver.c around 29 Oct last year.


revision 1.45
date: 2002/10/29 13:49:25;  author: mdaenzer;  state: Exp;  lines: +30 -19
* preserve CRTC{,2}_OFFSET_CNTL in 2D driver to avoid bad effects when
  pageflipping after a mode switch
* take current page into account in AdjustFrame(); writing the CRTC offset
  via the CP was probably a bad idea as this can happen asynchronously,
  reverted
* take frame offset into account when flipping pages
* handle CRTC2 as well for pageflipping (untested)
* preserve GEN_INT_CNTL on mode switches to prevent interrupts from getting
  disabled

Michel, have you got time to look into why this is causing server 
recycles to hang?  I can't reproduce it on all machines, so it's 
possible that your test box is one of the ones unaffected by this lockup 
-- if you can't reproduce, let me know...

I'll poke around in the meantime  try  figure it out.
In fact the lockup comes down to this one line:

--- radeon_driver.c 28 Oct 2002 02:21:14 -  1.44
+++ radeon_driver.c 29 Oct 2002 13:49:25 -  1.45
@@ -4639,6 +4639,7 @@
 save-cap0_trig_cntl = 0;
 save-cap1_trig_cntl = 0;
 save-bus_cntl   = info-BusCntl;
+save-gen_int_cntl   = info-gen_int_cntl;
 /*
  * If bursts are enabled, turn on discards
  * Radeon doesn't have write bursts
Michel,  what are the consequences of removing this?

Keith



---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-12 Thread Michel Dänzer
On Mit, 2003-03-12 at 10:55, Keith Whitwell wrote:
 
 In fact the lockup comes down to this one line:
 
 
 --- radeon_driver.c   28 Oct 2002 02:21:14 -  1.44
 +++ radeon_driver.c   29 Oct 2002 13:49:25 -  1.45
 @@ -4639,6 +4639,7 @@
   save-cap0_trig_cntl = 0;
   save-cap1_trig_cntl = 0;
   save-bus_cntl   = info-BusCntl;
 +save-gen_int_cntl   = info-gen_int_cntl;
   /*
* If bursts are enabled, turn on discards
* Radeon doesn't have write bursts
 
 
 Michel,  what are the consequences of removing this?

Well, the idea of this line is to preserve the interrupts the chip
generates over mode changes. What does this get set to before the
lockup? Something else than during the first server generation?

Thanks for tracking this down Keith, I'd love to dive into this, but I'm
supposed to be learning for the exam tomorrow. :( I'll hopefully find
the time during the weekend at the latest.


-- 
Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member   /  CS student, Free Software enthusiast



---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-12 Thread Keith Whitwell
OK, now that the recycle lockup has been found  fixed, I don't see any 
problems with this patch.  Has anyone got any objections to merging it to the 
trunk?

Eric, do you think this will be impossible to support on bsd?  It seems to fix 
some fundamental braino's in the orignal drm...

Keith



---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-12 Thread Charl P. Botha
On Wed, Mar 12, 2003 at 01:57:03PM +, Keith Whitwell wrote:
 OK, now that the recycle lockup has been found  fixed, I don't see any 
 problems with this patch.  Has anyone got any objections to merging it to 
 the trunk?

FW(L)IW, you have my vote.  As mentioned earlier, your filp work fixes all
kinds of nasty problems on my setup.

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/


---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-12 Thread Eric Anholt
On Wed, 2003-03-12 at 05:57, Keith Whitwell wrote: 
 OK, now that the recycle lockup has been found  fixed, I don't see any 
 problems with this patch.  Has anyone got any objections to merging it to the 
 trunk?
 
 Eric, do you think this will be impossible to support on bsd?  It seems to fix 
 some fundamental braino's in the orignal drm...

It's the second thing on my list, after some mopup after the XFree86
4.3.0 update.  I haven't looked at it seriously enough yet.  Please give
me a few days to get it at least building again on BSD.


-- 
Eric Anholt[EMAIL PROTECTED]  
http://people.freebsd.org/~anholt/ [EMAIL PROTECTED]



---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-11 Thread Keith Whitwell
Keith Whitwell wrote:
Linus Torvalds wrote:

On Sun, 2 Mar 2003, Linus Torvalds wrote:

The _second_ DRI-enabled X startup caused problems, even if I had done
multiple non-DRI X sessions in between. This is what makes me think that
the DRI kernel modules keep some history around that they shouldn't.  
And
maybe the problem is hidden if you actually unload and re-load the
modules (is that what most people do?)


Ok, I went in and looked for suspicious behaviour, and I found some.

Look at AGP and MTRR behaviour: both of them are initialized by 
drm_init() at module load time.

Both of them are _de-initialized_ by the DRM(takedown)() code, and 
never
re-initialized by the DRM(setup)() code.

So an example of badness would be:

 - load DRM modules (in my case as part of kernel bootup, since they 
arecompiled in):

- initialize MTRR and AGP mappings

 - run X with DRI.

- Everything is happy.

 - exit DRI X

- we are the last close case for DRI, so DRM(release)() calls 
  DRM(takedown)(), which frees AGP and MTRR

 - restart non-DRI X

- nothing happens

 - kill non-DRI X

- nothing happens

 - run X with DRI again

- oops. We now have neither AGP nor MTRR's set up, even though
  the code looks like it is assuming it.
Yeah, maybe I'm missing where somebody else re-initializes AGP and 
MTRR, but my point is that these things do not seem to nest 
correctly.  That mtrr_del() in particular seems to be wrong, and I do 
indeed get a

mtrr: MTRR 2 not used

when shutting down X normally.

Comments? I haven't really gone through the whole path of what happens 
at open()/release() time, and these are really nothing more than that 
looks suspicious, maybe somebody who knows the code better than I can 
take a better look at it.


Yes it looks suspicious, but I don't think it's the cause of the lockups 
on X recycle.

Evidence for this:
- The lockup is new, while the code has been suspicious forever...
- I can exit and restart X just fine, it's only recycle that locks.  
From the kernel point of view, these should be the same.
- In the Mesa embedded branch, I have a demo that closes  reopens 
its connections to the kernel without exiting.  Again this works fine.

I've also verified that this lockup wasn't introduced in the filp work, 
ie. it had already sneaked into the trunk somehow. 
OK, I've had some time to track this down.  It comes down to the changes 
introduced to radeon_driver.c around 29 Oct last year.


revision 1.45
date: 2002/10/29 13:49:25;  author: mdaenzer;  state: Exp;  lines: +30 -19
* preserve CRTC{,2}_OFFSET_CNTL in 2D driver to avoid bad effects when
  pageflipping after a mode switch
* take current page into account in AdjustFrame(); writing the CRTC offset
  via the CP was probably a bad idea as this can happen asynchronously,
  reverted
* take frame offset into account when flipping pages
* handle CRTC2 as well for pageflipping (untested)
* preserve GEN_INT_CNTL on mode switches to prevent interrupts from getting
  disabled

Michel, have you got time to look into why this is causing server recycles to 
hang?  I can't reproduce it on all machines, so it's possible that your test 
box is one of the ones unaffected by this lockup -- if you can't reproduce, 
let me know...

I'll poke around in the meantime  try  figure it out.

Keith



---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-11 Thread Michel Dänzer
On Die, 2003-03-11 at 14:41, Keith Whitwell wrote:
 Keith Whitwell wrote:
  
  Evidence for this:
  - The lockup is new, while the code has been suspicious forever...
  - I can exit and restart X just fine, it's only recycle that locks.  
  From the kernel point of view, these should be the same.
  - In the Mesa embedded branch, I have a demo that closes  reopens 
  its connections to the kernel without exiting.  Again this works fine.
  
  I've also verified that this lockup wasn't introduced in the filp work, 
  ie. it had already sneaked into the trunk somehow. 
 
 OK, I've had some time to track this down.  It comes down to the changes 
 introduced to radeon_driver.c around 29 Oct last year.
 
 
 
 revision 1.45
 date: 2002/10/29 13:49:25;  author: mdaenzer;  state: Exp;  lines: +30 -19
 * preserve CRTC{,2}_OFFSET_CNTL in 2D driver to avoid bad effects when
pageflipping after a mode switch
 * take current page into account in AdjustFrame(); writing the CRTC offset
via the CP was probably a bad idea as this can happen asynchronously,
reverted
 * take frame offset into account when flipping pages
 * handle CRTC2 as well for pageflipping (untested)
 * preserve GEN_INT_CNTL on mode switches to prevent interrupts from getting
disabled
 

Whoops. I plead guilty. :\

 Michel, have you got time to look into why this is causing server recycles to 
 hang?  

Unfortunately not really right now... I'll try to, anyway.

 I can't reproduce it on all machines, so it's possible that your test 
 box is one of the ones unaffected by this lockup -- if you can't reproduce, 
 let me know...

I haven't been able to reproduce it yet, but then I haven't tried very
hard (gdm defaults to restarting the server these days).


-- 
Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member   /  CS student, Free Software enthusiast



---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-08 Thread Keith Whitwell
Linus Torvalds wrote:
On Sun, 2 Mar 2003, Linus Torvalds wrote:

The _second_ DRI-enabled X startup caused problems, even if I had done
multiple non-DRI X sessions in between. This is what makes me think that
the DRI kernel modules keep some history around that they shouldn't.  And
maybe the problem is hidden if you actually unload and re-load the
modules (is that what most people do?)


Ok, I went in and looked for suspicious behaviour, and I found some.

Look at AGP and MTRR behaviour: both of them are initialized by drm_init() 
at module load time.

Both of them are _de-initialized_ by the DRM(takedown)() code, and never
re-initialized by the DRM(setup)() code.
So an example of badness would be:

 - load DRM modules (in my case as part of kernel bootup, since they are 
   compiled in):

	- initialize MTRR and AGP mappings

 - run X with DRI.

	- Everything is happy.

 - exit DRI X

	- we are the last close case for DRI, so DRM(release)() calls 
	  DRM(takedown)(), which frees AGP and MTRR

 - restart non-DRI X

	- nothing happens

 - kill non-DRI X

	- nothing happens

 - run X with DRI again

- oops. We now have neither AGP nor MTRR's set up, even though
  the code looks like it is assuming it.
Yeah, maybe I'm missing where somebody else re-initializes AGP and MTRR, 
but my point is that these things do not seem to nest correctly.  That 
mtrr_del() in particular seems to be wrong, and I do indeed get a

	mtrr: MTRR 2 not used

when shutting down X normally.

Comments? I haven't really gone through the whole path of what happens at 
open()/release() time, and these are really nothing more than that looks 
suspicious, maybe somebody who knows the code better than I can take a 
better look at it.
Yes it looks suspicious, but I don't think it's the cause of the lockups on X 
recycle.

Evidence for this:
	- The lockup is new, while the code has been suspicious forever...
	- I can exit and restart X just fine, it's only recycle that locks.  From the 
kernel point of view, these should be the same.
	- In the Mesa embedded branch, I have a demo that closes  reopens its 
connections to the kernel without exiting.  Again this works fine.

I've also verified that this lockup wasn't introduced in the filp work, ie. it 
had already sneaked into the trunk somehow.  	

More  more I want to clean up the drm_*.h files.  Starting by removing code 
that isn't widely used...  At this time my eyes turn towards the gamma driver, 
which is the hook a lot of the bogus code in those files hangs on -- does 
*anyone* use this in the current tree?

Keith



---
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-08 Thread Andreas Stenglein
Hello,

It looks like there is different behavior if
you are using builtin radeon (and agpgart) instead
of using modules radeon.o and agpgart.o:
If I start X from command-line, exit session,
startx again, X and DRI seems to work fine, at least
there is no lockup. (radeon and agpgart as modul)
As I understand Linus, he has a problem even in
this case. I grepped /var/log/messages for mtrr,
but found nothing (kernel 2.4.20 with v4l2)
MY box only locks up when exiting a session if
I am using a graphical login.
(maybe it would be interesting to see what happens
when using radeon.o modul and builtin agpgart,
or radeon.o modul _without_ agpgart,
or radeon compiled-in without agpgart)
to the History of the bug:
I remember that I had to use gdm, because kdm
didnt work. That was about a year ago when
I bought this box with the radeon7500.
gdm just startet the Xserver again if it
exited with an error.
So something seems to be there for over a year
(maybe since xfree 4.2.0 or even before?)
but it only crashed the Xserver, not the
whole box. And since that wasnt really
hurting someone, nobody cared about it...
best regards,
Andreas
Am 2003.03.08 13:31:15 +0100 schrieb(en) Keith Whitwell:
Linus Torvalds wrote:
On Sun, 2 Mar 2003, Linus Torvalds wrote:

The _second_ DRI-enabled X startup caused problems, even if I had 
done
multiple non-DRI X sessions in between. This is what makes me 
think that
the DRI kernel modules keep some history around that they 
shouldn't.  And
maybe the problem is hidden if you actually unload and re-load the
modules (is that what most people do?)


Ok, I went in and looked for suspicious behaviour, and I found 
some.

Look at AGP and MTRR behaviour: both of them are initialized by 
drm_init() at module load time.

Both of them are _de-initialized_ by the DRM(takedown)() code, 
and never
re-initialized by the DRM(setup)() code.

So an example of badness would be:

 - load DRM modules (in my case as part of kernel bootup, since 
they arecompiled in):

	- initialize MTRR and AGP mappings

 - run X with DRI.

	- Everything is happy.

 - exit DRI X

	- we are the last close case for DRI, so DRM(release)() 
calls 	  DRM(takedown)(), which frees AGP and MTRR

 - restart non-DRI X

	- nothing happens

 - kill non-DRI X

	- nothing happens

 - run X with DRI again

- oops. We now have neither AGP nor MTRR's set up, even though
  the code looks like it is assuming it.
Yeah, maybe I'm missing where somebody else re-initializes AGP and 
MTRR, but my point is that these things do not seem to nest 
correctly.  That mtrr_del() in particular seems to be wrong, and I 
do indeed get a

	mtrr: MTRR 2 not used

when shutting down X normally.

Comments? I haven't really gone through the whole path of what 
happens at open()/release() time, and these are really nothing 
more than that looks suspicious, maybe somebody who knows the 
code better than I can take a better look at it.
Yes it looks suspicious, but I don't think it's the cause of the 
lockups on X recycle.

Evidence for this:
	- The lockup is new, while the code has been suspicious 
forever...
	- I can exit and restart X just fine, it's only recycle that 
locks.  From the kernel point of view, these should be the same.
	- In the Mesa embedded branch, I have a demo that closes  
reopens its connections to the kernel without exiting.  Again this 
works fine.

I've also verified that this lockup wasn't introduced in the filp 
work, ie. it had already sneaked into the trunk somehow.  	 
More  more I want to clean up the drm_*.h files.  Starting by 
removing code that isn't widely used...  At this time my eyes turn 
towards the gamma driver, which is the hook a lot of the bogus code 
in those files hangs on -- does *anyone* use this in the current 
tree?

Keith


---
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
for complex code. Debugging C/C++ programs can leave you feeling lost and
disoriented. TotalView can help you find your way. Available on major UNIX
and Linux platforms. Try it free. www.etnus.com
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-05 Thread Jens Owen
Linus Torvalds wrote:
On Sun, 2 Mar 2003, Linus Torvalds wrote:

The _second_ DRI-enabled X startup caused problems, even if I had done
multiple non-DRI X sessions in between. This is what makes me think that
the DRI kernel modules keep some history around that they shouldn't.  And
maybe the problem is hidden if you actually unload and re-load the
modules (is that what most people do?)


Ok, I went in and looked for suspicious behaviour, and I found some.

Look at AGP and MTRR behaviour: both of them are initialized by drm_init() 
at module load time.

Both of them are _de-initialized_ by the DRM(takedown)() code, and never
re-initialized by the DRM(setup)() code.
So an example of badness would be:

 - load DRM modules (in my case as part of kernel bootup, since they are 
   compiled in):

	- initialize MTRR and AGP mappings

 - run X with DRI.

	- Everything is happy.

 - exit DRI X

	- we are the last close case for DRI, so DRM(release)() calls 
	  DRM(takedown)(), which frees AGP and MTRR

 - restart non-DRI X

	- nothing happens

 - kill non-DRI X

	- nothing happens

 - run X with DRI again

- oops. We now have neither AGP nor MTRR's set up, even though
  the code looks like it is assuming it.
Yeah, maybe I'm missing where somebody else re-initializes AGP and MTRR, 
but my point is that these things do not seem to nest correctly.  That 
mtrr_del() in particular seems to be wrong, and I do indeed get a

	mtrr: MTRR 2 not used

when shutting down X normally.

Comments? I haven't really gone through the whole path of what happens at 
open()/release() time, and these are really nothing more than that looks 
suspicious, maybe somebody who knows the code better than I can take a 
better look at it.
Linus,

Sounds like you may be on to something.  Server recycles are common with 
display managers.  An easy way to test (and debug) this scenario would 
be to bring up a raw X server (no window manager, display manager or 
clients), then run glxinfo, xdpyinfo or start and stop any X client 
(this will cause the server to recycle when they exit...if they are the 
only client), and then you should be in a state where you can try 
running gears or some other simple 3D application on an X server that 
has recycled.

--
   /\
 Jens Owen/  \/\ _
  [EMAIL PROTECTED]  /\ \ \   Steamboat Springs, Colorado


---
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-02 Thread Linus Torvalds

On Sun, 2 Mar 2003, Andreas Stenglein wrote:
 
 I pulled the powercable, waited, plugged the cable,
 startet the box up again and tried without dri:
 Xserver recycles well!

I have apparently seen something like this even on 2.5.x.  What kernels 
have you tried?

The symptoms I saw were kernel oopses in totally unrelated pieces of code
when re-starting the X server. The times I was able to reproduce it I
could re-start a non-DRI X server several times (by just specifying
-depth 8), but then when I restarted a DRI one it would cause 
impossible oopses (where impossible means that they were in totally 
normal code-paths in the kernel that had nothing to do with DRI, and 
looked like major internal data-corruption).

I have my kernel DRM modules compiled in, and to me it really looked like
something had free'd the resources on the first X session shutdown, but
then left a pointer around to the free'd resources, so that when the 
second DRI session was started it used the long-since-free'd resources and 
obviously started corrupting things.

But that's just a wild guess from the behaviour I saw (which was not
entirely reproducible, btw - I recompiled my kernel with slab and spinlock
debugging to try to catch it better, and I wasn't able to make it happen
again). I don't actually have ay such code in DRI that I could really
point to.

In short: non-dri X setups seemed to work well, even with a setup that did 
seem to be able to reproduce the problem reliably. So it really looked 
like something DRI did.

The first X startup had no problems, which means that this can have been
going on for a long time as far as I'm concerned (I usually don't cycle
out from X: I don't use XDM, and I reboot the kernel more often than I 
have reason to exit X ;)

The _second_ DRI-enabled X startup caused problems, even if I had done
multiple non-DRI X sessions in between. This is what makes me think that
the DRI kernel modules keep some history around that they shouldn't.  And
maybe the problem is hidden if you actually unload and re-load the
modules (is that what most people do?)

Linus



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-02 Thread Linus Torvalds

On Sun, 2 Mar 2003, Linus Torvalds wrote:
 
 The _second_ DRI-enabled X startup caused problems, even if I had done
 multiple non-DRI X sessions in between. This is what makes me think that
 the DRI kernel modules keep some history around that they shouldn't.  And
 maybe the problem is hidden if you actually unload and re-load the
 modules (is that what most people do?)

Ok, I went in and looked for suspicious behaviour, and I found some.

Look at AGP and MTRR behaviour: both of them are initialized by drm_init() 
at module load time.

Both of them are _de-initialized_ by the DRM(takedown)() code, and never
re-initialized by the DRM(setup)() code.

So an example of badness would be:

 - load DRM modules (in my case as part of kernel bootup, since they are 
   compiled in):

- initialize MTRR and AGP mappings

 - run X with DRI.

- Everything is happy.

 - exit DRI X

- we are the last close case for DRI, so DRM(release)() calls 
  DRM(takedown)(), which frees AGP and MTRR

 - restart non-DRI X

- nothing happens

 - kill non-DRI X

- nothing happens

 - run X with DRI again

- oops. We now have neither AGP nor MTRR's set up, even though
  the code looks like it is assuming it.

Yeah, maybe I'm missing where somebody else re-initializes AGP and MTRR, 
but my point is that these things do not seem to nest correctly.  That 
mtrr_del() in particular seems to be wrong, and I do indeed get a

mtrr: MTRR 2 not used

when shutting down X normally.

Comments? I haven't really gone through the whole path of what happens at 
open()/release() time, and these are really nothing more than that looks 
suspicious, maybe somebody who knows the code better than I can take a 
better look at it.

Linus



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-02 Thread Felix Kühling
On Sun, 2 Mar 2003 10:34:35 -0800 (PST)
Linus Torvalds [EMAIL PROTECTED] wrote:

 
 On Sun, 2 Mar 2003, Andreas Stenglein wrote:
  
  I pulled the powercable, waited, plugged the cable,
  startet the box up again and tried without dri:
  Xserver recycles well!
 
 I have apparently seen something like this even on 2.5.x.  What kernels 
 have you tried?
 
 The symptoms I saw were kernel oopses in totally unrelated pieces of code
 when re-starting the X server. The times I was able to reproduce it I
 could re-start a non-DRI X server several times (by just specifying
 -depth 8), but then when I restarted a DRI one it would cause 
 impossible oopses (where impossible means that they were in totally 
 normal code-paths in the kernel that had nothing to do with DRI, and 
 looked like major internal data-corruption).
 
 I have my kernel DRM modules compiled in, and to me it really looked like
 something had free'd the resources on the first X session shutdown, but
 then left a pointer around to the free'd resources, so that when the 
 second DRI session was started it used the long-since-free'd resources and 
 obviously started corrupting things.
 
 But that's just a wild guess from the behaviour I saw (which was not
 entirely reproducible, btw - I recompiled my kernel with slab and spinlock
 debugging to try to catch it better, and I wasn't able to make it happen
 again). I don't actually have ay such code in DRI that I could really
 point to.
 
 In short: non-dri X setups seemed to work well, even with a setup that did 
 seem to be able to reproduce the problem reliably. So it really looked 
 like something DRI did.
 
 The first X startup had no problems, which means that this can have been
 going on for a long time as far as I'm concerned (I usually don't cycle
 out from X: I don't use XDM, and I reboot the kernel more often than I 
 have reason to exit X ;)
 
 The _second_ DRI-enabled X startup caused problems, even if I had done
 multiple non-DRI X sessions in between. This is what makes me think that
 the DRI kernel modules keep some history around that they shouldn't.  And
 maybe the problem is hidden if you actually unload and re-load the
 modules (is that what most people do?)

I have seen recycle problems as well, but only when using gdm. It never
crashed when restarting X via startx several times. Anyway, that
experience is 2 months old as I had some important stuff running lately
so I didn't want to risk crashing my box. I was using 2.4.19 from
kernel.org with preempt patch and drm kernel modules from DRI CVS head
at the time the crashes happened.

The first time I saw this problem was shortly after the big merge from
XFree86 CVS (4.2.99.2). It was never completely reproducible. Sometimes
logging out to gdm crashed the box, sometimes it worked fine. It
happened several times in December, that I thought, the problem had gone
away, and just then - boom! - it crashed again :-/

 
   Linus

__\|/_____ ___   -
 Felix   ___\_e -_/___/ __\___/ __\_   You can do anything,
   Kühling  (_\Ä// /_/ /)  just not everything
 [EMAIL PROTECTED]   \___/   \___/   Uat the same time.


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Dri-devel] drm-filp-0-1-branch and radeon

2003-03-02 Thread Andreas Stenglein
Am 2003.03.02 19:34:35 +0100 schrieb(en) Linus Torvalds:
On Sun, 2 Mar 2003, Andreas Stenglein wrote:

 I pulled the powercable, waited, plugged the cable,
 startet the box up again and tried without dri:
 Xserver recycles well!
I have apparently seen something like this even on 2.5.x.  What
kernels
have you tried?
I used a 2.4.20 kernel with v4l2 patches from kraxel
(bytesex.org)
A workaround to the recycle-problem works:
start only to runlevel 3 (without graphical login),
and start the Xserver manually: startx
when logging off from the X session, you are
back on the console. no lockup.
startx again... and glxgears works hw-accelerated again
best regards,
Andreas
---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel