kms: Import on device supporting format, if not advertised device
Fixes https://github.com/pop-os/cosmic-epoch/issues/2978.
This reverses the part of
ca00df0b37 that made it
only try import on the advertised GPU. But this version avoids
initializing an EGL context simply to re-check the supported texture
formats.
This commit is contained in:
parent
0e97ddbd00
commit
2ea1186723
2 changed files with 20 additions and 3 deletions
|
|
@ -95,6 +95,7 @@ pub struct Device {
|
|||
pub drm: GbmDrmOutputManager,
|
||||
|
||||
supports_atomic: bool,
|
||||
pub texture_formats: FormatSet,
|
||||
event_token: Option<RegistrationToken>,
|
||||
pub socket: Option<Socket>,
|
||||
}
|
||||
|
|
@ -285,7 +286,7 @@ impl State {
|
|||
.with_context(|| format!("Failed to add drm device to event loop: {}", dev))?;
|
||||
|
||||
let socket = match (!is_software)
|
||||
.then(|| self.create_socket(dh, render_node, texture_formats))
|
||||
.then(|| self.create_socket(dh, render_node, texture_formats.clone()))
|
||||
.transpose()
|
||||
{
|
||||
Ok(socket) => socket,
|
||||
|
|
@ -349,6 +350,7 @@ impl State {
|
|||
},
|
||||
|
||||
supports_atomic,
|
||||
texture_formats,
|
||||
event_token: Some(token),
|
||||
socket,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue