From 2d34dc31f280a82b40eb06e2ca364fe102358a1d Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Fri, 25 Nov 2022 02:54:37 +0000 Subject: [PATCH] Add query to check DMABuf support Add query to check whether DMAbuf export is supported on this system Change-Id: I28caa87b67135d67ffcc94695e4656e7b691d259 --- rocminfo.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rocminfo.cc b/rocminfo.cc index c5a45b6287..42f6cfd399 100755 --- a/rocminfo.cc +++ b/rocminfo.cc @@ -95,6 +95,7 @@ struct system_info_t { hsa_endianness_t endianness; hsa_machine_model_t machine_model; bool mwaitx_enabled; + bool dmabuf_support; }; // This structure holds agent information acquired through hsa info related @@ -281,6 +282,9 @@ static hsa_status_t AcquireSystemInfo(system_info_t *sys_info) { // Get mwaitx mode err = hsa_system_get_info(HSA_AMD_SYSTEM_INFO_MWAITX_ENABLED, &sys_info->mwaitx_enabled); + // Get DMABuf support + err = hsa_system_get_info(HSA_AMD_SYSTEM_INFO_DMABUF_SUPPORTED, + &sys_info->dmabuf_support); RET_IF_HSA_ERR(err); return err; } @@ -311,6 +315,9 @@ static void DisplaySystemInfo(system_info_t const *sys_info) { printLabel("Mwaitx:"); printf("%s\n", sys_info->mwaitx_enabled ? "ENABLED" : "DISABLED"); + printLabel("DMAbuf Support:"); + printf("%s\n", sys_info->dmabuf_support ? "YES" : "NO"); + printf("\n"); }