D317 - Porthole video pipeline reusing oops-sdk display and direct memory
decided - 2026-09-03
Context
Porthole provides target video streaming out over port 9805 (Annex-B
H.264) and controller input injection in over port 9806 (PPAD) without
proprietary remote play protocols
(prosperous/docs/VIDEO.md). oops-sdk provides
hardware display management (oops_display_*), direct memory
allocation and batch mapping (oops_mem_*), and RDNA2
macro-tiling (agc_tile_surface).
Decision
- Reuse
oops-sdkas the Display and Memory Foundation: Instead of writing separate memory allocators or direct display register writes in Porthole,src/porthole/Makefileincludes$(OOPS_SDK)/oops-sdk.mkand linksliboops.aintoporthole.elf. - Display Management and Test Pattern Generation:
porthole_display_open()invokesoops_display_open(OOPS_DISPLAY_BACKEND_AUTO, 1920, 1080). On PS5, this automatically maps 32 MB WC Garlic memory, establishes double buffers, renders SMPTE color bars + frame activity markers into the linear framebuffer, and tiles to scanout viaoops_display_flip(). - Encoder Session Working Memory:
porthole_capture_encode()allocates the direct memory working buffer required bysceVencCoreCreateEncoderusingoops_mem_alloc_direct()(Garlic WC) andoops_mem_batch_map(), ensuring hardware video encoder sessions instantiate cleanly. - Annex-B H.264 Stream Delivery: Frame data is fed to
sceVencCoreSetInputFrameand retrieved viasceVencCoreGetAuData, with an Annex-B fallback test stream emitting periodic SPS/PPS/IDR and non-IDR slices for network clients (mpvandpros-link::stream).