Re: [XFree86] i810 driver agpgart error

2003-02-12 Thread David Dawes
On Tue, Feb 11, 2003 at 08:35:14PM +0100, Egbert Eich wrote:
Content-Description: message body text
Michael Cardenas writes:
  Unfortunately, I edited i810_memory.c and changed
  
  if (xf86AgpGARTSupported()  !pI810-directRenderingEnabled
  pI810-GttBound) {
  
  to
  
  if (xf86AgpGARTSupported()  pI810-GttBound) {
  
  and it still produces the same error when I launch a second X server. 
  
  (WW) xf86AcquireGART: AGPIOC_ACQUIRE failed (Device or resource busy)
  (EE) GARTInit: AGPIOC_INFO failed (Invalid argument)
  (EE) I810(0): AGP GART support is not available.  Make sure your kernel has
  agpgart support or that the agpgart kernel module is loaded.
  
  Any suggestions on how to proceed?
  

This is not so easy to fix. 

Only when used *without* DRI I810UnbindGARTMemory() 
unbinds the GART memory. In this case unbinding
works well, starting a second server is no problem.

With DRI unbinding has to be done thru a different
interface. In this case the drm functions drmAgpUnbind(),
 drmAgpRelease(), drmAcquire() and drmBind() need to take 
care of unbinding/releaseing and reacquiring/rebinding
the AGP memory. 

Hmm, yes, the i810 driver uses those interfaces (and doesn't have any
explicit drmAgpUnbind() calls), but the i830 part doesn't.  Another
alternative might be to have the i810 part work like the i830 part.

The current driver contains no code doing this.

The patch in attachment 1 fixes this. There is one
bug in the agpgart module and another one in agp_unbind()
in the drm kernel driver which prevent a VT switch when
direct rendering is enabled. Attachment 2 has patches.

One last problem remains: 
These patches don't help starting a second Xserver:
This second Xserver hangs in the lock created by the first
one.
The release() in the drm kernel driver tries to obtain a
lock, when __HAVE_RELEASE is set. This lock is however held
by the first Xsever.
Only the i810 and i830 drivers have __HAVE_RELEASE set
therefore other Xservers aren't affected.

That's probably the contention problem I saw with DRI enabled.

I'd be good to get all of this resolved, but it's looking like the level
of changes that might be needed to do it fully are getting beyone what
we should be putting in before 4.3.

David
--
David Dawes
Release Engineer/Architect  The XFree86 Project
www.XFree86.org/~dawes
___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



Re: [XFree86] i810 driver agpgart error

2003-02-11 Thread Egbert Eich
Michael Cardenas writes:
  Unfortunately, I edited i810_memory.c and changed
  
  if (xf86AgpGARTSupported()  !pI810-directRenderingEnabled
  pI810-GttBound) {
  
  to
  
  if (xf86AgpGARTSupported()  pI810-GttBound) {
  
  and it still produces the same error when I launch a second X server. 
  
  (WW) xf86AcquireGART: AGPIOC_ACQUIRE failed (Device or resource busy)
  (EE) GARTInit: AGPIOC_INFO failed (Invalid argument)
  (EE) I810(0): AGP GART support is not available.  Make sure your kernel has
  agpgart support or that the agpgart kernel module is loaded.
  
  Any suggestions on how to proceed?
  

This is not so easy to fix. 

Only when used *without* DRI I810UnbindGARTMemory() 
unbinds the GART memory. In this case unbinding
works well, starting a second server is no problem.

With DRI unbinding has to be done thru a different
interface. In this case the drm functions drmAgpUnbind(),
 drmAgpRelease(), drmAcquire() and drmBind() need to take 
care of unbinding/releaseing and reacquiring/rebinding
the AGP memory. 
The current driver contains no code doing this.

The patch in attachment 1 fixes this. There is one
bug in the agpgart module and another one in agp_unbind()
in the drm kernel driver which prevent a VT switch when
direct rendering is enabled. Attachment 2 has patches.

One last problem remains: 
These patches don't help starting a second Xserver:
This second Xserver hangs in the lock created by the first
one.
The release() in the drm kernel driver tries to obtain a
lock, when __HAVE_RELEASE is set. This lock is however held
by the first Xsever.
Only the i810 and i830 drivers have __HAVE_RELEASE set
therefore other Xservers aren't affected.

I've added Keith Whitwell, the original author of the i810 driver,
to Cc. Maybe he can help me to find out how to fix this.


Egbert.




diff.i810_vtswitch
Description: Binary data


diff.i810_vtswitch_kernel
Description: Binary data


Re: [XFree86] i810 driver agpgart error

2003-02-10 Thread Michael Cardenas
Unfortunately, I edited i810_memory.c and changed

if (xf86AgpGARTSupported()  !pI810-directRenderingEnabled
pI810-GttBound) {

to

if (xf86AgpGARTSupported()  pI810-GttBound) {

and it still produces the same error when I launch a second X server. 

(WW) xf86AcquireGART: AGPIOC_ACQUIRE failed (Device or resource busy)
(EE) GARTInit: AGPIOC_INFO failed (Invalid argument)
(EE) I810(0): AGP GART support is not available.  Make sure your kernel has
agpgart support or that the agpgart kernel module is loaded.

Any suggestions on how to proceed?


-- 
michael cardenas   | lead software engineer, lindows.com
hyperpoem.net  | GNU/Linux software developer
people.debian.org/~mbc | encrypted email preferred

May you live all the days of your life.
- Johnathan Swift



msg01910/pgp0.pgp
Description: PGP signature


Re: [XFree86] i810 driver agpgart error

2003-02-08 Thread Michael Cardenas
Thanks alot for the feedback guys. 

I'll go ahead and try David's patch and see if it works. 

The hardware in question is an intel i810e, pci id 7125. 

-- 
michael cardenas   | lead software engineer, lindows.com
hyperpoem.net  | GNU/Linux software developer
people.debian.org/~mbc | encrypted email preferred

Sit
 Rest
 Work.
 Alone with yourself,
 Never weary.
 On the edge of the forest
 Live joyfully,
 Without desire.
- The Buddha



msg01820/pgp0.pgp
Description: PGP signature


DRI memory management (was Re: [XFree86] i810 driver agpgart error)

2003-02-08 Thread Ian Romanick
David Dawes wrote:


I think that's a little different from what is being discussed here.
I think it'd be good to make the reinit work you did more general (work
for all drivers), as well as make it possible for the DRI to adapt to
changes in video memory usage on the fly.  Is your reinit patch in the
DRI trunk yet?


What do you mean by adapt to changes in video memory usage?  Do you 
mean re-sizing the memory usage of the framebuffer?  If so, that's one 
of the tangental goals of the next phase of memory management work that 
is just starting.  Initially we plan to only use the new memory manager 
for textures (like the current memory manager), vertex buffer, 
back-buffers, and depth-buffers...basically all of the different types 
of OpenGL buffers.  Adding support for general X usage (front buffer, 
pixmaps, etc.) would be a follow-on effort.

I'm not really expecting this to be ready in time for 4.4.0, but maybe. :)

___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86


[XFree86] i810 driver agpgart error

2003-02-07 Thread Michael Cardenas
Hello all. 

I'm implementing a resolution test in our display control panel, which
basically starts a second X server on another terminal with the
desired resolution. 

This seems to work with some cards, but on the intel i810, I get the
following error:

--

(--) I810(0): Linear framebuffer at 0x4400
(--) I810(0): IO registers at addr 0x4020
(WW) xf86AcquireGART: AGPIOC_ACQUIRE failed (Device or resource busy)
(EE) GARTInit: AGPIOC_INFO failed (Invalid argument)
(EE) I810(0): AGP GART support is not available.  Make sure your kernel has
agpgart support or that the agpgart kernel module is loaded.
(II) UnloadModule: i810
(II) UnloadModule: ddc
(II) UnloadModule: int10
(II) UnloadModule: vbe
(II) UnloadModule: vgahw
(II) Unloading /usr/X11R6/lib/modules/libvgahw.a
(EE) Screen(s) found, but none have a usable configuration.

Fatal server error:
no screens found

-

I find that I can launch two X servers if I disable acceleration in
both with the NoAccel option, but that's lame. 

Does anyone know of a fix for this? We're using the 2.4.20 kernel and
Xfree86 4.2.1-3 from debian. 

thank you

  cardenas

-- 
michael cardenas   | lead software engineer, lindows.com
hyperpoem.net  | GNU/Linux software developer
people.debian.org/~mbc | encrypted email preferred

Are you seeking to know what is wrong with the world? All the
disasters that have wrecked your world, came from your leaders'
attempt to avoid the fact that A is A.
- Ayn Rand, Atlas Shrugged



msg01772/pgp0.pgp
Description: PGP signature


Re: [XFree86] i810 driver agpgart error

2003-02-07 Thread David Dawes
On Fri, Feb 07, 2003 at 05:33:09PM -0800, Michael Cardenas wrote:
Hello all. 

I'm implementing a resolution test in our display control panel, which
basically starts a second X server on another terminal with the
desired resolution. 

This seems to work with some cards, but on the intel i810, I get the
following error:

What hardare are you using?  I just checked and noticed that the
agpgart isn't being released when switching away for the 830M and
later.  Adding that allows a second X server to be started.  If
DRI is enabled, I notice some contention there when starting the
second server, so that's something else to watch out for.

If you're using an 830M or later, try this patch.  The code for the
810/815 already has this.

Index: i830_memory.c
===
RCS file: /home/x-cvs/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c,v
retrieving revision 1.5
diff -u -r1.5 i830_memory.c
--- i830_memory.c   2002/12/10 01:27:05 1.5
+++ i830_memory.c   2003/02/08 02:13:15
@@ -1429,6 +1429,9 @@
return FALSE;
   }
 #endif
+  if (!xf86ReleaseGART(pScrn-scrnIndex))
+return FALSE;
+
   pI830-GttBound = 0;
}
 

David
--
David Dawes
Release Engineer/Architect  The XFree86 Project
www.XFree86.org/~dawes
___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



Re: [XFree86] i810 driver agpgart error

2003-02-07 Thread Michel Dänzer
On Sam, 2003-02-08 at 03:40, David Dawes wrote:
 On Fri, Feb 07, 2003 at 09:24:21PM -0500, David Dawes wrote:
 On Fri, Feb 07, 2003 at 05:33:09PM -0800, Michael Cardenas wrote:
 
 I'm implementing a resolution test in our display control panel, which
 basically starts a second X server on another terminal with the
 desired resolution. 
 
 This seems to work with some cards, but on the intel i810, I get the
 following error:
 
 What hardare are you using?  I just checked and noticed that the
 agpgart isn't being released when switching away for the 830M and
 later.  Adding that allows a second X server to be started.  If
 DRI is enabled, I notice some contention there when starting the
 second server, so that's something else to watch out for.
 
 If you're using an 830M or later, try this patch.  The code for the
 810/815 already has this.
 
 I had another look, and for the 810/815 it doesn't do this when
 DRI is enabled.  I'm not sure why not.  Nothing should be referencing
 those mappings when the X server is switched away, so it should be safe
 to unbind them.

If a DRI client is running while you switch away, it will use these
mappings (if the i8xx drivers are anything like the radeon drivers).
De-initializing the DRI if possible when switching away and
re-initializing it when switching back is what the infamous reinit patch
for the radeon driver does.


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

___
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86