mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 08:57:57 +00:00
new version, attempt 2 at detecting all possible syntaxes for cards. Now using
the bus id itself to determine if the VGA compatible controller 3D controller Display Controller refer to separate chips or the same one. Bus id gives the data needed, because the video chip, the real card, that is, is on for example 00:05.0 the trailing .0 is the key, that's the actual card. The audio or display controller for the same card would be for example: 00:05.1 I don't know if this is fully reliable, but it will have to do, either some cards as is get missed, or some cards get double id'ed, unless I use a hack like this. There's nothing else I can find but the bus id to determine that it's the same physical device or not.
This commit is contained in:
parent
dbcf4656c3
commit
a830e996ac
16
inxi
16
inxi
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### Version: 2.1.6
|
||||
#### Version: 2.1.7
|
||||
#### Date: 2014-03-18
|
||||
#### Patch Number: 00
|
||||
########################################################################
|
||||
|
@ -4914,15 +4914,23 @@ get_graphics_card_data()
|
|||
BEGIN {
|
||||
IGNORECASE=1
|
||||
busId=""
|
||||
trueCard=""
|
||||
}
|
||||
# not using 3D controller yet, needs research: |3D controller |display controller
|
||||
/vga compatible controller/ {
|
||||
# note: this is strange, but all of these can be either a separate or the same
|
||||
# card. However, by comparing bus id, say: 00:02.0 we can determine that the
|
||||
# cards are either the same or different. We want only the .0 version as a valid
|
||||
# card. .1 would be for example: Display Adapter with bus id x:xx.1, not the right one
|
||||
/vga compatible controller|3D controller|Display controller/ {
|
||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF)
|
||||
gsub(/,/, " ", $NF)
|
||||
gsub(/^ +| +$/, "", $NF)
|
||||
gsub(/ [ \t]+/, " ", $NF)
|
||||
busId=gensub(/^([0-9a-f:\.]+) (.+)$/,"\\1","",$1)
|
||||
print $NF "," busId
|
||||
trueCard=gensub(/(.*)\.([0-9]+)$/,"\\2","",busId)
|
||||
if ( trueCard == 0 ) {
|
||||
print $NF "," busId
|
||||
}
|
||||
}' <<< "$Lspci_v_Data" ) )
|
||||
IFS="$ORIGINAL_IFS"
|
||||
# for (( i=0; i < ${#A_GRAPHICS_CARD_DATA[@]}; i++ ))
|
||||
|
@ -7203,10 +7211,8 @@ EOF"
|
|||
if ( device == "" ) {
|
||||
device=vendor
|
||||
}
|
||||
|
||||
fullLine=class "," device "," vendor "," driver "," pciId "," chipId
|
||||
print fullLine
|
||||
|
||||
}' <<< "$pciconf_data" ))
|
||||
IFS="$ORIGINAL_IFS"
|
||||
fi
|
||||
|
|
|
@ -1,3 +1,31 @@
|
|||
=====================================================================================
|
||||
Version: 2.1.7
|
||||
Patch Version: 00
|
||||
Script Date: 2014-03-18
|
||||
-----------------------------------
|
||||
Changes:
|
||||
-----------------------------------
|
||||
new version, attempt 2 at detecting all possible syntaxes for cards. Now using
|
||||
the bus id itself to determine if the
|
||||
VGA compatible controller
|
||||
3D controller
|
||||
Display Controller
|
||||
refer to separate chips or the same one.
|
||||
|
||||
Bus id gives the data needed, because the video chip, the real card, that is,
|
||||
is on for example 00:05.0 the trailing .0 is the key, that's the actual card.
|
||||
|
||||
The audio or display controller for the same card would be for example: 00:05.1
|
||||
|
||||
I don't know if this is fully reliable, but it will have to do, either some cards
|
||||
as is get missed, or some cards get double id'ed, unless I use a hack like this.
|
||||
|
||||
There's nothing else I can find but the bus id to determine that it's the same
|
||||
physical device or not.
|
||||
|
||||
-----------------------------------
|
||||
-- Harald Hope - Tue, 18 Mar 2014 21:18:27 -0700
|
||||
|
||||
=====================================================================================
|
||||
Version: 2.1.6
|
||||
Patch Version: 00
|
||||
|
|
Loading…
Reference in a new issue