Skip to content

Conversation

@obiwac
Copy link
Contributor

@obiwac obiwac commented Jan 15, 2026

struct files are checked for the FREAD or FWRITE flags when calling ioctl() on them. DMA-BUFs didn't have these set, without which DMA_BUF_IOCTL_SYNC cannot work.

I ran into this when working on implementing DMA_BUF_IOCTL_EXPORT_SYNC_FILE and DMA_BUF_IOCTL_IMPORT_SYNC_FILE, but I couldn't find any software on FreeBSD which actually uses the DMA_BUF_IOCTL_SYNC ioctl already which I could use to test this. Does anyone know of any?

@emersion
Copy link
Contributor

I couldn't find any software on FreeBSD which actually uses the DMA_BUF_IOCTL_SYNC ioctl already which I could use to test this. Does anyone know of any?

ffmpeg does when mmap'ing DMA-BUFs:

> git grep DMA_BUF_IOCTL_SYNC
libavutil/hwcontext_drm.c:113:        ioctl(map->object[i], DMA_BUF_IOCTL_SYNC, &sync);
libavutil/hwcontext_drm.c:169:        ioctl(desc->objects[i].fd, DMA_BUF_IOCTL_SYNC, &sync_start);

I think this codepath should be triggered when using kmsgrab with a software encoder.

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.

3 participants