battery: Only consider connected built-in ports for primary-gpu logic
This commit is contained in:
parent
8cbe5de137
commit
84cbfe0d86
1 changed files with 9 additions and 7 deletions
|
|
@ -393,13 +393,15 @@ fn all_gpus<S: AsRef<str>>(seat: S) -> io::Result<Vec<Gpu>> {
|
||||||
if let Some(primary_idx) = gpus
|
if let Some(primary_idx) = gpus
|
||||||
.iter()
|
.iter()
|
||||||
.position(|gpu| {
|
.position(|gpu| {
|
||||||
connectors(&gpu.path).is_some_and(|mut conns| {
|
connectors(&gpu.path).is_some_and(|conns| {
|
||||||
conns.any(|info| {
|
conns
|
||||||
let i = info.interface();
|
.filter(|info| info.state() == drm::control::connector::State::Connected)
|
||||||
i == Interface::EmbeddedDisplayPort
|
.any(|info| {
|
||||||
|| i == Interface::LVDS
|
let i = info.interface();
|
||||||
|| i == Interface::DSI
|
i == Interface::EmbeddedDisplayPort
|
||||||
})
|
|| i == Interface::LVDS
|
||||||
|
|| i == Interface::DSI
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.or_else(|| gpus.iter().position(|gpu| gpu.boot_vga))
|
.or_else(|| gpus.iter().position(|gpu| gpu.boot_vga))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue