Re: [AGPGART] Map the graphic card to the bridge its connected to.

2005-03-10 Thread Benjamin Herrenschmidt
On Fri, 2005-03-11 at 10:02 +1100, Benjamin Herrenschmidt wrote:
> On Wed, 2005-02-23 at 02:25 +, Linux Kernel Mailing List wrote:
> > ChangeSet 1.1982.82.19, 2005/02/22 21:25:33-05:00, [EMAIL PROTECTED]
> > 
> >     [AGPGART] Map the graphic card to the bridge its connected to.
> > 
> > Signed-off-by: Dave Jones <[EMAIL PROTECTED]>

Note that the effect of reverting the patch gets a broken result too
(btw... the code had a spurrious pci_dev_put() too ...)

Anyway, paulus is working on a solution that should be good enough for
both cases where the AGP bridge is a sibling of the device, and where
the bridge is a parent of the device. Patch soon...

Ben.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [AGPGART] Map the graphic card to the bridge its connected to.

2005-03-10 Thread Benjamin Herrenschmidt
On Wed, 2005-02-23 at 02:25 +, Linux Kernel Mailing List wrote:
> ChangeSet 1.1982.82.19, 2005/02/22 21:25:33-05:00, [EMAIL PROTECTED]
> 
>   [AGPGART] Map the graphic card to the bridge its connected to.
>   
>   Signed-off-by: Dave Jones <[EMAIL PROTECTED]>
> 
> 
> 
>  generic.c |5 +
>  1 files changed, 5 insertions(+)
> 
> 
> diff -Nru a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
> --- a/drivers/char/agp/generic.c  2005-03-06 18:22:31 -08:00
> +++ b/drivers/char/agp/generic.c  2005-03-06 18:22:31 -08:00
> @@ -636,6 +636,11 @@
>   pci_dev_put(device);
>   continue;
>   }
> + if ((device->bus->self->vendor != bridge->dev->vendor) &&
> + (device->bus->self->device != bridge->dev->device)) {
> + pci_dev_put(device);
> + continue;
> + }
>   }
>  

That sounds totally bogus and blows up on pmac, please revert.

device->bus may be a host bridge, which has no bus->self -> Ooops.

Unfortunately, there is no sane way to match a host bridge with it's
eventual "self" device if it has any. The only way would be to scan for
devices of class host bridge, but that isn't even 100% reliable.

The result is that the self device (AGP bridge device) is generally a
sibling of the actual AGP card, which is source of interesting problems,
especially with power management.

Ideally, the AGP property should be implemented at the "bus instance"
level, but we don't really have a real pci bus driver layer at this
point, and we can't use normal PCI discovery to find host bridges, so
that would require arch support.

In the meantime, please revert the above, it will just blow up on a
number of setups.

Ben.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [AGPGART] Map the graphic card to the bridge its connected to.

2005-03-10 Thread Benjamin Herrenschmidt
On Wed, 2005-02-23 at 02:25 +, Linux Kernel Mailing List wrote:
 ChangeSet 1.1982.82.19, 2005/02/22 21:25:33-05:00, [EMAIL PROTECTED]
 
   [AGPGART] Map the graphic card to the bridge its connected to.
   
   Signed-off-by: Dave Jones [EMAIL PROTECTED]
 
 
 
  generic.c |5 +
  1 files changed, 5 insertions(+)
 
 
 diff -Nru a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
 --- a/drivers/char/agp/generic.c  2005-03-06 18:22:31 -08:00
 +++ b/drivers/char/agp/generic.c  2005-03-06 18:22:31 -08:00
 @@ -636,6 +636,11 @@
   pci_dev_put(device);
   continue;
   }
 + if ((device-bus-self-vendor != bridge-dev-vendor) 
 + (device-bus-self-device != bridge-dev-device)) {
 + pci_dev_put(device);
 + continue;
 + }
   }
  

That sounds totally bogus and blows up on pmac, please revert.

device-bus may be a host bridge, which has no bus-self - Ooops.

Unfortunately, there is no sane way to match a host bridge with it's
eventual self device if it has any. The only way would be to scan for
devices of class host bridge, but that isn't even 100% reliable.

The result is that the self device (AGP bridge device) is generally a
sibling of the actual AGP card, which is source of interesting problems,
especially with power management.

Ideally, the AGP property should be implemented at the bus instance
level, but we don't really have a real pci bus driver layer at this
point, and we can't use normal PCI discovery to find host bridges, so
that would require arch support.

In the meantime, please revert the above, it will just blow up on a
number of setups.

Ben.


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [AGPGART] Map the graphic card to the bridge its connected to.

2005-03-10 Thread Benjamin Herrenschmidt
On Fri, 2005-03-11 at 10:02 +1100, Benjamin Herrenschmidt wrote:
 On Wed, 2005-02-23 at 02:25 +, Linux Kernel Mailing List wrote:
  ChangeSet 1.1982.82.19, 2005/02/22 21:25:33-05:00, [EMAIL PROTECTED]
  
  [AGPGART] Map the graphic card to the bridge its connected to.
  
  Signed-off-by: Dave Jones [EMAIL PROTECTED]

Note that the effect of reverting the patch gets a broken result too
(btw... the code had a spurrious pci_dev_put() too ...)

Anyway, paulus is working on a solution that should be good enough for
both cases where the AGP bridge is a sibling of the device, and where
the bridge is a parent of the device. Patch soon...

Ben.


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/