The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 09-08-2007
robotronic's Avatar
robotronic robotronic is offline
Can I play with madness?
 

Join Date: Apr 2002
Location: Italy
Posts: 370
I think the command you have to run depends on the graphic card you have.
For my workstation, the following command works correctly:

Code:
m64config -res 1024x768x60 now noconfirm nocheck -depth 24
I attach a script I found some time ago, maybe it can help. If you have a look at the various commands inside, you may get a better idea of the configuration tools for each card.

Code:
GraphicsCardTest.sh
-------------------
#!/bin/sh

FBCONFIG=/usr/sbin/fbconfig

cardInfo() {
    needExtraCheck=no
    case "$1" in
    m64* )
        theCardName='Mach 64'
        theCard=m64
        theConfigCommand=/usr/sbin/m64config
        theConfigOption=-prconf
        theConfigKey='Current depth'
        theExpectedValue='24'
        ;;
    ffb* )
        theConfigCommand=/usr/sbin/ffbconfig
        theConfigOption=-propt
        theConfigKey='Default Visual'
        theExpectedValue='Linear Normal Visual'
	if $theConfigCommand $theConfigOption 2>&1 \
		| /usr/bin/grep '^Gamma Correction' > /dev/null 2>&1; then
          theCard=ffb_new
          theCardName='Creator 3D [new type]'
	else
          theCard=ffb_old
          theCardName='Creator 3D [old type]'
          needExtraCheck=yes
	fi
        ;;
    afb* )
        theCardName='Elite 3D'
        theCard=afb
        theConfigCommand=/usr/sbin/afbconfig
        theConfigOption=-propt
        theConfigKey='Default Visual'
        theExpectedValue='Linear Normal Visual'
        ;;
    ifb* )
        theCardName='Expert 3D'
        theCard=ifb
        theConfigCommand=/usr/sbin/fbconfig
        theConfigOption=-propt
        theConfigKey='Default Visual'
        theExpectedValue='Linear Normal Visual'
        ;;
    gfxp* )
        theCardName=PGX32
        theCard=gfxp
        theConfigCommand=/usr/sbin/GFXconfig
        theConfigOption=-prconf
        theConfigKey='Current depth'
        theExpectedValue=24
        ;;
    * )
        theCardName=
        theCard=unknown
        theConfigCommand=
        theConfigOption=
        theConfigKey=
        theExpectedValue=
        ;;
    esac
}

msg_common() {
    echo "$cardNum) The following graphics card is not properly configured for"
    echo "${ind}running GNOME:"
    echo
    echo "${ind}  /dev/fbs/$1		($theCardName)"
    echo
    echo "${ind}The current value of setting \"$theConfigKey\" is $theValue."
    echo "${ind}If you intend running GNOME on this graphics card you need"
    echo "${ind}to change this setting to $theExpectedValue."
    echo
}

msg_extra_common() {
    if [ "x$cardStatus" != xNOT_OK ]; then
	echo "$cardNum) The following graphics card is not properly configured for"
	echo "${ind}running GNOME:"
	echo
	echo "${ind}  /dev/fbs/$1		($theCardName)"
	echo
    fi
}

msg_m64() {
    echo "${ind}Run this command:"
    echo
    echo "${ind}  $theConfigCommand -dev /dev/fbs/$1 -res 1152x900 -depth 24"
    echo
    echo "${ind}This command may fail if your graphics card does not have enough"
    echo "${ind}memory for this resolution.  In that case try using a lower"
    echo "${ind}resolution.  E.g."
    echo
    echo "${ind}  $theConfigCommand -dev /dev/fbs/$1 -res 800x600 -depth 24"
    echo
    echo "${ind}The following command lists all possible resolutions:"
    echo
    echo "${ind}  $theConfigCommand -dev /dev/fbs/$1 -res \\?"
    echo
}

msg_ffb_new() {
    echo "${ind}Run this command:"
    echo
    echo "${ind}  $theConfigCommand -dev /dev/fbs/$1 -deflinear true -g 1.1"
    echo
}

check_ffb_old() {
    IMRC=/opt/gnome-1.4/etc/imrc
    DOTIMRC=$HOME/.imrc
    if [ -f $DOTIMRC ]; then
	if cat $DOTIMRC 2>/dev/null \
		| /usr/bin/tr '\t' ' ' 2>/dev/null \
		| /usr/bin/grep -i '^ *Mit-Shm *off' >/dev/null 2>&1; then
	    return
	elif cat $DOTIMRC 2>/dev/null \
		| /usr/bin/tr '\t' ' ' 2>/dev/null \
		| /usr/bin/grep -i '^ *Mit-Shm *on' >/dev/null 2>&1; then
	    cardExtraStatus=LOCAL_ON
	    return
	fi
    fi
    if [ -f $IMRC ]; then
	if cat $IMRC 2>/dev/null \
		| /usr/bin/tr '\t' ' ' 2>/dev/null \
		| /usr/bin/grep -i '^ *Mit-Shm *on' >/dev/null 2>&1; then
	    cardExtraStatus=GLOBAL_ON
	fi
    fi
}

msg_ffb_old() {
    echo "${ind}Run this command:"
    echo
    echo "${ind}  $theConfigCommand -dev /dev/fbs/$1 -deflinear true"
    echo
}

msg_extra_ffb_old() {
    if [ "x$cardStatus" != xNOT_OK ]; then
	echo "${ind}If you intend running GNOME on this graphics card you need"
	echo "${ind}to turn off the Mit-Shm option of Imlib."
    else
	echo "${ind}You also need to turn off the Mit-Shm option of Imlib."
    fi
    echo
    if [ "x$cardExtraStatus" = xGLOBAL_ON ]; then
	echo "${ind}To turn off this option for all users edit the file"
	echo "${ind}   $IMRC"
	echo "${ind}and change the value of \"Mit-Shm\" to \"off\""
	echo
    fi
    echo "${ind}To turn off Mit-Shm for yourself only"
    echo "${ind}  - go to the \"Settings\" system menu"
    echo "${ind}  - select \"Imlib Configuration Options\""
    echo "${ind}  - open the \"Rendering\" tab"
    echo "${ind}  - uncheck the \"MIT-SHM Shared Memory Enabled\" checkbox"
    echo "${ind}  - click on \"Save User Config\""
    echo "${ind}  - click on \"Close\""
    echo
}

msg_afb() {
    echo "${ind}Run this command:"
    echo
    echo "${ind}  $theConfigCommand -dev /dev/fbs/$1 -deflinear true -g 1.1"
    echo
}

msg_ifb() {
    echo "${ind}Run this command:"
    echo
    echo "${ind}  $theConfigCommand -dev /dev/fbs/$1 -deflinear true -g 1.1"
    echo
}

msg_gfxp() {
    echo "${ind}Run this command:"
    echo
    echo "${ind}  $theConfigCommand -dev /dev/fbs/$1 -res 1280x1024 -depth 24"
    echo
    echo "${ind}The following command lists all possible resolutions:"
    echo
    echo "${ind}  $theConfigCommand -dev /dev/fbs/$1 -res \\?"
    echo
}

checkCard() {
    cardStatus=UNKNOWN
    if [ "x$theCard" != x -a "x$theCard" != xunknown ]; then
	r0=`echo | $theConfigCommand $theConfigOption -dev /dev/fbs/$1 2>&1 | \
	    /usr/bin/grep -i "^$theConfigKey:" | \
	    cut -f2 -d:`
	theValue=`echo $r0`
	if [ "x$theValue" = x ]; then
	    cardStatus=UNKNOWN
	elif [ "x$theValue" = "x$theExpectedValue" ]; then
	    cardStatus=OK
	else
	    cardStatus=NOT_OK
	fi
    fi
    cardExtraStatus=
    if [ x$needExtraCheck = xyes ]; then
        check_$theCard
    fi
}

getCardList() {
    list0=`$FBCONFIG -list 2>/dev/null | /usr/bin/grep '^ */dev/fbs'`
    list1=`echo "$list0" | \
	/usr/bin/sed -e 's/^ *\/dev\/fbs\/\([^ ]*\) .*$/\1/'`
    cardList=`echo $list1`
}

main() {
    getCardList
    IFS=' '
    cardNum=1
    ind='   '
    for card in $cardList; do
	cardInfo $card
	checkCard $card
        if [ "x$cardStatus" = xNOT_OK ]; then
	    msg_common $card
	    msg_$theCard $card
	fi
	if [ "x$cardExtraStatus" != x ]; then
	    msg_extra_common $card
	    msg_extra_$theCard $card
	fi
	cardNum=`expr $cardNum + 1`
    done
}

main
Reply With Quote