]> Gentwo Git Trees - linux/.git/commit
accel/rocket: Add IOCTLs for synchronizing memory accesses
authorTomeu Vizoso <tomeu@tomeuvizoso.net>
Mon, 21 Jul 2025 09:17:32 +0000 (11:17 +0200)
committerJeff Hugo <jeff.hugo@oss.qualcomm.com>
Fri, 25 Jul 2025 16:04:46 +0000 (10:04 -0600)
commit525ad89dd90434d529b76a87b1c653a69fedc416
treea008d637e7518723a02c8db68dc1a6469d191aa2
parent0810d5ad88a18f1e6d549853a388ad0316f74e36
accel/rocket: Add IOCTLs for synchronizing memory accesses

The NPU cores have their own access to the memory bus, and this isn't
cache coherent with the CPUs.

Add IOCTLs so userspace can mark when the caches need to be flushed, and
also when a writer job needs to be waited for before the buffer can be
accessed from the CPU.

Initially based on the same IOCTLs from the Etnaviv driver.

v2:
- Don't break UABI by reordering the IOCTL IDs (Jeff Hugo)

v3:
- Check that padding fields in IOCTLs are zero (Jeff Hugo)

v6:
- Fix conversion logic to make sure we use DMA_BIDIRECTIONAL when needed
  (Lucas Stach)

v8:
- Always sync BOs in both directions (Robin Murphy)

Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Signed-off-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250721-6-10-rocket-v9-5-77ebd484941e@tomeuvizoso.net
drivers/accel/rocket/rocket_drv.c
drivers/accel/rocket/rocket_gem.c
drivers/accel/rocket/rocket_gem.h
include/uapi/drm/rocket_accel.h