Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Resources/GPU/GPUAmd.vala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public class Monitor.GPUAmd : IGPU, Object {

public string hwmon_module_name { get; set; }

public string driver_name { get; set; }

public string name { get; set; }

public int percentage { get; protected set; }
Expand All @@ -28,6 +30,7 @@ public class Monitor.GPUAmd : IGPU, Object {
name = "AMD® " + name;

sysfs_path = pci_parse_sysfs_path (pci_access, pci_device);
driver_name = pci_device.get_string_property (Pci.FILL_DRIVER);
}

private void update_temperature () {
Expand Down
4 changes: 4 additions & 0 deletions src/Resources/GPU/GPUIntel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public class Monitor.GPUIntel : IGPU, Object {

public string hwmon_module_name { get; set; }

public string driver_name { get; set; }

public string name { get; set; }

public int percentage { get; protected set; }
Expand All @@ -28,6 +30,8 @@ public class Monitor.GPUIntel : IGPU, Object {
name = "Intel® " + name;

sysfs_path = pci_parse_sysfs_path (pci_access, pci_device);
driver_name = pci_device.get_string_property (Pci.FILL_DRIVER);

}

private void update_temperature () {
Expand Down
3 changes: 3 additions & 0 deletions src/Resources/GPU/GPUNvidia.vala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public class Monitor.GPUNvidia : IGPU, Object {

public string hwmon_module_name { get; set; }

public string driver_name { get; set; }

public string name { get; set; }

public int percentage { get; protected set; }
Expand Down Expand Up @@ -54,6 +56,7 @@ public class Monitor.GPUNvidia : IGPU, Object {
name = "nVidia® " + name;

sysfs_path = pci_parse_sysfs_path (pci_access, pci_device);
driver_name = pci_device.get_string_property (Pci.FILL_DRIVER);
}

construct {
Expand Down
2 changes: 2 additions & 0 deletions src/Resources/GPU/IGPU.vala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public interface Monitor.IGPU : Object {

public abstract string hwmon_module_name { get; protected set; }

public abstract string driver_name { get; protected set; }

public abstract string name { get; protected set; }

public abstract int percentage { get; protected set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/Resources.vala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class Monitor.Resources : Object {
char namebuf[1024];

for (unowned Pci.Dev pci_device = pci_access.devices; pci_device != null; pci_device = pci_device.next) {
pci_device.fill_info (Pci.FILL_IDENT | Pci.FILL_BASES | Pci.FILL_CLASS_EXT | Pci.FILL_LABEL | Pci.FILL_CLASS);
pci_device.fill_info (Pci.FILL_IDENT | Pci.FILL_BASES | Pci.FILL_CLASS_EXT | Pci.FILL_LABEL | Pci.FILL_CLASS | Pci.FILL_DRIVER);
string name = pci_access.lookup_name (namebuf, Pci.LookupMode.DEVICE, pci_device.vendor_id, pci_device.device_id);

// Looking for a specific PCI device class
Expand Down
3 changes: 3 additions & 0 deletions vapi/pci.vapi
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ namespace Pci {
[CCode (cname = "pci_fill_info")]
public int fill_info (int flags);

[CCode (cname = "pci_get_string_property")]
public unowned string ? get_string_property (int flag);

private Dev ();
}

Expand Down