code wiki / _hdl_build / nx_gop_present.nx
nx_gop_present.nx
buildroot/runtime/_hdl_build/nx_gop_present.nx
about
nx_gop_present.nx -- LIB: the UEFI GOP linear-framebuffer PRESENTATION SINK (the x86 on-metal display path).
SF1/SF2/SF4 put pixels on the sovereign SILICON (fabric + behavioral RV64IM). This is the OTHER half of
"both": delivering the games' framebuffer to a REAL x86 screen via the UEFI Graphics Output Protocol's
linear framebuffer -- the destination the nx_swapchain roadmap queued as NX_SWAP_DEST_KMS_DIRECT /
NX_SWAP_DEST_NISHI_OS (honestly stubbed NOT_IMPL there). This is that backend, implemented.
A GOP linear framebuffer (EFI_GRAPHICS_OUTPUT_PROTOCOL->Mode->FrameBufferBase) is 32 bits/pixel with:
- a STRIDE in PIXELS (PixelsPerScanLine) that may EXCEED the visible width -> rows are padded; writing
`width` pixels per row instead of advancing by `pitch` shears the image (the swapchain hazard
"stride-vs-width-confusion").
- a PIXEL FORMAT: PixelRedGreenBlueReserved8BitPerColor (RGBX) or, the common one on real HW / OVMF /
QEMU, PixelBlueGreenRedReserved8BitPerColor (BGRX) -- writing the wrong channel order swaps red/blue
(the hazard "rgba-vs-rgb-channel-order"). BitMask / BltOnly are honestly refused (NOT_IMPL), never a
silent no-op (the hazard "silent-stub-no-op").
NEVER-BRICK (#26): a pixel BLIT to a GOP linear framebuffer is volatile VRAM = a `gui`-axis capability
that cannot corrupt firmware/CMOS/NVRAM BY CONSTRUCTION. (The GOP MODE-SET -- SetMode, which picks the
resolution -- is the firmware-adjacent part; that is a SEPARATE rung registered firmware-axis with an
idempotent / read-back-verify / never-flash guarantee. This sink only BLITS into an already-configured
framebuffer.) Bounded (exactly w*h pixel writes), total, deterministic.
license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_game_display_gate.nxnx_gop_present_gate.nx
structs
| none |
consts
| 25 | const NX_GOP_FMT_RGBX: i64 = 0 // PixelRedGreenBlueReserved8BitPerColor |
| 26 | const NX_GOP_FMT_BGRX: i64 = 1 // PixelBlueGreenRedReserved8BitPerColor (common on real HW / OVMF) |
| 29 | const NX_GOP_ERR_BAD_SIZE: i64 = -101 |
| 30 | const NX_GOP_ERR_NOT_IMPL: i64 = -103 |
functions
| 37 | func nx_gop_present(fb: *i64, w: i64, h: i64, lfb: *u8, pitch_px: i64, pixfmt: i64) -> i64 |