From 9bebb276bee49a2a068e3dc676758a7ef65780f4 Mon Sep 17 00:00:00 2001 From: Xiaogang Chen Date: Mon, 31 Oct 2022 22:43:36 -0500 Subject: [PATCH] libhsakmt: add NodeId at HsaGraphicsResourceInfo. Return GPU NodeId that exported the DMA buffer from amdgpu graphic driver at fmm_register_graphics_handle. Signed-off-by: Xiaogang Chen Change-Id: Iaeccce6e6d0b7e27f10b15ed89d1b5310d03d44b --- include/hsakmttypes.h | 2 +- src/fmm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hsakmttypes.h b/include/hsakmttypes.h index 57f4a855de..f84f634141 100644 --- a/include/hsakmttypes.h +++ b/include/hsakmttypes.h @@ -607,7 +607,7 @@ typedef struct _HsaGraphicsResourceInfo { HSAuint64 SizeInBytes; // Buffer size const void *Metadata; // Pointer to metadata owned by Thunk HSAuint32 MetadataSizeInBytes; // Size of metadata - HSAuint32 Reserved; // Reserved for future use, will be set to 0 + HSAuint32 NodeId; // GPU exported the buffer } HsaGraphicsResourceInfo; typedef enum _HSA_CACHING_TYPE diff --git a/src/fmm.c b/src/fmm.c index 119e431f72..023ba9e81a 100644 --- a/src/fmm.c +++ b/src/fmm.c @@ -3590,7 +3590,7 @@ HSAKMT_STATUS fmm_register_graphics_handle(HSAuint64 GraphicsResourceHandle, GraphicsResourceInfo->SizeInBytes = infoArgs.size; GraphicsResourceInfo->Metadata = (void *)(unsigned long)infoArgs.metadata_ptr; GraphicsResourceInfo->MetadataSizeInBytes = infoArgs.metadata_size; - GraphicsResourceInfo->Reserved = 0; + gpuid_to_nodeid(infoArgs.gpu_id, &GraphicsResourceInfo->NodeId); return HSAKMT_STATUS_SUCCESS;