Skip to content

V3DRender 0.26

Choose a tag to compare

@adyoull adyoull released this 22 Nov 20:45
· 13 commits to main since this release

V3DRender 0.26

A native RISC OS driver for the Raspberry Pi 4's GPU (Broadcom V3D 4.2), following Linux's v3d driver. Programs reach it through RISC3D.

This release covers everything since 0.16, the last one published: 0.17 to 0.26. The big new feature is desktop 2D on the GPU, which is Rob Heaton's V3DDriver acceleration written again inside V3DRender. It also fixes the web browser's corrupted GPU drawing and makes buffers cheaper to create.

Benchmark: RISCOSmark

RISCOSmark 2.06 on the owner's Pi 4, 22 November 2026:

  • native RISC OS 5.31, ARM at 1800 MHz;
  • 1920x1200 in 16M colours, SDFS;
  • run once with *V3DRender 2D off and once with it on, one run each.
Test 2D off 2D on
Rectangle Copy - graphics acceleration 519 (214%) 3,679 (1520%) 7.1x
Icon Plotting - 16 colour sprite with mask 23,304 (1165%) 26,119 (1305%) +12%

Percentages are of RISCOSmark's RiscPC baseline (StrongARM 202 MHz, RISC OS 4.02, 800x600 in 256 colours).

  • Only Rectangle Copy uses the GPU. It is OS_Plot 190, a 301x237 block copy, which the kernel offers to GraphicsV 13. Every copy of that size is the GPU's.
  • Icon Plotting and the Draw tests don't use it. Icon Plotting is OS_SpriteOp, and the Draw module draws through the kernel's line routine directly, so neither goes through GraphicsV and the GPU can't change them. Their small differences, and FS Write's, are most likely the run-to-run spread; one run each can't tell.
  • Compared with Rob's driver: Rob's V3DDriver 0.11 went from 1,333 to 7,750 (5.8x) in RISCOSmark 2.04 at 1920x1080. The figures aren't directly comparable: different version, smaller screen.

Measured on the Pi (0.19, Time2D, 1920x1200 at 32bpp)

  • V3DRender's own cost: about 5 us an op. Building the list takes under 1 us and submitting it 1 us.
  • The GPU's job: about 5 us plus 4 us a 64x64 tile. The V3D clock (250 or 500 MHz) makes no difference.
  • Large copies and fills are limited by memory bandwidth. The GPU is 1.3 to 2 times the CPU, which copies the screen at about 4 GB/s itself. It is level with the CPU at 16x16 and ahead above that.
  • Not waited for (2D async): a copy or fill costs the caller 4 to 7 us, whatever its size.
  • Correct on hardware: Desk2D's copies, scrolls (overlapping copies) and fills at 32 and 16bpp, waited for and not, are pixel-identical to the CPU's.

New since 0.16

Desktop copies and fills on the GPU (0.17-0.19, 0.21)

  • Copies (GraphicsV 13 op 1): window moves, scrolls and OS_Plot block copies. Each copy is one render-only job: load the tile buffer from the source and store it to the destination, tile by tile. Scrolls take one pass, visiting the tiles ahead of the move first (Rob's order).
  • Solid fills (op 2): the tile buffer is cleared once, and every tile then only stores it. That is half the GPU commands of clearing each tile. Patterned fills and other GCOL actions are left to the CPU.
  • Both screen depths: 32bpp (RGBA8) and the Pi's 16bpp (RGB565).
  • The screen is mapped into the GPU once a mode, in 1 MB pages. Bank flips through GraphicsV 6 cost nothing, and the mapping is forgotten at a mode change.
  • Lists built a word at a time into one 128 KB buffer, kept for good.
  • Not waited for: up to four lists are in flight at once.
  • Size limits measured on this driver: the CPU does copies under 1,024 bytes or 8 rows and fills under 4,096 bytes or 16 rows. *V3DRender 2D limits changes them.
  • Left to the CPU:
    • when hardware acceleration is off;
    • when the screen is cached by the CPU;
    • when interrupts are off;
    • (0.21) while a program has the GPU open, until the browser's report is fully closed (*V3DRender 2D alongside on allows it for testing).
  • Commands:
    • *V3DRender 2D on|async|off, 2D fills on|off, 2D limits, 2D zero;
    • at load: the 2D or 2DAsync option, or V3DRender$2D;
    • *V3DRender shows what was taken, what was left to the CPU and why, and the microseconds per op.
  • Off by default.

The web browser's broken GPU drawing, fixed (0.23)

  • The cause: RISC OS can move the physical pages of memory a program has imported into the GPU, for example when another dynamic area asks for specific pages. The GPU went on writing the old pages, which now belonged to someone else.
  • The fix: V3DRender now follows Service_PagesUnsafe and PagesSafe, in their 32- and 64-bit forms. It holds new jobs while a page moves, then rewrites the GPU's page table.
  • Confirmed on the Pi with the browser: 404,818 jobs; no timeouts, resets or MMU errors; 2,347 page moves followed.

Buffers cheaper to create (0.25)

  • A freed buffer's pages stay claimed, up to 16 MB, while a program has the GPU open. The next buffer that fits uses them with no RISC OS call. The browser's profile had found buffer creation the largest item in the GPU library.
  • New buffers are still zeroed, now in 64-byte bursts.
  • *V3DRender pool <MB> sets the limit (0 keeps none). *V3DRender shows how much is kept and what buffer creation costs.

Safety (0.20, 0.22, 0.24, 0.26)

  • (0.26) No RISC OS memory is claimed or freed inside a GraphicsV call. Each such call tells the Wimp memory moved in the middle of its redraw; Rob found that froze V3DDriver with the Task Manager open. The work is done from a callback afterwards.
  • (0.26) Cleaning the GPU's caches waits for a pending L2T flush first, as Linux now does (Broadcom erratum GFXH-1897).
  • (0.20) The V3D's power domain is turned on before any V3D register is read. This is a likely cause of a CM4 aborting at start-up.
  • (0.24) V3DRender$Step records how far start-up got. A start-up that fails part way is undone safely, and the interrupt handler never runs before the GPU is set up.
  • (0.22) *V3DRender no longer aborts when showing an MMU error.

For RISC3D (0.20)

  • Configure's RISC3D window shows the GPU, its clock, its memory, the largest image and the 2D state without a program running (RISC3D reason 4).

See CHANGELOG.md for the details of each version.

Tests

  • Host simulator: 2,129 checks, including 800 random copies and 600 random fills carried out tile by tile against the CPU's result.
  • The built module in an emulator: 54,154 checks.
  • Test kit (29): Check, Desk2D (2D correctness, CPU against GPU) and Time2D (2D timings).

Downloads

  • V3DRender-0.26.zip: the module, with its licence and notice.
  • V3DRenderTest-29.zip: the test kit.

Requirements

  • A Raspberry Pi 4, Pi 400 or CM4 with RISC OS 5.30 or later.
  • RISC3D 0.05 or later; reason 4 needs 0.09. Programs reach the GPU through RISC3D only.
  • Rob Heaton's V3DDriver not loaded: V3DRender does its 2D work itself.

SWI chunk &5AFC0 and error block &823E00, allocated by RISC OS Open.

Licence

GNU GPL version 2 or later, as the Linux v3d driver it follows. The desktop 2D code follows Rob Heaton's V3DDriver (GPL-2.0-or-later). See NOTICE.