Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Refactor: Improve UEFI GOP Mode Selection Logic and Configuration

Aperta
#534 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
rust

Direzione di ricerca

Inizia in uefi/src/main.rs, da init_logger, e traccia l’attuale filtraggio delle modalità GOP e degli input di configurazione. Chiarisci il preset, le proporzioni, il minimo, il massimo e il comportamento EDID desiderati prima di modificare la strategia di selezione; il lavoro sarà completato quando includerà il comportamento best-fit concordato e la copertura dei casi di fallback specificati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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:

  1. 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.
  2. "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. 

  1. Predefined Presets: Instead of raw pixel values, allow users to specify common targets like 720p, 1080p, or 2K.
  2. Aspect Ratio Awareness: Support filtering by ratios such as 16:9, 16:10, or 4:3.
  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).
  4. Add Maximum Constraint: With only minimum constraints, sometimes it will lead to maximum values. Add maximum constraint to avoid that.
  5. 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

Lingua principale
Rust
Stelle
1.7k
Fork
240
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-osdev/bootloader

Tutte le issue di rust-osdev/bootloader

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.