Files
RedBear-OS/drivers/graphics
Red Bear OS f3a607a090 ihdgd: replace hardcoded watermark with resolution-based formula
Replaced the hardcoded 'TODO: correct watermark calculation'
with a resolution-aware formula:

  wm_lines = clamp(vdisplay / 16, 8, 128)

Reads vdisplay from the PLANE_SIZE register (bits 16-31) and
computes the display FIFO prefetch depth. Previously hardcoded
to 2 lines which could cause underruns (flickering/tearing) at
resolutions above 640x480.

Intel PRM minimum: 8 lines for 1080p display-only planes.
Formula: 1080/16 = 67 lines at 1080p, 90 lines at 1440p,
135 lines at 2160p (4K). Capped at 128 lines (5-bit WM field).

Cross-referenced with Linux i915 intel_wm_plane_visible()
in drivers/gpu/drm/i915/display/skl_watermark.c.
2026-07-09 15:41:59 +03:00
..