Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Oct 2003 16:02:55 -0700
From:      Eric Anholt <eta@lclark.edu>
To:        Scott Long <scottl@freebsd.org>
Cc:        current@freebsd.org
Subject:   Re: PCI domains?
Message-ID:  <1066777375.646.101.camel@leguin>
In-Reply-To: <3F95B656.50102@freebsd.org>
References:  <1066772724.646.62.camel@leguin>  <3F95B656.50102@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2003-10-21 at 15:42, Scott Long wrote:
> Eric Anholt wrote:
> > Is there any concept of PCI domains in the kernel?
> > 
> > This is for the DRM, while dealing with a complaint from Linus recently:
> > 
> > 
> >>Please fix the fact that modern PCI is _not_ enumerated with just "bus,
> >>slot, function". A lot of machines are starting to have a "domain number", 
> >>which allows fro multiple independent PCI subsystems in the same machine.
> >>
> >>On linux, you can use "pci_name(pdev)" to get a truly unique descriptor of
> >>the device (within the PCI subsystem). It will look something like
> >>
> >>	0000:00:02.0
> >>
> >>for "domain 0, bus 0, device 2, function 0".
> > 
> > 
> > 
> 
> We don't have much of a concept of this (except possibly Alpha like John
> mentioned, but I really cannot comment on that).  Supporting it
> wouldn't be terribly magical on our end until we fix busdma to support
> device-device transfers.  Since I don't know much context on the DRM
> side, what exactly is Linus asking to change, and do we need to worry
> about it?

The DRM historically doesn't attach to specific devices itself.  The X
Server opens a /dev/dri/cardX, sees if it fits its criteria (driver name
matches, no unique value currently set), then sets the "unique."  The
unique is a Bus ID in the form PCI:x:y:z.  This unique is passed through
the XF86DRI protocol to the clients, who iterate over the /dev/dri/cardX
looking for one with that unique when they want to open it.

Because of this whole system, the DRM also doesn't associate with
framebuffer, mmio registers, or other device-specific things by itself
-- it's all done by the X Server through things like the addmap ioctl. 
This makes using bus_space difficult.

I'm working on a change so that the DRM attaches to a specific device,
and thus has the unique set before the X Server gets to it (well, it's
not that way due to backwards compatibility gymnastics, but that's the
goal).  It was prompted by another developer who's working on standalone
DRI, which doesn't use the X Server at all.  When the issue of the
unique came up, Linus said the quote above.

It looks like the "hose" on alpha is equivalent to a domain, from the
linux code.  For now I'm just using a domain of 0 on FreeBSD, but if the
hoses have numbers that match XFree86's scheme, whatever that is, I'll
use that.

-- 
Eric Anholt                                eta@lclark.edu          
http://people.freebsd.org/~anholt/         anholt@FreeBSD.org




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1066777375.646.101.camel>