From owner-freebsd-current@FreeBSD.ORG Tue Oct 21 16:02:58 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B5C016A4B3; Tue, 21 Oct 2003 16:02:58 -0700 (PDT) Received: from lewis.lclark.edu (lclark.edu [149.175.1.5]) by mx1.FreeBSD.org (Postfix) with SMTP id 20F8843F75; Tue, 21 Oct 2003 16:02:57 -0700 (PDT) (envelope-from eta@lclark.edu) Received: from [149.175.34.27] ([149.175.34.27]) by lewis.lclark.edu (SAVSMTP 3.1.1.32) with SMTP id M2003102116025628038 ; Tue, 21 Oct 2003 16:02:56 -0700 From: Eric Anholt To: Scott Long In-Reply-To: <3F95B656.50102@freebsd.org> References: <1066772724.646.62.camel@leguin> <3F95B656.50102@freebsd.org> Content-Type: text/plain Message-Id: <1066777375.646.101.camel@leguin> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 21 Oct 2003 16:02:55 -0700 Content-Transfer-Encoding: 7bit cc: current@freebsd.org Subject: Re: PCI domains? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2003 23:02:58 -0000 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