Here is the email for `[email protected]`. It is the one that
reaches the people who actually maintain the DMA-BUF contract, and it asks
a question they can answer rather than pitching a product.

**To:** [email protected]
**Subject:**

Hello,

I am writing with a measured result and a question about DMA-BUF coherency
on i915, and a working userspace implementation that exercises it.

The measurement

I have a userspace test that allocates a buffer via i915 GEM + PRIME,
exports it as a DMA-BUF, maps it for CPU access, submits an
`XY_SRC_COPY_BLT` to the BLT ring with softpin, and brackets the CPU read
with `DMA_BUF_IOCTL_SYNC`. The composition test passes: 0 mismatches out of
1024 elements.

The negative control runs the same copy with the `DMA_BUF_IOCTL_SYNC`
bracket removed, 100 times per case, on a Skylake-U iGPU (HD Graphics 520,
Gen9, kernel 7.2.13). Results:

- Both sync calls omitted: across batches, 42 to 99 stale reads out of 100.
- Output sync omitted only: 87 to 100 stale reads out of 100.

The hazard is real and timing-dependent. The rate varies between batches,
which is expected for a race. The output bracket is the more critical of
the two. An earlier single-run negative control landed in the clean
minority and reported "no stale reads"; the 100-run loop exposed the race.

The question

The bracket is required by the DMA-BUF contract, and the measurement
confirms it is load-bearing on this hardware. What I would like to
understand is whether this matches what the i915 and DMA-BUF maintainers
expect on Gen9, or whether there is a kernel-side reason the hazard is
timing-dependent rather than deterministic. If the bracket is supposed to
be mandatory, is there a reason a single run can appear clean? If there is
a documented explanation, a pointer would be useful for the audit document
that records this work.

The implementation

The library is at `github.com/SimoesCTT/the-level`. `chipmem` is the
allocation and coherency contract; `blit` is the async 2D engine with three
backends (i915 BLT zero-copy, Rusticl with a copy, CPU fallback). The audit
document at `docs/linux-equivalents.md` records the paths that did not work
(udmabuf returning `EINVAL` on first sync, `GEM_SET_DOMAIN` being retired,
`GEM_WAIT` returning `ENODEV`, relocations rejected on Gen9) and the exact
measurement methodology.

I am not proposing a kernel change. The kernel machinery is there. I am
reporting a measurement and asking whether it is consistent with the
framework's expectations.

Thank you for your time.

Americo Simoes
`github.com/SimoesCTT/the-level`
*Tel: +65 87635603*


*email: [email protected] <[email protected]>*

Reply via email to