Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Refactor: Improve UEFI GOP Mode Selection Logic and Configuration

Đang mở
#534 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
30/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
rust

Hướng nghiên cứu

Bắt đầu tại uefi/src/main.rs ở init_logger và theo dõi việc lọc chế độ GOP hiện tại cùng các đầu vào cấu hình. Làm rõ preset, tỷ lệ khung hình, giá trị tối thiểu, giá trị tối đa và hành vi EDID mong muốn trước khi thay đổi chiến lược lựa chọn; công việc được hoàn tất khi bao gồm hành vi best-fit đã thống nhất và phạm vi bao phủ cho các trường hợp fallback được chỉ định.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Rust
Star
1.7k
Fork
240
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rust-osdev/bootloader

Tất cả issue của rust-osdev/bootloader

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.