Refactor: Improve UEFI GOP Mode Selection Logic and Configuration
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 重构
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- rust
调研方向
从 uefi/src/main.rs 的 init_logger 开始,跟踪当前的 GOP 模式筛选和配置输入。在更改选择策略之前,明确所需的预设、宽高比、最小值、最大值和 EDID 行为;完成标准应包括已达成一致的最佳匹配行为,以及对指定回退情况的覆盖。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Rust
- 星标
- 1.7k
- 派生
- 240
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rust-osdev/bootloader 的其他 Issue
-
help wanted
难度 3/5 1-2 天 新手友好度 67/100
rust-osdev/bootloader#581 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
rust-osdev/bootloader#573 · 5 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
rust-osdev/bootloader#555 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 38/100
rust-osdev/bootloader#525 ·
-
难度 4/5 3-5 天 新手友好度 45/100
rust-osdev/bootloader#514 · 3 条评论 ·
查看 rust-osdev/bootloader 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
vercel-labs/agent-browser#2017 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
tursodatabase/turso#9405 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
PolyMeilex/Neothesia#447 ·
维护者通常 1 天内回复
-
backend::vllm diffusion multimodal
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
trezor/trezor-firmware#7985 ·
维护者通常 2 天内回复