Re: AW: xorg hardware detection - please test

2006-07-13 Thread Jurij Smakov

On Fri, 14 Jul 2006, Jurzitza, Dieter wrote:


Hi folks,
just a (maybe ...) dumb question: prtconf returns SUNW,XXX- for the 
Elite 3D; is that a bug in the Elite-bios? Just wondering because I 
played with video_detect --full  The Creator in my other U60 gives 
me two numbers: 501-4788 here.

Take care


Yes, this is a really dumb setting in PROM, it is present in 'prtconf -p 
-v' output.


Best regards,

Jurij Smakov[EMAIL PROTECTED]
Key: http://www.wooyd.org/pgpkey/   KeyID: C99E03CC


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



AW: xorg hardware detection - please test

2006-07-13 Thread Jurzitza, Dieter
Hi folks,
just a (maybe ...) dumb question: prtconf returns SUNW,XXX- for the Elite 
3D; is that a bug in the Elite-bios? Just wondering because I played with 
video_detect --full  The Creator in my other U60 gives me two numbers: 
501-4788 here.
Take care



Dieter Jurzitza


-- 


HARMAN BECKER AUTOMOTIVE SYSTEMS

Dr.-Ing. Dieter Jurzitza
Manager Hardware Systems
   System Development

Industriegebiet Ittersbach
Becker-Göring Str. 16
D-76307 Karlsbad / Germany

Phone: +49 (0)7248 71-1577
Fax:   +49 (0)7248 71-1216
eMail: [EMAIL PROTECTED]
Internet: http://www.becker.de
 

> -Ursprüngliche Nachricht-
> Von: Jurij Smakov [mailto:[EMAIL PROTECTED] 
> Gesendet: Samstag, 8. Juli 2006 19:43
> An: Steve Pacenka
> Cc: debian-sparc@lists.debian.org
> Betreff: Re: xorg hardware detection - please test
> 
> 
> On Sat, 8 Jul 2006, Steve Pacenka wrote:
> 
> > sunffb is the correct xorg driver for Elite 3D and Creator 3D.
***


***
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte 
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail 
irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und 
loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe 
dieser Mail ist nicht gestattet.
 
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and delete this e-mail. Any unauthorized copying, 
disclosure or distribution of the contents in this e-mail is strictly forbidden.
***



Re: AW: xorg hardware detection - please test

2006-07-11 Thread Dirk Dettmann
Hello,


Am Dienstag, 11. Juli 2006 07:20 schrieb Jurzitza, Dieter:
> ... I definitively need afbinit on the cards, otherwise ...  

I agree!

Best regards
Dirk

-- 
--
Dirk Dettmann   +49 52 01 73 44 30
Bussardstr. 2   [EMAIL PROTECTED]
D-33790 Halle/Westfalen www.itdd.de
--


pgpb2V5hy3KZ6.pgp
Description: PGP signature


AW: xorg hardware detection - please test

2006-07-10 Thread Jurzitza, Dieter
Hi folks,
sorry, haven't been in office yesterday. I definitively need afbinit on the 
cards, otherwise things do not work. In very old releases of X (like the one 
that came with SuSE 7.3) the sunffb works without afbinit, but is very slow. In 
current releases of X (what comes with Debian) I get no X without afbinit.
Therefore, from my standpoint, afbinit is mandatory.
Sorry for the delay,
take care



Dieter


-- 


HARMAN BECKER AUTOMOTIVE SYSTEMS

Dr.-Ing. Dieter Jurzitza
Manager Hardware Systems
   System Development

Industriegebiet Ittersbach
Becker-Göring Str. 16
D-76307 Karlsbad / Germany

Phone: +49 (0)7248 71-1577
Fax:   +49 (0)7248 71-1216
eMail: [EMAIL PROTECTED]
Internet: http://www.becker.de
 

> -Ursprüngliche Nachricht-
> Von: Jurij Smakov [mailto:[EMAIL PROTECTED] 
> Gesendet: Samstag, 8. Juli 2006 07:31
> An: Dirk Dettmann
> Cc: Jurzitza, Dieter; debian-sparc@lists.debian.org



***
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte 
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail 
irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und 
loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe 
dieser Mail ist nicht gestattet.
 
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and delete this e-mail. Any unauthorized copying, 
disclosure or distribution of the contents in this e-mail is strictly forbidden.
***



Re: xorg hardware detection - please test

2006-07-08 Thread Steve Pacenka
On Saturday 08 July 2006 13:42, Jurij Smakov wrote:

> > One of my U60's has an afb (creator) and ffb (elite).
>
> Is it a typo? I believe other people have said that afb (SUNW,afb) is
> actually the Elite 3D card.

You're correct, sorry.  afb is Elite, ffb, is Creator.  Both use the sunffb 
xorg driver.

I have a 501-4788 which is a Creator 3D FFB2+, listed in prtconf 
as "SUNW,ffb" .


> > Empirical answers for two U60's:
> >
> >dual head, one of each card, kernel 2.6.16-1-sparc64-smp, xorg 6.9:
> > okay
>
> Cool. Could you send me the xorg.conf file for this configuration?

In case anyone else is intererested:

  http://wri.cfe.cornell.edu/sparc/u60dualhead-xorg69-xorg.conf
  http://wri.cfe.cornell.edu/sparc/u60dualhead-xorg69-Xorg.0.log

>
> >(afbinit hard-locked with 2.6.17-1-sparc64-smp, needed a power
> > cycle)
>
> Could you please file a bug and try to debug it? At least roughly, which
> call causes it to hang? You are using the latest afbinit (1.0-1.1), right?

I don't really have the experience to debug hard locks.  There were no 
messages to console, just a freeze with a dead keyboard (not even Stop-A 
would work).

The afbinit installed now is 1.0-1.1; this lockup was a few weeks ago.

-- SP


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: xorg hardware detection - please test

2006-07-08 Thread Jurij Smakov

On Sat, 8 Jul 2006, Steve Pacenka wrote:


sunffb is the correct xorg driver for Elite 3D and Creator 3D.

afbinit is necessary for Elite 3D but not for Creator 3D.


Thanks for the information. I'm a bit confused about the names though. In 
your previous message you write



One of my U60's has an afb (creator) and ffb (elite).


Is it a typo? I believe other people have said that afb (SUNW,afb) is 
actually the Elite 3D card.



Empirical answers for two U60's:

   dual head, one of each card, kernel 2.6.16-1-sparc64-smp, xorg 6.9: okay


Cool. Could you send me the xorg.conf file for this configuration?


   (afbinit hard-locked with 2.6.17-1-sparc64-smp, needed a power cycle)


Could you please file a bug and try to debug it? At least roughly, which 
call causes it to hang? You are using the latest afbinit (1.0-1.1), right?



   single head, elite 3d, kernel 2.6.16-1-sparc64-smp, xorg 7.0: okay


Thanks,

Jurij Smakov[EMAIL PROTECTED]
Key: http://www.wooyd.org/pgpkey/   KeyID: C99E03CC


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: xorg hardware detection - please test

2006-07-08 Thread Frans Pop
On Saturday 08 July 2006 17:53, Steve Pacenka wrote:
> Does prtconf need /proc/openprom to be mounted, and are that mount and
> the sparc-utils package available during installation?

The relevant XOrg package will need to recommend sparc-utils for sparc. 
Also, debian-installer's pkgsel will need to make sure sparc-utils is 
installed in /target if the desktop task is selected (it currently does 
the same for other hardware detection packages).


pgpRTVtbcE8iY.pgp
Description: PGP signature


Re: xorg hardware detection - please test

2006-07-08 Thread Steve Pacenka
On Friday 07 July 2006 02:45, Jurij Smakov wrote:
> Hi,
>
> I've hacked together a script (attached) which parses prtconf output and
> outputs the name of corresponding xorg driver. I've only included the
> information which I could find on my own machines and prtconf examples.
> Please test it on your box (you'll need prtconf from sparc-utils and awk).
> If you will get no output (which means that the script failed to detect
> any cards) or 'unknown' (found a card, but failed to map it to the
> driver), please submit output of prtconf -p -v on your machine as well as
> information about which xorg driver is appropriate for it.

Thanks for your work on this.

The script works okay on an Ultra 10, detecting onboard ati.

One of my U60's has an afb (creator) and ffb (elite).  The script 
reported "unknown" since the afb is earlier in the node list and there was no 
clause for SUNW,afb.

To detect Creator 3D video and cg14 (SX framebuffer), add

   "SUNW,afb" ) driver='sunffb' ;;
   "SUNW,sx" ) driver='suncg14' ;;

to the case statement near the end.

Running the script triggers a watchdog reset on my SS20, so I could not verify 
correct operation.  (Probably a hardware or kernel problem.)

Does prtconf need /proc/openprom to be mounted, and are that mount and the 
sparc-utils package available during installation?


Kernels 2.6 will not require prtconf.

U60:
   /sys/class/graphics/fb0/name = "Creator 3D"
   /sys/class/graphics/fb1/name = "Elite 3D"

U10:
  /sys/class/graphics/fb0/name = "ATY Mach64"


> I would also appreciate information about which keyboard settings are
> appropriate for what keyboart types, so that we can implement it properly.

I have only type5's, and they require an xorg pc105 map with Kernels 2.6.

-- SP


>
> Best regards,
>
> Jurij Smakov[EMAIL PROTECTED]
> Key: http://www.wooyd.org/pgpkey/   KeyID: C99E03CC


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: xorg hardware detection - please test

2006-07-08 Thread Steve Pacenka
On Saturday 08 July 2006 01:31, Jurij Smakov wrote:
> On Fri, 7 Jul 2006, Dirk Dettmann wrote:
> > Am Freitag, 7. Juli 2006 08:45 schrieb Jurij Smakov:
> >
> > Hi Jurij,
> >
> >> I've hacked together a script (attached) which parses prtconf
> >> output and outputs the name of corresponding xorg driver
> >
> > you should include SUNW,afb for the "Elite 3D" in your script.
>
> Hi Dirk and Dieter,
>
> It looks like both of you have the Elite 3D cards. The correct driver, I
> believe, is sunffb. What I'm not sure about is whether one needs to use
> afbinit to initialize the cards. Does it work with recent kernels? Can you
> run xorg successfully on these cards?

sunffb is the correct xorg driver for Elite 3D and Creator 3D.

afbinit is necessary for Elite 3D but not for Creator 3D.

Empirical answers for two U60's:

dual head, one of each card, kernel 2.6.16-1-sparc64-smp, xorg 6.9: okay
(afbinit hard-locked with 2.6.17-1-sparc64-smp, needed a power cycle)

single head, elite 3d, kernel 2.6.16-1-sparc64-smp, xorg 7.0: okay

-- SP


>
> Best regards,
>
> Jurij Smakov[EMAIL PROTECTED]
> Key: http://www.wooyd.org/pgpkey/   KeyID: C99E03CC


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: xorg hardware detection - please test

2006-07-07 Thread Frans Pop
On Saturday 08 July 2006 07:41, Jurij Smakov wrote:
> On Fri, 7 Jul 2006, Frans Pop wrote:
> > When this is integrated into XOrg configuration, we'll have to
> > consider how to deal with the situation where a box contains both a
> > video card detected by this method and a regular PCI video card.
>
> The ATI cards in Ultra5 are PCI, and they are found by video_detect
> just fine. Are there known situations when one can use the card with
> xorg but it does not show up in the prom tree?

What I was thinking of is the situation with my U10. When I got it, it had 
both a Creator 3D card and the ATI card. I pulled out the Creator 3D card 
because I don't have a monitor for it, but what would happen if both are 
present? I would expect your new script to detect the 3D and the regular 
detection to detect the ATI...


pgpDBEgAdNX9F.pgp
Description: PGP signature


Re: xorg hardware detection - please test

2006-07-07 Thread Jurij Smakov

On Fri, 7 Jul 2006, Frans Pop wrote:


On Friday 07 July 2006 08:45, Jurij Smakov wrote:

I've hacked together a script (attached) which parses prtconf output
and outputs the name of corresponding xorg driver.


When this is integrated into XOrg configuration, we'll have to consider
how to deal with the situation where a box contains both a video card
detected by this method and a regular PCI video card.


The ATI cards in Ultra5 are PCI, and they are found by video_detect just 
fine. Are there known situations when one can use the card with xorg but 
it does not show up in the prom tree?


Best regards,

Jurij Smakov[EMAIL PROTECTED]
Key: http://www.wooyd.org/pgpkey/   KeyID: C99E03CC


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: xorg hardware detection - please test

2006-07-07 Thread Jurij Smakov

On Fri, 7 Jul 2006, Dirk Dettmann wrote:


Am Freitag, 7. Juli 2006 08:45 schrieb Jurij Smakov:

Hi Jurij,


I've hacked together a script (attached) which parses prtconf
output and outputs the name of corresponding xorg driver


you should include SUNW,afb for the "Elite 3D" in your script.


Hi Dirk and Dieter,

It looks like both of you have the Elite 3D cards. The correct driver, I 
believe, is sunffb. What I'm not sure about is whether one needs to use 
afbinit to initialize the cards. Does it work with recent kernels? Can you 
run xorg successfully on these cards?


Best regards,

Jurij Smakov[EMAIL PROTECTED]
Key: http://www.wooyd.org/pgpkey/   KeyID: C99E03CC


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: xorg hardware detection - please test

2006-07-07 Thread Jurij Smakov

On Fri, 7 Jul 2006, Hendrik Sattler wrote:


This difference messes up display the display (wrong colors), so I only have
one inserted.
So maybe you don't need prtconf but choose dependent on the current kernel
framebuffer?


I did not really consider situations when there are two cards in one box.
Will try to have a look whether such situations are handled by the config
generator in any consistent way.


BTW: Is there a way to change the framebuffer choice in OB?


I think the console is whatever you set the 'screen' alias to. You 
probably can change it using 'show-displays' command.


Best regards,

Jurij Smakov[EMAIL PROTECTED]
Key: http://www.wooyd.org/pgpkey/   KeyID: C99E03CC


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: xorg hardware detection - please test

2006-07-07 Thread Hendrik Sattler
Am Freitag, 7. Juli 2006 16:10 schrieb Frans Pop:
> On Friday 07 July 2006 08:45, Jurij Smakov wrote:
> > I've hacked together a script (attached) which parses prtconf output
> > and outputs the name of corresponding xorg driver.
>
> When this is integrated into XOrg configuration, we'll have to consider
> how to deal with the situation where a box contains both a video card
> detected by this method and a regular PCI video card.

This is already decided by the kernel on the choice of the used framebuffer 
console and not necessarily correct (means: differs from openboot).
OpenBoot on the U60 will choose the Creator3D if present, else the PCI card. 
Kernel uses framebuffer on the PCI card.

This difference messes up display the display (wrong colors), so I only have 
one inserted.
So maybe you don't need prtconf but choose dependent on the current kernel 
framebuffer?

BTW: Is there a way to change the framebuffer choice in OB?

HS


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: xorg hardware detection - please test

2006-07-07 Thread Frans Pop
On Friday 07 July 2006 08:45, Jurij Smakov wrote:
> I've hacked together a script (attached) which parses prtconf output
> and outputs the name of corresponding xorg driver.

When this is integrated into XOrg configuration, we'll have to consider 
how to deal with the situation where a box contains both a video card 
detected by this method and a regular PCI video card.


pgpveZ3GXQZfX.pgp
Description: PGP signature


Re: xorg hardware detection - please test

2006-07-07 Thread Dirk Dettmann
Am Freitag, 7. Juli 2006 08:45 schrieb Jurij Smakov:

Hi Jurij,

> I've hacked together a script (attached) which parses prtconf
> output and outputs the name of corresponding xorg driver

you should include SUNW,afb for the "Elite 3D" in your script.

Best regards
Dirk
-- 
--
Dirk Dettmann   +49 52 01 73 44 30
Bussardstr. 2   [EMAIL PROTECTED]
D-33790 Halle/Westfalen www.itdd.de
--


pgpZ10XjdWsdF.pgp
Description: PGP signature


Re: xorg hardware detection - please test

2006-07-07 Thread Martin Marques

On Thu, 6 Jul 2006 23:45:48 -0700 (PDT), Jurij Smakov <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I've hacked together a script (attached) which parses prtconf output and
> outputs the name of corresponding xorg driver. I've only included the
> information which I could find on my own machines and prtconf examples.
> Please test it on your box (you'll need prtconf from sparc-utils and awk).
> If you will get no output (which means that the script failed to detect
> any cards) or 'unknown' (found a card, but failed to map it to the
> driver), please submit output of prtconf -p -v on your machine as well as
> information about which xorg driver is appropriate for it.
> 
> I would also appreciate information about which keyboard settings are
> appropriate for what keyboart types, so that we can implement it properly.

bugs:~# ./video_detect
ati
bugs:~# uname -a
Linux bugs 2.4.27-3-sparc64 #1 Fri Jun 2 07:35:41 UTC 2006 sparc64 GNU/Linux
bugs:~# lspci
00:00.0 Host bridge: Sun Microsystems Computer Corp. Ultra IIi
00:01.0 PCI bridge: Sun Microsystems Computer Corp. Simba Advanced PCI Bridge 
(rev 13)
00:01.1 PCI bridge: Sun Microsystems Computer Corp. Simba Advanced PCI Bridge 
(rev 13)
01:01.0 Bridge: Sun Microsystems Computer Corp. EBUS (rev 01)
01:01.1 Ethernet controller: Sun Microsystems Computer Corp. Happy Meal (rev 01)
01:02.0 VGA compatible controller: ATI Technologies Inc 3D Rage Pro 215GP (rev 
5c)
01:03.0 IDE interface: Silicon Image, Inc. PCI0646 (rev 03)
02:03.0 SCSI storage controller: LSI Logic / Symbios Logic 53c875 (rev 04)


--
-
Lic. Martín Marqués |   SELECT 'mmarques' || 
Centro de Telemática|   '@' || 'unl.edu.ar';
Universidad Nacional|   DBA, Programador, 
del Litoral |   Administrador
-



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



AW: xorg hardware detection - please test

2006-07-07 Thread Jurzitza, Dieter
Hi,
this would be a patch if I got it right!
Take care



Dieter Jurzitza


-- 


HARMAN BECKER AUTOMOTIVE SYSTEMS

Dr.-Ing. Dieter Jurzitza
Manager Hardware Systems
   System Development

Industriegebiet Ittersbach
Becker-Göring Str. 16
D-76307 Karlsbad / Germany

Phone: +49 (0)7248 71-1577
Fax:   +49 (0)7248 71-1216
eMail: [EMAIL PROTECTED]
Internet: http://www.becker.de
 

> -Ursprüngliche Nachricht-
> Von: Jurij Smakov [mailto:[EMAIL PROTECTED] 
> Gesendet: Freitag, 7. Juli 2006 08:46
> An: debian-sparc@lists.debian.org
> Betreff: xorg hardware detection - please test
> 
> 
> Hi,
> 
> I've hacked together a script (attached) which parses prtconf 
> output and 
> outputs the name of corresponding xorg driver. I've only included the 
*


***
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte 
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail 
irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und 
loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe 
dieser Mail ist nicht gestattet.
 
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and delete this e-mail. Any unauthorized copying, 
disclosure or distribution of the contents in this e-mail is strictly forbidden.
***



video_detect.patch
Description: video_detect.patch


AW: xorg hardware detection - please test

2006-07-07 Thread Jurzitza, Dieter
Hi Juri,
hi folks,
my 2 cent here:
1.) U60 SMP, Creator 3d, vide_detect returns "sunffb",
2.) U60 SMP, SUN Elite 3d, video_detect returns "unknown".

"out" is the output of prtconf -p -v as requested - from the second machine.
Take care



Dieter Jurzitza


-- 


HARMAN BECKER AUTOMOTIVE SYSTEMS

Dr.-Ing. Dieter Jurzitza
Manager Hardware Systems
   System Development

Industriegebiet Ittersbach
Becker-Göring Str. 16
D-76307 Karlsbad / Germany

Phone: +49 (0)7248 71-1577
Fax:   +49 (0)7248 71-1216
eMail: [EMAIL PROTECTED]
Internet: http://www.becker.de
 

> -Ursprüngliche Nachricht-
> Von: Jurij Smakov [mailto:[EMAIL PROTECTED] 
> Gesendet: Freitag, 7. Juli 2006 08:46
> An: debian-sparc@lists.debian.org
> Betreff: xorg hardware detection - please test
> 
> 
> Hi,
> 
> I've hacked together a script (attached) which parses prtconf 
> output and 



***
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte 
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail 
irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und 
loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe 
dieser Mail ist nicht gestattet.
 
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and delete this e-mail. Any unauthorized copying, 
disclosure or distribution of the contents in this e-mail is strictly forbidden.
***



out
Description: out


xorg hardware detection - please test

2006-07-06 Thread Jurij Smakov

Hi,

I've hacked together a script (attached) which parses prtconf output and 
outputs the name of corresponding xorg driver. I've only included the 
information which I could find on my own machines and prtconf examples.

Please test it on your box (you'll need prtconf from sparc-utils and awk).
If you will get no output (which means that the script failed to detect
any cards) or 'unknown' (found a card, but failed to map it to the 
driver), please submit output of prtconf -p -v on your machine as well as

information about which xorg driver is appropriate for it.

I would also appreciate information about which keyboard settings are 
appropriate for what keyboart types, so that we can implement it properly.


Best regards,

Jurij Smakov[EMAIL PROTECTED]
Key: http://www.wooyd.org/pgpkey/   KeyID: C99E03CC#!/bin/sh

pc=$(which prtconf)
if [ -z "${pc}" ]; then
echo "prtconf binary missing (not in path)." >&2
exit 1
fi

#
# Parse prtconf output
# 
result=$(${pc} -p -v | awk '
  BEGIN {
  display_node = 0; 
  model = ""; 
  name = ""; 
  final_model = ""; 
  final_name = ""
  }
  /Node/ {
   if(display_node == 1) {
 final_model = model;
 final_name = name;
 display_node = 0;
   };
   model = "";
   name = ""
  }
  /device_type:/ {
   if(index($2, "display") != 0) {
 display_node = 1
   }
  }
  /model:/ { l=length($2); model = substr($2, 2, l-2) }
  /name:/  { l=length($2); name = substr($2, 2, l-2) }
  END{
   if(display_node == 1) {
 final_model = model; 
 final_name = name
   }; 
   printf "model=\"%s\" name=\"%s\"", final_model, final_name
  }')

eval "${result}"

#
# Match the name and the model to the driver. If name
# is blank, just assume that no displays are found.
#
test -z "${name}" && exit 0
case "${name}" in
"cgsix" ) driver='suncg6' ;;
"SUNW,leo" ) driver='sunleo' ;;
"SUNW,tcx" ) driver='suntcx' ;;
"SUNW,m64B" ) driver='ati' ;;
"SUNW,ffb" ) driver='sunffb' ;;
* ) driver='unknown' ;;
esac

if [ "${1}" = "--full" ]; then
echo "${name} ${model} ${driver}"
else
echo "${driver}"
fi

exit 0