Skip to content

Respect disable-direct-scanout in DMA-BUF feedback#3913

Open
ewgdg wants to merge 1 commit into
niri-wm:mainfrom
ewgdg:fix/disable-scanout-feedback-with-direct-scanout
Open

Respect disable-direct-scanout in DMA-BUF feedback#3913
ewgdg wants to merge 1 commit into
niri-wm:mainfrom
ewgdg:fix/disable-scanout-feedback-with-direct-scanout

Conversation

@ewgdg
Copy link
Copy Markdown

@ewgdg ewgdg commented Apr 27, 2026

debug { disable-direct-scanout } should disable scanout path consistently, not only final direct-scanout attempt.

When direct scanout is disabled, advertising scanout-preferred DMA-BUF tranches no longer provides the intended benefit, but can still make clients choose scanout-oriented allocations.

This also intentionally keeps the regular render feedback render-only, even when the output is on the primary render node. Previously, in that case, niri reused the scanout feedback as the render feedback:

let render = if surface_render_node == Some(primary_render_node) {
    scanout.clone()
} else {
    builder.build()?
};

That made the default/render path contain scanout tranches too on the primary render node. As a result, Smithay's select_dmabuf_feedback() could not meaningfully choose between render feedback and scanout feedback, because both choices advertised scanout-oriented allocations.

This makes scanout feedback less aggressive in general: composited surfaces keep render-oriented feedback, while Smithay can still advertise scanout feedback for surfaces that are actually zero-copy candidates or failed scanout due to buffer properties.

@ewgdg ewgdg marked this pull request as ready for review April 27, 2026 04:08
@Sempyos Sempyos added area:config Config parsing, default config, new settings pr kind:fix Issue fixes, code cleanups labels Apr 27, 2026
@ewgdg ewgdg marked this pull request as draft April 28, 2026 03:33
@ewgdg ewgdg force-pushed the fix/disable-scanout-feedback-with-direct-scanout branch from 0060b92 to 38167d3 Compare April 28, 2026 05:19
@ewgdg ewgdg marked this pull request as ready for review April 28, 2026 05:20
@ewgdg ewgdg force-pushed the fix/disable-scanout-feedback-with-direct-scanout branch from 38167d3 to 159e1e3 Compare April 28, 2026 05:23
@ewgdg ewgdg force-pushed the fix/disable-scanout-feedback-with-direct-scanout branch from 159e1e3 to 7c22450 Compare April 28, 2026 08:42
@ewgdg ewgdg changed the title fix: suppress scanout feedback when direct scanout is disabled Respect disable-direct-scanout in DMA-BUF feedback May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:config Config parsing, default config, new settings pr kind:fix Issue fixes, code cleanups

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants