Skip to content

visionipc: use the upstream kernel's DMA-BUF heaps - #724

Open
adeebshihadeh wants to merge 1 commit into
masterfrom
mainline-kernel
Open

adeebshihadeh wants to merge 1 commit into
masterfrom
mainline-kernel

Conversation

@adeebshihadeh

Copy link
Copy Markdown
Contributor

No description provided.

The upstream kernel AGNOS is moving to has no ION, so on comma devices
VisionIPC buffers now come from /dev/dma_heap/system. The DMA-BUF fds are
passed like ION's, and the ISP, Venus and the GPU import them directly.
The downstream kernel is no longer supported.

- visionbuf_dmabuf.cc replaces visionbuf_ion.cc, picked at build time on
  AGNOS like ION was; shared memory everywhere else, as before. The ION
  handle goes from VisionBuf.
- DMA-BUF needs every CPU access bracketed with DMA_BUF_IOCTL_SYNC, so
  VisionBuf gets begin_cpu_access(write)/end_cpu_access(write). Only the
  needed direction is synced (each sync is cache maintenance over the
  whole buffer per attached device, 0.25-0.37 ms per road frame): reads
  invalidate at the start, writes clean at the end.
  begin_cpu_read(start, length) invalidates just the lines a partial read
  touches with DC CIVAC on arm64 (camerad's auto exposure: 5.3% -> 3.8% of
  a core). sync() is now a no-op.
- Python: begin_cpu_access/begin_cpu_read/end_cpu_access (OSError on a
  failed sync), and VisionIpcServer.send brackets its copy.
- visionbuf test_runner covers allocation, fd import and CPU access.
@adeebshihadeh adeebshihadeh changed the title visionipc: support the upstream kernel's DMA-BUF heaps visionipc: use the upstream kernel's DMA-BUF heaps Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant