-
-
Notifications
You must be signed in to change notification settings - Fork 48
Use libpci to retrieve some basic PCI data #440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
4bcb37f
Add pci dep
stsdc c3d652a
Add libpci dep
stsdc 0e473c7
libpci-dev
stsdc 0cded21
missed space
stsdc 4e76d37
Try to use LIB_VERSION
stsdc de6631f
Add Access and Dev structs
stsdc 2ae3a75
wip
stsdc d28b3b7
Use struct in cname
stsdc 3ad5375
Merge branch 'main' into stsdc/libpci
stsdc 14ba09b
Add pci_scan_bus
stsdc db42263
Merge branch 'main' into stsdc/libpci
stsdc 0225d12
Update structs according to ver. 3.10.0
stsdc 709aa5f
Make pci_init a standalone function
stsdc 79b6341
list all pci addresses
stsdc f04f8b2
Introduce pci_lookup_name
stsdc e9a2c54
remove ref
stsdc b9175ce
Merge branch 'main' into stsdc/libpci
stsdc 1d5b3e2
convert Access to class
stsdc 803e0cc
Reintroduce pci_cleanup as destroy_function for Access class
stsdc 866a188
standalone functions are now methods of Access class
stsdc f40af61
Introduce class Dev; use free_function
stsdc 3c84ebf
Return unowned nullable string in lookup_name
stsdc 7b208dc
Introduce fill_info
stsdc 275330a
Add Version annotations
stsdc 377dc0a
Add subsys_vendor_id and subsys_id; add missing FILL consts
stsdc aee4527
Drop SessionManager and use libpci to get GPU name
stsdc 0e653a5
fix lint
stsdc 88c4809
Merge branch 'main' into stsdc/libpci
stsdc d520256
Reintroduce GPU monitoring; introduce multiple GPU support foundament
stsdc a144858
Fix for Intel graphics
stsdc 3d731c6
A bit better debug messages
stsdc a53d166
Consider 3D cotroller as a GPU
stsdc b3d94a6
Update Resources.vala
stsdc 5b63050
Add Intel GPU dummy class
stsdc e525adc
Add proper vendor name to the GPU name
stsdc 2619151
Display not supported label for Intel and Nvidia gpus
stsdc b037a45
lint
stsdc b556be3
Improve comment styling for hints and docs
stsdc 1a11d19
Add comment
stsdc 6d3e51b
Merge branch 'main' into stsdc/libpci
stsdc 889b100
Remove obsolete code
stsdc 7b78697
Update src/Views/SystemView/SystemView.vala
stsdc f50b8ef
Refactoring: atomize comments; put literals into consts
stsdc 0718cc9
Remove space at the start of the file
stsdc fd47986
Make it clear that Intel GPU needs implementation.
stsdc 585ba6c
Add libpci-dev to readme
stsdc e03f0b5
Use pci consts from Utils
stsdc fa2c3c2
Use switch-case for GPU detection
stsdc 62fbc45
Use for loop for detecting GPU
stsdc 4478ad7
make sysfs path in nvidia protected
stsdc b933672
Explicit setting properties without digging into the method in the in…
ryonakano acff8e4
Compare GPU types instead of string properties
stsdc fc97d56
Merge branch 'stsdc/libpci' into ryonakano/libpci-proposal
stsdc 3804207
Update names of IGPU methods
stsdc 7175da7
Display pretty version of libpci
stsdc 5bc7216
Use LIBPCI_* consts to display pretty version
stsdc e6e746f
Move PCI defines to independant source
ryonakano c18f0c0
Add Flags attribute to enum LookupMode
stsdc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /* | ||
| * SPDX-License-Identifier: GPL-3.0-or-later | ||
| * SPDX-FileCopyrightText: 2025 elementary, Inc. (https://elementary.io) | ||
| */ | ||
|
|
||
| namespace Monitor.PCIUtils { | ||
| const int LIBPCI_MAJOR_VER = (Pci.LIB_VERSION & 0xFF0000) >> 16; | ||
| const int LIBPCI_MINOR_VER = (Pci.LIB_VERSION & 0x00FF00) >> 8; | ||
| const int LIBPCI_PATCH_VER = (Pci.LIB_VERSION & 0x0000FF) >> 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /* | ||
| * SPDX-License-Identifier: GPL-3.0-or-later | ||
| * SPDX-FileCopyrightText: 2025 elementary, Inc. (https://elementary.io) | ||
| */ | ||
|
|
||
| public class Monitor.GPUIntel : IGPU, Object { | ||
|
|
||
| public Gee.HashMap<string, HwmonTemperature> hwmon_temperatures { get; set; } | ||
|
|
||
| public string hwmon_module_name { get; set; } | ||
|
|
||
| public string name { get; set; } | ||
|
|
||
| public int percentage { get; protected set; } | ||
|
|
||
| public int memory_percentage { get; protected set; } | ||
|
|
||
| public double memory_vram_used { get; protected set; } | ||
|
|
||
| public double memory_vram_total { get; set; } | ||
|
|
||
| public double temperature { get; protected set; } | ||
|
|
||
| protected string sysfs_path { get; set; } | ||
|
|
||
| public GPUIntel (Pci.Access pci_access, Pci.Dev pci_device) { | ||
| name = pci_parse_name (pci_access, pci_device); | ||
| name = "Intel® " + name; | ||
|
|
||
| sysfs_path = pci_parse_sysfs_path (pci_access, pci_device); | ||
| } | ||
|
|
||
| private void update_temperature () { | ||
| // @TODO: Intel GPU temperature retrieval needs implementation. | ||
| temperature = 0; | ||
stsdc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| private void update_memory_vram_used () { | ||
| // @TODO: Intel GPU used VRAM retrieval needs implementation. | ||
| memory_vram_used = 0; | ||
| } | ||
|
|
||
| private void update_memory_vram_total () { | ||
| // @TODO: Intel GPU total VRAM retrieval needs implementation. | ||
| memory_vram_total = 0; | ||
| } | ||
|
|
||
| private void update_memory_percentage () { | ||
| // @TODO: Intel GPU memory percentage needs implementation. | ||
| memory_percentage = 0; | ||
| } | ||
|
|
||
| private void update_percentage () { | ||
| // @TODO: Intel GPU usage percentage needs implementation. | ||
| percentage = 0; | ||
| } | ||
|
|
||
| public void update () { | ||
| update_temperature (); | ||
| update_memory_vram_used (); | ||
| update_memory_vram_total (); | ||
| update_memory_percentage (); | ||
| update_percentage (); | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.