kms: Clear non-primary planes on startup
This commit is contained in:
parent
2a41d944e0
commit
352c526e9e
1 changed files with 11 additions and 2 deletions
|
|
@ -6,7 +6,8 @@ use smithay::reexports::drm::control::{
|
||||||
connector::{self, State as ConnectorState},
|
connector::{self, State as ConnectorState},
|
||||||
crtc,
|
crtc,
|
||||||
dumbbuffer::DumbBuffer,
|
dumbbuffer::DumbBuffer,
|
||||||
property, AtomicCommitFlags, Device as ControlDevice, Mode, ModeFlags, ResourceHandle,
|
property, AtomicCommitFlags, Device as ControlDevice, Mode, ModeFlags, PlaneType,
|
||||||
|
ResourceHandle,
|
||||||
};
|
};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
|
@ -92,7 +93,15 @@ pub fn display_configuration(
|
||||||
for plane in plane_handles {
|
for plane in plane_handles {
|
||||||
let info = device.get_plane(plane)?;
|
let info = device.get_plane(plane)?;
|
||||||
if let Some(crtc) = info.crtc() {
|
if let Some(crtc) = info.crtc() {
|
||||||
if cleanup.contains(&crtc) {
|
let is_primary = get_property_val(device, plane, "type").map(
|
||||||
|
|(val_type, val)| match val_type.convert_value(val) {
|
||||||
|
property::Value::Enum(Some(val)) => {
|
||||||
|
val.value() == PlaneType::Primary as u64
|
||||||
|
}
|
||||||
|
_ => false,
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
if cleanup.contains(&crtc) || !is_primary {
|
||||||
let crtc_id = get_prop(device, plane, "CRTC_ID")?;
|
let crtc_id = get_prop(device, plane, "CRTC_ID")?;
|
||||||
let fb_id = get_prop(device, plane, "FB_ID")?;
|
let fb_id = get_prop(device, plane, "FB_ID")?;
|
||||||
req.add_property(plane, crtc_id, property::Value::CRTC(None));
|
req.add_property(plane, crtc_id, property::Value::CRTC(None));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue