debug: Add disable-pipewire-dmabuf
Browse files at this commitf66343f37bde03ec06782f4229de5d2322722bd1Parent: ab8e7744 changed files +22 -0
- docs/wiki/Configuration:-Debug-Options.md +13 -0
- niri-config/src/debug.rs +4 -0
- niri-config/src/lib.rs +1 -0
- src/screencasting/mod.rs +4 -0
docs/wiki/Configuration:-Debug-Options.mdmodified+13 -0
| @@ -22,6 +22,7 @@ debug { | ||
| 22 | 22 | ignore-drm-device "/dev/dri/renderD128" |
| 23 | 23 | ignore-drm-device "/dev/dri/renderD130" |
| 24 | 24 | force-pipewire-invalid-modifier |
| 25 | + disable-pipewire-dmabuf | |
| 25 | 26 | dbus-interfaces-in-non-session-instances |
| 26 | 27 | wait-for-frame-completion-before-queueing |
| 27 | 28 | emulate-zero-presentation-time |
| @@ -161,6 +162,18 @@ debug { | ||
| 161 | 162 | } |
| 162 | 163 | ``` |
| 163 | 164 | |
| 165 | +### `disable-pipewire-dmabuf` | |
| 166 | + | |
| 167 | +Disable DMA-BUF sharing for PipeWire screencasts, forcing shared-memory buffers instead. | |
| 168 | + | |
| 169 | +Useful for testing shm screencasting. | |
| 170 | + | |
| 171 | +```kdl | |
| 172 | +debug { | |
| 173 | + disable-pipewire-dmabuf | |
| 174 | +} | |
| 175 | +``` | |
| 176 | + | |
| 164 | 177 | ### `dbus-interfaces-in-non-session-instances` |
| 165 | 178 | |
| 166 | 179 | Make niri create its D-Bus interfaces even if it's not running as a `--session`. |
niri-config/src/debug.rsmodified+4 -0
| @@ -15,6 +15,7 @@ pub struct Debug { | ||
| 15 | 15 | pub render_drm_device: Option<PathBuf>, |
| 16 | 16 | pub ignored_drm_devices: Vec<PathBuf>, |
| 17 | 17 | pub force_pipewire_invalid_modifier: bool, |
| 18 | + pub disable_pipewire_dmabuf: bool, | |
| 18 | 19 | pub emulate_zero_presentation_time: bool, |
| 19 | 20 | pub disable_resize_throttling: bool, |
| 20 | 21 | pub disable_transactions: bool, |
| @@ -52,6 +53,8 @@ pub struct DebugPart { | ||
| 52 | 53 | #[knuffel(child)] |
| 53 | 54 | pub force_pipewire_invalid_modifier: Option<Flag>, |
| 54 | 55 | #[knuffel(child)] |
| 56 | + pub disable_pipewire_dmabuf: Option<Flag>, | |
| 57 | + #[knuffel(child)] | |
| 55 | 58 | pub emulate_zero_presentation_time: Option<Flag>, |
| 56 | 59 | #[knuffel(child)] |
| 57 | 60 | pub disable_resize_throttling: Option<Flag>, |
| @@ -85,6 +88,7 @@ impl MergeWith<DebugPart> for Debug { | ||
| 85 | 88 | restrict_primary_scanout_to_matching_format, |
| 86 | 89 | force_disable_connectors_on_resume, |
| 87 | 90 | force_pipewire_invalid_modifier, |
| 91 | + disable_pipewire_dmabuf, | |
| 88 | 92 | emulate_zero_presentation_time, |
| 89 | 93 | disable_resize_throttling, |
| 90 | 94 | disable_transactions, |
niri-config/src/lib.rsmodified+1 -0
| @@ -2290,6 +2290,7 @@ mod tests { | ||
| 2290 | 2290 | "/dev/dri/renderD130", |
| 2291 | 2291 | ], |
| 2292 | 2292 | force_pipewire_invalid_modifier: false, |
| 2293 | + disable_pipewire_dmabuf: false, | |
| 2293 | 2294 | emulate_zero_presentation_time: false, |
| 2294 | 2295 | disable_resize_throttling: false, |
| 2295 | 2296 | disable_transactions: false, |
src/screencasting/mod.rsmodified+4 -0
| @@ -87,6 +87,10 @@ impl State { | ||
| 87 | 87 | self.niri.casting.pipewire = Some(pw); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | + if self.niri.config.borrow().debug.disable_pipewire_dmabuf { | |
| 91 | + return Ok(None); | |
| 92 | + } | |
| 93 | + | |
| 90 | 94 | let Some(gbm) = self.backend.gbm_device() else { |
| 91 | 95 | // We will offer shm only. |
| 92 | 96 | return Ok(None); |