aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / scripts / gpu_bench / STEP1_display_flip.bench
| 1 | # STEP1_display_flip.bench -- DCE 11.2 page flip, console form (ck_gpu_bench, feat/imac-gpu-bench). |
| 2 | # Indices are BAR5 DWORD indices (byte offset / 4); the byte offset is in each comment. |
| 3 | # Register numbers: native/kernel/gpu/amd_gpu_regs.h (dce_11_2_d.h). |
| 4 | # |
| 5 | # WRITE ALLOWLIST: the writes below (0x1a04-0x1a12, GRPH controller 0) must be inside the |
| 6 | # console's BAR5 write allowlist. feat/imac-gpu-bench allowlists GRPH 0x1a04-0x1a12 (DCP0). |
| 7 | # scripts/gpu_bench/check_regs.sh checks every index here against AMD's headers. |
| 8 | |
| 9 | # Confirm CRTC 0 and the current scanout |
| 10 | # mmCRTC_STATUS, byte 0x6E8C; bit 0 = in vblank |
| 11 | bar5_read 0x1ba3 |
| 12 | # mmGRPH_PRIMARY_SURFACE_ADDRESS, byte 0x6810 (front buffer PA lo) |
| 13 | bar5_read 0x1a04 |
| 14 | # mmGRPH_PRIMARY_SURFACE_ADDRESS_HIGH, byte 0x681C |
| 15 | bar5_read 0x1a07 |
| 16 | # mmGRPH_FLIP_CONTROL, byte 0x6848 |
| 17 | bar5_read 0x1a12 |
| 18 | # mmGRPH_UPDATE, byte 0x6844 (lock bits) |
| 19 | bar5_read 0x1a11 |
| 20 | |
| 21 | # Program the back buffer flip (back buffer = BAR0 + 0x2400000; example BAR0 0xc0000000 -> 0xc2400000) |
| 22 | # mmGRPH_UPDATE, byte 0x6844; GRPH_UPDATE_LOCK is bit 16 (dce_11_2_sh_mask.h:6351) |
| 23 | bar5_write 0x1a11 0x10000 |
| 24 | # mmGRPH_FLIP_CONTROL, byte 0x6848; both bits clear = flip at vblank (retrace bit 0, immediate bit 4) |
| 25 | bar5_write 0x1a12 0x0 |
| 26 | # mmGRPH_PRIMARY_SURFACE_ADDRESS_HIGH, byte 0x681C (bits 39:32) |
| 27 | bar5_write 0x1a07 0x0 |
| 28 | # mmGRPH_PRIMARY_SURFACE_ADDRESS, byte 0x6810 = back buffer |
| 29 | bar5_write 0x1a04 0xc2400000 |
| 30 | # mmGRPH_UPDATE, byte 0x6844 = unlock |
| 31 | bar5_write 0x1a11 0x0 |
| 32 | |
| 33 | # Wait for the flip to land (GRPH_SURFACE_UPDATE_PENDING, bit 2 = 0x4, clears) |
| 34 | # mmGRPH_UPDATE, byte 0x6844 |
| 35 | bar5_poll 0x1a11 0x4 0x0 50 |
| 36 | |
| 37 | # Read back |
| 38 | # should read 0xc2400000 |
| 39 | bar5_read 0x1a04 |
| 40 | # should read 0x0 |
| 41 | bar5_read 0x1a07 |