(no version change)

branch test to output all glx info for all cards, also to fix a bug from raikejen on lsc
This commit is contained in:
inxi-svn 2009-03-13 23:47:41 +00:00
parent 1ab0749006
commit 6756f714de

35
inxi
View file

@ -295,7 +295,7 @@ DISTROS_LSB_GOOD="mandrake-release mandriva-release mandrakelinux-release"
# $'\1' gets weird results : # $'\1' gets weird results :
# user@host $ ARR=($'\x01'"one two" three four); echo ${ARR[0]} | hd -v # user@host $ ARR=($'\x01'"one two" three four); echo ${ARR[0]} | hd -v
# 00000000 01 01 6f 6e 65 20 74 77 6f 0a |..one two.| # 00000000 01 01 6f 6e 65 20 74 77 6f 0a |..one two.|
A_NORMAL_BANS=( corporation communications gmbh technologies technology group $'\2'"\<ltd\>" ltd. $'\2'"\<inc\>" inc. $'\2'\<co\> co. "(tm)" "(r)" $'\2'"\(rev ..\)" ) A_NORMAL_BANS=( corporation communications gmbh technologies technology group $'\2'"\<ltd\>" ltd. $'\2'"\<inc\>" inc. $'\2'\<co\> co. "(tm)" "(r)" "®" $'\2'"\(rev ..\)" )
A_CPU_BANS=( @ cpu deca 'dual core' dual-core 'tri core' tri-core 'quad core' quad-core ennea genuine hepta hexa multi octa penta 'processor' processor single triple $'\2'"[0-9.]+ *[MmGg][Hh][Zz]" ) A_CPU_BANS=( @ cpu deca 'dual core' dual-core 'tri core' tri-core 'quad core' quad-core ennea genuine hepta hexa multi octa penta 'processor' processor single triple $'\2'"[0-9.]+ *[MmGg][Hh][Zz]" )
# after processing, the ban arrays will be put into these: # after processing, the ban arrays will be put into these:
BAN_LIST_NORMAL='' BAN_LIST_NORMAL=''
@ -1890,9 +1890,13 @@ get_graphics_glx_data()
{ {
if [[ $B_X_RUNNING == 'true' ]];then if [[ $B_X_RUNNING == 'true' ]];then
IFS=$'\n' IFS=$'\n'
# A_GLX_DATA=( $( glxinfo | gawk -F ': ' '
# A_GLX_DATA=( $( cat ../../modules/data/glxinfo-atom-1r | gawk -F ': ' '
# A_GLX_DATA=( $( cat ../../modules/data/glxinfo-intel-sput | gawk -F ': ' '
A_GLX_DATA=( $( glxinfo | gawk -F ': ' ' A_GLX_DATA=( $( glxinfo | gawk -F ': ' '
# note: function declarations go before BEGIN? It appears so, confirm. # note: function declarations go before BEGIN? It appears so, confirm.
function join(arr, sep) { function join( arr, sep ) {
s="" s=""
i=flag=0 i=flag=0
for ( i in arr ) { for ( i in arr ) {
@ -1909,27 +1913,30 @@ get_graphics_glx_data()
} }
/opengl renderer/ { /opengl renderer/ {
if ( $2 ~ /mesa/ ) { if ( $2 ~ /mesa/ ) {
# Allow r300 et al, but not the rest # Allow all mesas
if ( $2 ~ / r[3-9][0-9][0-9] / ) { # if ( $2 ~ / r[3-9][0-9][0-9] / ) {
gsub(/'"$BAN_LIST_NORMAL"'/, "", $2)
a[$2] a[$2]
f++ # f++
} # }
next next
} }
$2 && a[$2] $2 && a[$2]
} }
/opengl version/ && ( f || $2 !~ /mesa/ ) { # /opengl version/ && ( f || $2 !~ /mesa/ ) {
/opengl version/ {
$2 && b[$2] $2 && b[$2]
} }
/direct rendering/ { /direct rendering/ {
$2 && c[$2] $2 && c[$2]
} }
END { END {
printf("%s\n%s\n%s\n", join(a,", "), join(b,", "), join(c,", ")) printf( "%s\n%s\n%s\n", join( a,", " ), join( b,", " ), join( c,", " ) )
}' ) ) }' ) )
IFS="$ORIGINAL_IFS" IFS="$ORIGINAL_IFS"
echo "working:${A_GLX_DATA[@]}"
# GLXR=$(glxinfo | gawk -F ': ' 'BEGIN {IGNORECASE=1} /opengl renderer/ && $2 !~ /mesa/ {seen[$2]++} END {for (i in seen) {printf("%s ",i)}}') # GLXR=$(glxinfo | gawk -F ': ' 'BEGIN {IGNORECASE=1} /opengl renderer/ && $2 !~ /mesa/ {seen[$2]++} END {for (i in seen) {printf("%s ",i)}}')
# GLXV=$(glxinfo | gawk -F ': ' 'BEGIN {IGNORECASE=1} /opengl version/ && $2 !~ /mesa/ {seen[$2]++} END {for (i in seen) {printf("%s ",i)}}') # GLXV=$(glxinfo | gawk -F ': ' 'BEGIN {IGNORECASE=1} /opengl version/ && $2 !~ /mesa/ {seen[$2]++} END {for (i in seen) {printf("%s ",i)}}')
fi fi
@ -3061,6 +3068,7 @@ print_gfx_data()
local glx_renderer="${A_GLX_DATA[0]}" local glx_renderer="${A_GLX_DATA[0]}"
local glx_version="${A_GLX_DATA[1]}" local glx_version="${A_GLX_DATA[1]}"
local glx_direct_render="${A_GLX_DATA[2]}" local glx_direct_render="${A_GLX_DATA[2]}"
echo ${A_GLX_DATA[@]}
if [[ ${#A_GFX_CARD_DATA[@]} -gt 1 ]];then if [[ ${#A_GFX_CARD_DATA[@]} -gt 1 ]];then
i=1 i=1
@ -3080,12 +3088,13 @@ print_gfx_data()
fi fi
print_screen_output "$gfx_data" print_screen_output "$gfx_data"
if [[ -z $glx_renderer || -z $glx_version ]];then # if [[ -z $glx_renderer || -z $glx_version ]];then
b_is_mesa='true' # b_is_mesa='true'
fi # fi
## note: if glx render or version have no content, then mesa is true ## note: if glx render or version have no content, then mesa is true
if [[ $B_X_RUNNING == 'true' ]] && [[ $b_is_mesa != 'true' ]];then # if [[ $B_X_RUNNING == 'true' ]] && [[ $b_is_mesa != 'true' ]];then
if [[ $B_X_RUNNING == 'true' ]];then
gfx_data=$( create_print_line " " "${C1}GLX Renderer${C2} ${glx_renderer} ${C1}GLX Version${C2} ${glx_version}${CN}" ) gfx_data=$( create_print_line " " "${C1}GLX Renderer${C2} ${glx_renderer} ${C1}GLX Version${C2} ${glx_version}${CN}" )
if [[ $B_HANDLE_CORRUPT_DATA == 'true' ]];then if [[ $B_HANDLE_CORRUPT_DATA == 'true' ]];then
gfx_data="${gfx_data} ${C1}Direct rendering${C2} ${glx_direct_render}${CN}" gfx_data="${gfx_data} ${C1}Direct rendering${C2} ${glx_direct_render}${CN}"