Remove setting max bpc

This commit is contained in:
Ivan Molodetskikh
2025-11-21 10:20:15 +03:00
parent 2d82fdd9c8
commit 98006a8dba
2 changed files with 4 additions and 33 deletions
@@ -320,6 +320,10 @@ Apparently, setting max bpc to 8 breaks some displays driven by AMDGPU.
If this happens to you, set this debug flag, which will prevent niri from changing max bpc.
AMDGPU bug report: https://gitlab.freedesktop.org/drm/amd/-/issues/4487.
<sup>Since: next release</sup>
This setting is deprecated and does nothing: niri no longer sets max bpc.
The old niri behavior with this setting enabled matches the new behavior.
```kdl
debug {
keep-max-bpc-unchanged
-33
View File
@@ -1237,15 +1237,6 @@ impl Tty {
Err(err) => debug!("couldn't reset HDR properties: {err:?}"),
}
if !niri.config.borrow().debug.keep_max_bpc_unchanged {
// We only use 8888 RGB formats, so set max bpc to 8 to allow more types of links to
// run.
match set_max_bpc(&props, 8) {
Ok(_bpc) => (),
Err(err) => debug!("couldn't set max bpc: {err:?}"),
}
}
match get_panel_orientation(&props) {
Ok(x) => orientation = Some(x),
Err(err) => {
@@ -3224,30 +3215,6 @@ fn reset_hdr(props: &ConnectorProperties) -> anyhow::Result<()> {
Ok(())
}
fn set_max_bpc(props: &ConnectorProperties, bpc: u64) -> anyhow::Result<u64> {
let (info, value) = props.find(c"max bpc")?;
let property::ValueType::UnsignedRange(min, max) = info.value_type() else {
bail!("wrong property type")
};
let bpc = bpc.clamp(min, max);
let property::Value::UnsignedRange(value) = info.value_type().convert_value(*value) else {
bail!("wrong property type")
};
if value != bpc {
props
.device
.set_property(
props.connector,
info.handle(),
property::Value::UnsignedRange(bpc).into(),
)
.context("error setting property")?;
}
Ok(bpc)
}
fn is_vrr_capable(device: &DrmDevice, connector: connector::Handle) -> Option<bool> {
let (_, info, value) = find_drm_property(device, connector, "vrr_capable")?;
info.value_type().convert_value(value).as_boolean()