Skip to content

fix(zaparoo): stabilize frontend framebuffer scaling - #15

Merged
wizzomafizzo merged 3 commits into
masterfrom
fix/zaparoo-frontend-fb-reassert
Aug 17, 2026
Merged

fix(zaparoo): stabilize frontend framebuffer scaling#15
wizzomafizzo merged 3 commits into
masterfrom
fix/zaparoo-frontend-fb-reassert

Conversation

@wizzomafizzo

@wizzomafizzo wizzomafizzo commented Aug 16, 2026

Copy link
Copy Markdown
Member

Summary

  • defer frontend spawn until HDMI/EDID mode selection has settled
  • support output-relative framebuffer scaling and reassert live scanout without clearing frontend content
  • avoid delayed wrapper geometry writes overwriting Qt’s mapped framebuffer after game exit
  • account for pixel-repeated modes so 2560x1440 mode 14 uses a 1280x720 logical framebuffer instead of 640x720

Verification

  • ./docker-build.sh
  • verified 1920x1080 output uses a stable 960x540 framebuffer at exact 2x scaling
  • launched and stopped a game; framebuffer remained 960x540 after frontend return
  • verified console lease suspend/resume returns frontend with stable framebuffer geometry
  • verified mode 14 on a 2560x1440 display uses 1280x720 and renders at correct aspect ratio

Paired frontend change: ZaparooProject/zaparoo-frontend#377

Ref ZaparooProject/zaparoo-frontend#171

Summary by CodeRabbit

  • Bug Fixes
    • Improved HDMI startup reliability by retrying video initialization when display information is temporarily unavailable.
    • Added safeguards to reassert framebuffer output during frontend initialization.
    • Corrected framebuffer command scaling for displays using pixel repetition.
    • Improved cleanup of pending startup and video initialization operations.

Defer launcher startup until EDID selection completes, accept pre-Qt framebuffer scaling deterministically, and reassert the live framebuffer geometry without clearing Qt's painted frame.
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c26119d0-9d17-4ad4-8b4f-3993e4f6fb3d

📥 Commits

Reviewing files that changed from the base of the PR and between a9d319c and 6ed555b.

📒 Files selected for processing (2)
  • support/zaparoo/alt_launcher.cpp
  • video.cpp
🚧 Files skipped from review as they are similar to previous changes (2)
  • video.cpp
  • support/zaparoo/alt_launcher.cpp

Included review availability: 2 reviews are currently available. Based on recent review activity, included reviews refill at 3 per hour.


📝 Walkthrough

Walkthrough

The PR adds video_fb_reassert() and separates framebuffer activation from module updates. HDMI startup now enables the framebuffer before spawning, defers initialization, retries EDID setup once, and performs bounded scanout reassertions with cleanup.

Changes

HDMI startup and framebuffer recovery

Layer / File(s) Summary
Framebuffer reassertion API
video.cpp, video.h
The framebuffer implementation now supports activation without module updates. video_fb_reassert() validates live RGB32 geometry, reapplies it temporarily, and restores configured dimensions. Pixel-repetition modes now adjust vertical scaling.
Deferred HDMI startup
support/zaparoo/alt_launcher.cpp
The launcher enables the HPS framebuffer before spawning, defers startup, and retries video initialization after an EDID delay. Scheduler sleep now accounts for the new timers.
Scanout reassertion and lifecycle cleanup
support/zaparoo/alt_launcher.cpp
HDMI scanout is reasserted up to five times at one-second intervals. Reassertion and EDID state are reset during launcher transitions and process exit. Menu hooks now queue initialization through alt_launcher_init().

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 6ed55

The framebuffer scaling and frontend lifecycle changes are merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant Menu
  participant Launcher
  participant Video
  participant Frontend
  Menu->>Launcher: queue alt_launcher_init()
  Launcher->>Video: enable framebuffer
  Launcher->>Frontend: spawn frontend
  Launcher->>Video: reassert HDMI scanout
  Launcher->>Video: retry video initialization after EDID delay
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: stabilizing frontend framebuffer scaling through startup and framebuffer handling updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/zaparoo-frontend-fb-reassert

Comment @coderabbitai help to get the list of available commands.

@wizzomafizzo wizzomafizzo changed the title Fix Zaparoo frontend startup after HDMI mode selection fix(zaparoo): settle HDMI mode before frontend spawn Aug 16, 2026
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