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 | ignore-drm-device "/dev/dri/renderD128" | 22 | ignore-drm-device "/dev/dri/renderD128" |
| 23 | ignore-drm-device "/dev/dri/renderD130" | 23 | ignore-drm-device "/dev/dri/renderD130" |
| 24 | force-pipewire-invalid-modifier | 24 | force-pipewire-invalid-modifier |
| 25 | + disable-pipewire-dmabuf | ||
| 25 | dbus-interfaces-in-non-session-instances | 26 | dbus-interfaces-in-non-session-instances |
| 26 | wait-for-frame-completion-before-queueing | 27 | wait-for-frame-completion-before-queueing |
| 27 | emulate-zero-presentation-time | 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 | ### `dbus-interfaces-in-non-session-instances` | 177 | ### `dbus-interfaces-in-non-session-instances` |
| 165 | 178 | ||
| 166 | Make niri create its D-Bus interfaces even if it's not running as a `--session`. | 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 | pub render_drm_device: Option<PathBuf>, | 15 | pub render_drm_device: Option<PathBuf>, |
| 16 | pub ignored_drm_devices: Vec<PathBuf>, | 16 | pub ignored_drm_devices: Vec<PathBuf>, |
| 17 | pub force_pipewire_invalid_modifier: bool, | 17 | pub force_pipewire_invalid_modifier: bool, |
| 18 | + pub disable_pipewire_dmabuf: bool, | ||
| 18 | pub emulate_zero_presentation_time: bool, | 19 | pub emulate_zero_presentation_time: bool, |
| 19 | pub disable_resize_throttling: bool, | 20 | pub disable_resize_throttling: bool, |
| 20 | pub disable_transactions: bool, | 21 | pub disable_transactions: bool, |
| @@ -52,6 +53,8 @@ pub struct DebugPart { | |||
| 52 | #[knuffel(child)] | 53 | #[knuffel(child)] |
| 53 | pub force_pipewire_invalid_modifier: Option<Flag>, | 54 | pub force_pipewire_invalid_modifier: Option<Flag>, |
| 54 | #[knuffel(child)] | 55 | #[knuffel(child)] |
| 56 | + pub disable_pipewire_dmabuf: Option<Flag>, | ||
| 57 | + #[knuffel(child)] | ||
| 55 | pub emulate_zero_presentation_time: Option<Flag>, | 58 | pub emulate_zero_presentation_time: Option<Flag>, |
| 56 | #[knuffel(child)] | 59 | #[knuffel(child)] |
| 57 | pub disable_resize_throttling: Option<Flag>, | 60 | pub disable_resize_throttling: Option<Flag>, |
| @@ -85,6 +88,7 @@ impl MergeWith<DebugPart> for Debug { | |||
| 85 | restrict_primary_scanout_to_matching_format, | 88 | restrict_primary_scanout_to_matching_format, |
| 86 | force_disable_connectors_on_resume, | 89 | force_disable_connectors_on_resume, |
| 87 | force_pipewire_invalid_modifier, | 90 | force_pipewire_invalid_modifier, |
| 91 | + disable_pipewire_dmabuf, | ||
| 88 | emulate_zero_presentation_time, | 92 | emulate_zero_presentation_time, |
| 89 | disable_resize_throttling, | 93 | disable_resize_throttling, |
| 90 | disable_transactions, | 94 | disable_transactions, |
niri-config/src/lib.rsmodified+1 -0
| @@ -2290,6 +2290,7 @@ mod tests { | |||
| 2290 | "/dev/dri/renderD130", | 2290 | "/dev/dri/renderD130", |
| 2291 | ], | 2291 | ], |
| 2292 | force_pipewire_invalid_modifier: false, | 2292 | force_pipewire_invalid_modifier: false, |
| 2293 | + disable_pipewire_dmabuf: false, | ||
| 2293 | emulate_zero_presentation_time: false, | 2294 | emulate_zero_presentation_time: false, |
| 2294 | disable_resize_throttling: false, | 2295 | disable_resize_throttling: false, |
| 2295 | disable_transactions: false, | 2296 | disable_transactions: false, |
src/screencasting/mod.rsmodified+4 -0
| @@ -87,6 +87,10 @@ impl State { | |||
| 87 | self.niri.casting.pipewire = Some(pw); | 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 | let Some(gbm) = self.backend.gbm_device() else { | 94 | let Some(gbm) = self.backend.gbm_device() else { |
| 91 | // We will offer shm only. | 95 | // We will offer shm only. |
| 92 | return Ok(None); | 96 | return Ok(None); |