Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
S
scom
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
scom
Commits
4973b458
Kaydet (Commit)
4973b458
authored
May 01, 2009
tarafından
Fatih Aşıcı
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Implement a simplified version of getPrimaryCard. Works with recent kernels.
üst
cf279477
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
80 deletions
+10
-80
ChangeLog
zorg/ChangeLog
+4
-0
probe.py
zorg/zorg/probe.py
+6
-80
No files found.
zorg/ChangeLog
Dosyayı görüntüle @
4973b458
2009-05-01 Fatih Aşıcı <fatih@pardus.org.tr>
* zorg/probe.py:
Implement a simplified version of getPrimaryCard.
2009-04-23 Fatih Aşıcı <fatih@pardus.org.tr>
* setup.py:
Do not install modprobe.d config file.
...
...
zorg/zorg/probe.py
Dosyayı görüntüle @
4973b458
...
...
@@ -2,7 +2,7 @@
import
os
import
dbus
import
struct
import
glob
from
zorg
import
consts
from
zorg.parser
import
*
...
...
@@ -10,37 +10,6 @@ from zorg.utils import *
sysdir
=
"/sys/bus/pci/devices/"
# from pci/header.h
PCI_COMMAND
=
0x04
PCI_COMMAND_IO
=
0x1
PCI_COMMAND_MEMORY
=
0x2
PCI_BRIDGE_CONTROL
=
0x3e
PCI_BRIDGE_CTL_VGA
=
0x08
PCI_BASE_CLASS_DISPLAY
=
0x03
#PCI_BASE_CLASS_BRIDGE = 0x06
PCI_CLASS_BRIDGE_PCI
=
0x0604
class
PCIDevice
:
def
__init__
(
self
,
name
):
self
.
name
=
name
self
.
class_
=
None
self
.
bridge
=
None
self
.
config
=
None
def
_readConfig
(
self
,
offset
,
size
=
1
):
if
self
.
config
is
None
:
self
.
config
=
open
(
os
.
path
.
join
(
sysdir
,
self
.
name
,
"config"
))
.
read
()
return
self
.
config
[
offset
:
offset
+
size
]
def
readConfigWord
(
self
,
offset
):
data
=
self
.
_readConfig
(
offset
,
2
)
return
struct
.
unpack
(
"h"
,
data
)[
0
]
class
VideoDevice
:
def
__init__
(
self
,
deviceDir
=
None
,
busId
=
None
):
if
deviceDir
:
...
...
@@ -264,55 +233,12 @@ def enabledPackage():
return
None
def
getPrimaryCard
():
devices
=
[]
bridges
=
[]
for
dev
in
os
.
listdir
(
sysdir
):
device
=
PCIDevice
(
dev
)
device
.
class_
=
int
(
pciInfo
(
dev
,
"class"
)[:
6
],
16
)
devices
.
append
(
device
)
if
device
.
class_
==
PCI_CLASS_BRIDGE_PCI
:
bridges
.
append
(
device
)
for
dev
in
devices
:
for
bridge
in
bridges
:
dev_path
=
os
.
path
.
join
(
sysdir
,
bridge
.
name
,
dev
.
name
)
if
os
.
path
.
exists
(
dev_path
):
dev
.
bridge
=
bridge
primaryBus
=
None
for
dev
in
devices
:
if
(
dev
.
class_
>>
8
)
!=
PCI_BASE_CLASS_DISPLAY
:
continue
vga_routed
=
True
bridge
=
dev
.
bridge
while
bridge
:
bridge_ctl
=
bridge
.
readConfigWord
(
PCI_BRIDGE_CONTROL
)
if
not
(
bridge_ctl
&
PCI_BRIDGE_CTL_VGA
):
vga_routed
=
False
break
bridge
=
bridge
.
bridge
if
vga_routed
:
pci_cmd
=
dev
.
readConfigWord
(
PCI_COMMAND
)
if
pci_cmd
&
(
PCI_COMMAND_IO
|
PCI_COMMAND_MEMORY
):
primaryBus
=
dev
.
name
break
# Just to ensure that we have picked a device. Normally,
# primaryBus might not be None here.
if
primaryBus
is
None
:
for
dev
in
devices
:
if
(
dev
.
class_
>>
8
)
==
PCI_BASE_CLASS_DISPLAY
:
primaryBus
=
dev
.
name
break
for
boot_vga
in
glob
.
glob
(
"
%
s/*/boot_vga"
%
sysdir
):
if
open
(
boot_vga
)
.
read
()
.
startswith
(
"1"
):
dev_path
=
os
.
path
.
dirname
(
boot_vga
)
return
os
.
path
.
basename
(
dev_path
)
return
primaryBus
return
None
def
XProbe
(
dev
):
p
=
XorgParser
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment