Skip to content

Add synthetic panel-fit fallback modes - #2780

Open
inducer wants to merge 1 commit into
pop-os:masterfrom
inducer:feat/upscaled-modes
Open

Add synthetic panel-fit fallback modes#2780
inducer wants to merge 1 commit into
pop-os:masterfrom
inducer:feat/upscaled-modes

Conversation

@inducer

@inducer inducer commented Aug 25, 2026

Copy link
Copy Markdown

A word of Warning/an Apology

Vibe-coded PR ahead. In preparing this, the AI used the Mutter source code (also GPL-3) as a reference.

I'm submitting it because it may solve a real issue for someone else, and it works for me. The code itself may be iffy. For example, it seems odd that it has to "reach around" smithay's KMS interaction code by going directly to drm-ffi. Buyer beware, OK to close if you don't like it; it'll still be discoverable. If you do close it, I will likely come back with a bug report requesting the same feature.

What is being fixed here

I have a high-resolution laptop panel (3840x2400). As part of my work, I need to share my full screen on which an inking app runs. Both the screen sharing and the note taking app bog down and become too slow to be usable at the full panel resolution. Half-resolution meanwhile (1920x1200) is no problem. My panel does not offer a native 1920x1200 mode, but it does support upscaling. Gnome offers a synthetic mode along those lines. Cosmic settings only provides the full panel resolution.

I made this by having an AI investigate what Mutter does and cloning the relevant behavior in cosmic-comp. I'm using it now, and it seems to do what I need.

Checklist

  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • MAYBE I understand these changes in full and will be able to respond to review comments.
  • I THINK My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

Generate conservative CVT reduced-blanking fallback modes for connectors
that support aspect-preserving hardware panel scaling.

Fallback modes are filtered against real connector capabilities, including
dimensions, pixel clock, timing-derived refresh rate, tiled-output status,
and eDP mixed-mode safety. They are advertised through the normal Smithay
output mode path, persisted by size/refresh, and resolved back to complete
DRM timings during modesets.

When a synthetic mode is selected, configure the connector for `Full aspect`
scaling and submit the generated timing as the real CRTC MODE_ID, allowing
the compositor to render a lower-resolution framebuffer while panel fitting
expands it to the native display.

Add unit coverage for CVT-RB timings, eligibility, filtering, orientation,
preferred-mode behavior, and persisted synthetic mode resolution.

Assisted-by: Zed:gpt-5.6-terra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant