mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 17:00:59 +08:00
Add uuid support using inband information
Added chipset specific uuid retrieving functionality This is used by zeDeviceGetProperties Related-To: LOCI-2636 Signed-off-by: Joshua Santosh Ranjan <joshua.santosh.ranjan@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
cf70a57efb
commit
06be26fd1e
@@ -13,7 +13,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
namespace NEO {
|
||||
std::optional<std::string> getPciPath(int deviceFd) {
|
||||
std::optional<std::string> getPciLinkPath(int deviceFd) {
|
||||
char path[256] = {0};
|
||||
size_t pathlen = 256;
|
||||
|
||||
@@ -33,9 +33,17 @@ std::optional<std::string> getPciPath(int deviceFd) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::string_view devicePathView(devicePath, static_cast<size_t>(readLinkSize));
|
||||
devicePathView = devicePathView.substr(devicePathView.find("/drm/render") - 12u, 12u);
|
||||
return std::string(devicePath, static_cast<size_t>(readLinkSize));
|
||||
}
|
||||
|
||||
return std::string(devicePathView);
|
||||
std::optional<std::string> getPciPath(int deviceFd) {
|
||||
|
||||
auto deviceLinkPath = NEO::getPciLinkPath(deviceFd);
|
||||
|
||||
if (deviceLinkPath == std::nullopt) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return deviceLinkPath->substr(deviceLinkPath->find("/drm/render") - 12u, 12u);
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user