Refactor: Improve UEFI GOP Mode Selection Logic and Configuration
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 30/100
- Issue-Typ
- Refactoring
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- rust
- Bereich
- computer-graphics, operating-systems
Rechercherichtung
Beginne in uefi/src/main.rs bei init_logger und verfolge die aktuelle GOP-Modusfilterung sowie die Konfigurationseingaben. Kläre die gewünschte Voreinstellung, das Seitenverhältnis, das Minimum, das Maximum und das EDID-Verhalten, bevor du die Auswahlstrategie änderst; als erledigt sollte die Aufgabe das vereinbarte Best-Fit-Verhalten und die Abdeckung der angegebenen Fallback-Fälle umfassen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Current Behavior
In the current implementation within uefi/src/main.rs -> init_logger, the GOP (Graphics Output Protocol) mode selection relies on a simple filter-and-last strategy:
modes.filter(|m| resolution_meets_minimum).last()
This approach leads to inconsistent experiences across different environments:
- Default/Fallback Issue: When no minimum requirements are set, QEMU defaults to a reasonable 1280x800, but my real hardware often falls back to a legacy 800x600 (SVGA), which is insufficient for modern logging.
- "Last Fit" Bias: When minimum requirements are specified (e.g., 1080p), the code picks the last mode in the list. On high-end displays, this often results in the maximum supported resolution (e.g., 2560x1600 or 3840x2160), which might not be the intended "best" resolution for a bootloader or kernel log.
Proposed Improvement
I suggest introducing a more robust selection mechanism that supports Preferred Resolutions and Aspect Ratio Filtering.
- Predefined Presets: Instead of raw pixel values, allow users to specify common targets like 720p, 1080p, or 2K.
- Aspect Ratio Awareness: Support filtering by ratios such as 16:9, 16:10, or 4:3.
- Optimal Selection Strategy:Find the Closest Match to a target resolution.If no exact match exists, fallback to the highest resolution within a specific aspect ratio.Implement a "Best Fit" instead of "Last Fit" (e.g., preference for (1920\times 1080) over (2560\times 1600) if the user targets FHD).
- Add Maximum Constraint: With only minimum constraints, sometimes it will lead to maximum values. Add maximum constraint to avoid that.
- EDID: I'm not familiar with UEFI EDID. I know this just form some simple lookup. this might be helpful.
Summary
I think adding maximum constraints and using min_by_key abs_diff or thing else to replace last strategy are easy to implement and solve this problem.
Suggested Labels: enhancement, area/uefi
- Vorherrschende Sprache
- Rust
- Sterne
- 1.7k
- Forks
- 241
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus rust-osdev/bootloader
-
help wanted
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 67/100
rust-osdev/bootloader#581 · 2 Kommentare ·
-
No boot on real hardwareOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
rust-osdev/bootloader#573 · 5 Kommentare ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
rust-osdev/bootloader#555 · 2 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 38/100
rust-osdev/bootloader#525 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
rust-osdev/bootloader#514 · 3 Kommentare ·
Alle Issues in rust-osdev/bootloader
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
home-assistant/installer#308 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
swc-project/swc-next#1053 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
nautechsystems/nautilus_trader#5387 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
NomicFoundation/edr#1872 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
linebender/resvg#1179 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen