diff --git a/.pick_status.json b/.pick_status.json index 62417940e14..792cd6d0919 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3484,7 +3484,7 @@ "description": "pan/kmod: Allow mmap() on foreign buffers", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "b5e47ba8941467a4e2f53907a6645a0703852e62", "notes": null diff --git a/src/panfrost/lib/kmod/panfrost_kmod.c b/src/panfrost/lib/kmod/panfrost_kmod.c index e834b18e14d..b00c5f2853a 100644 --- a/src/panfrost/lib/kmod/panfrost_kmod.c +++ b/src/panfrost/lib/kmod/panfrost_kmod.c @@ -350,11 +350,16 @@ panfrost_kmod_bo_import(struct pan_kmod_dev *dev, uint32_t handle, uint64_t size goto err_free_bo; } - /* If the BO comes from a different subsystem, we don't allow - * mmap() to avoid the CPU-sync churn. + /* FIXME: If the BO comes from a different subsystem + * (args.extra_flags & DRM_PANTHOR_BO_IS_IMPORTED), we should normally + * add extra DMA_BUF_IOCTL_SYNC calls around CPU accesses to ensure the + * CPU mapping consistency, but this is something we never worried about + * (we've always assumed exporters were exposing uncached mappings with + * NOP {begin,end}_cpu_access() implementations), and it worked fine until + * now. + * The long term plan is to hook up DMA_BUF_IOCTL_SYNC, but this requires + * more work. */ - if (args.extra_flags & DRM_PANFROST_BO_IS_IMPORTED) - flags |= PAN_KMOD_BO_FLAG_NO_MMAP; } pan_kmod_bo_init(&panfrost_bo->base, dev, NULL, size, diff --git a/src/panfrost/lib/kmod/panthor_kmod.c b/src/panfrost/lib/kmod/panthor_kmod.c index 37013dea836..c958de188eb 100644 --- a/src/panfrost/lib/kmod/panthor_kmod.c +++ b/src/panfrost/lib/kmod/panthor_kmod.c @@ -445,11 +445,16 @@ panthor_kmod_bo_import(struct pan_kmod_dev *dev, uint32_t handle, uint64_t size, goto err_free_bo; } - /* If the BO comes from a different subsystem, we don't allow - * mmap() to avoid the CPU-sync churn. + /* FIXME: If the BO comes from a different subsystem + * (args.extra_flags & DRM_PANTHOR_BO_IS_IMPORTED), we should normally + * add extra DMA_BUF_IOCTL_SYNC calls around CPU accesses to ensure the + * CPU mapping consistency, but this is something we never worried about + * (we've always assumed exporters were exposing uncached mappings with + * NOP {begin,end}_cpu_access() implementations), and it worked fine until + * now. + * The long term plan is to hook up DMA_BUF_IOCTL_SYNC, but this requires + * more work. */ - if (args.extra_flags & DRM_PANTHOR_BO_IS_IMPORTED) - flags |= PAN_KMOD_BO_FLAG_NO_MMAP; } /* Create a unsignalled syncobj on import. Will serve as a