libhsakmt: Implement dmabuf export for RDMA
Implement hsaKmtExportDMABufHandle, which can be used for a new upstreamable RDMA solution. It exports a DMABuf handle for an arbitrary virtual address along with the offset of the address within the allocation. It also checks that the size of the intended export does not exceed the allocation. This uses the new AMDKFD_IOC_EXPORT_DMABUF, which requires KFD ioctl API version 1.12. Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Change-Id: Ie5fdb1f73ab3c7fa36c315ce326b1fb89eacc8b6
Esse commit está contido em:
@@ -318,6 +318,20 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtRegisterGraphicsHandleToNodes(HSAuint64 GraphicsRe
|
||||
return ret;
|
||||
}
|
||||
|
||||
HSAKMT_STATUS HSAKMTAPI hsaKmtExportDMABufHandle(void *MemoryAddress,
|
||||
HSAuint64 MemorySizeInBytes,
|
||||
int *DMABufFd,
|
||||
HSAuint64 *Offset)
|
||||
{
|
||||
CHECK_KFD_OPEN();
|
||||
CHECK_KFD_MINOR_VERSION(12);
|
||||
|
||||
pr_debug("[%s] address %p\n", __func__, MemoryAddress);
|
||||
|
||||
return fmm_export_dma_buf_fd(MemoryAddress, MemorySizeInBytes,
|
||||
DMABufFd, Offset);
|
||||
}
|
||||
|
||||
HSAKMT_STATUS HSAKMTAPI hsaKmtShareMemory(void *MemoryAddress,
|
||||
HSAuint64 SizeInBytes,
|
||||
HsaSharedMemoryHandle *SharedMemoryHandle)
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário