diff options
author | Oded Gabbay <oded.gabbay@amd.com> | 2014-10-28 16:49:56 +0200 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@amd.com> | 2014-10-28 16:49:56 +0200 |
commit | f081249d172bb4eb7d1d73e60c33b051b2a44ab0 (patch) | |
tree | 9461c386fe95f42313ee4a7a4b0c0073811fc591 | |
parent | f8757c0e067a52cfcfafae71bf312e44644f845a (diff) |
Implement hsaKmtGetVersion
Reviewed-by: Alexey Skidanov <Alexey.Skidanov@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
-rw-r--r-- | src/version.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/version.c b/src/version.c index 434b625..7d927c2 100644 --- a/src/version.c +++ b/src/version.c @@ -24,6 +24,9 @@ */ #include "libhsakmt.h" +#include <stdlib.h> +#include <string.h> +#include "linux/kfd_ioctl.h" HSAKMT_STATUS HSAKMTAPI @@ -33,8 +36,14 @@ hsaKmtGetVersion( { CHECK_KFD_OPEN(); - VersionInfo->KernelInterfaceMajorVersion = HSAKMT_VERSION_MAJOR; - VersionInfo->KernelInterfaceMinorVersion = HSAKMT_VERSION_MINOR; + struct kfd_ioctl_get_version_args args; + memset(&args, 0, sizeof(args)); + + if (kfd_ioctl(KFD_IOC_GET_VERSION, &args) == -1) + return HSAKMT_STATUS_ERROR; + + VersionInfo->KernelInterfaceMajorVersion = args.major_version; + VersionInfo->KernelInterfaceMinorVersion = args.minor_version; return HSAKMT_STATUS_SUCCESS; } |