backend/kms: Check all connectors for primary gpu
This commit is contained in:
parent
b407ed560a
commit
a7d31a75d2
1 changed files with 17 additions and 8 deletions
|
|
@ -32,7 +32,11 @@ use smithay::{
|
||||||
calloop::{Dispatcher, EventLoop, LoopHandle},
|
calloop::{Dispatcher, EventLoop, LoopHandle},
|
||||||
drm::{
|
drm::{
|
||||||
Device as _,
|
Device as _,
|
||||||
control::{Device as _, connector::Interface, crtc},
|
control::{
|
||||||
|
Device as _,
|
||||||
|
connector::{Interface, State as ConnectorState},
|
||||||
|
crtc,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
input::{self, Libinput},
|
input::{self, Libinput},
|
||||||
wayland_protocols::wp::linux_dmabuf::zv1::server::zwp_linux_dmabuf_feedback_v1::TrancheFlags,
|
wayland_protocols::wp::linux_dmabuf::zv1::server::zwp_linux_dmabuf_feedback_v1::TrancheFlags,
|
||||||
|
|
@ -250,13 +254,18 @@ fn determine_primary_gpu(
|
||||||
|
|
||||||
// try to find builtin display
|
// try to find builtin display
|
||||||
for dev in drm_devices.values() {
|
for dev in drm_devices.values() {
|
||||||
if dev.inner.surfaces.values().any(|s| {
|
let drm = dev.drm.device();
|
||||||
if let Ok(conn_info) = dev.drm.device().get_connector(s.connector, false) {
|
let res_handles = drm.resource_handles()?;
|
||||||
let i = conn_info.interface();
|
let connectors = res_handles.connectors();
|
||||||
i == Interface::EmbeddedDisplayPort || i == Interface::LVDS || i == Interface::DSI
|
if connectors.iter().any(|conn| {
|
||||||
} else {
|
let Ok(conn_info) = drm.get_connector(*conn, false) else {
|
||||||
false
|
return false;
|
||||||
}
|
};
|
||||||
|
let i = conn_info.interface();
|
||||||
|
conn_info.state() == ConnectorState::Connected
|
||||||
|
&& (i == Interface::EmbeddedDisplayPort
|
||||||
|
|| i == Interface::LVDS
|
||||||
|
|| i == Interface::DSI)
|
||||||
}) {
|
}) {
|
||||||
return Ok(Some(dev.inner.render_node));
|
return Ok(Some(dev.inner.render_node));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue