From: Tom Flynn (flynnt++at++acm.org)
Date: 12/01/2005 17:43:59
On 12/1/05, John Kelso <kelso++at++nist.gov> wrote:
>
> Hi,
>
> Thanks for chiming in Allan!
>
> So it looks like I can maybe use the getinvent() call on our SGIs, and
> Amir's code on our Prisms?
If you have the situation Allan describes in case (a), it'd probably be
better to go with ScreenCount(). It's driver independent at least. If you
really have case (b), then it's a bit more complicated and system/driver
dependent...
Amir's code basically looks at how many files named card* are in /dev/dri.
>
> On our four pipe Prism:
> >file /dev/dri/*
> /dev/dri/card0: character special (226/0)
> /dev/dri/card1: character special (226/1)
> /dev/dri/card2: character special (226/2)
> /dev/dri/card3: character special (226/3)
<snip>
I notice my Linux laptop also has a /dev/dri directory:
<snip>
I don't know how the drivers on the Prism work (I'll leave that for someone
at SGI to describe), but that wouldn't be a good approach on any other linux
system. If you simply want to know how many cards exist, you could check
the output of lspci or cat /proc/pci and look for "vga compatable
controllers". (or you could write some code to open up the busses in
/proc/bus/pci/ and check for vga devices on each bus).
Of course, that still doesn't tell you how many channels are on each card.
I suppose you could then do a ScreenCount() for each X server (assuming one
per card) to get that info.
hope that helps,
tom
p.s. __mips__ is defined by the compiler.
This archive was generated by hypermail 2b29 : Thu Dec 01 2005 - 17:44:04 PST