mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
UUIDs generation
Related-To: NEO-4964 Change-Id: I0ef5912fb744788f713803f539551c7b0b134208 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
d5f7ad616d
commit
0e7ec82577
@@ -473,6 +473,21 @@ uint32_t Drm::getVirtualMemoryAddressSpace(uint32_t vmId) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string Drm::generateUUID() {
|
||||
const char uuidString[] = "00000000-0000-0000-%04" SCNx64 "-%012" SCNx64;
|
||||
char buffer[36 + 1] = "00000000-0000-0000-0000-000000000000";
|
||||
uuid++;
|
||||
|
||||
UNRECOVERABLE_IF(uuid == 0xFFFFFFFFFFFFFFFF);
|
||||
|
||||
uint64_t parts[2] = {0, 0};
|
||||
parts[0] = uuid & 0xFFFFFFFFFFFF;
|
||||
parts[1] = (uuid & 0xFFFF000000000000) >> 48;
|
||||
sprintf(buffer, uuidString, parts[1], parts[0]);
|
||||
|
||||
return std::string(buffer, 36);
|
||||
}
|
||||
|
||||
Drm::~Drm() {
|
||||
destroyVirtualMemoryAddressSpace();
|
||||
}
|
||||
|
||||
@@ -123,6 +123,7 @@ class Drm {
|
||||
|
||||
protected:
|
||||
int getQueueSliceCount(drm_i915_gem_context_param_sseu *sseu);
|
||||
std::string generateUUID();
|
||||
bool sliceCountChangeSupported = false;
|
||||
drm_i915_gem_context_param_sseu sseu{};
|
||||
bool preemptionSupported = false;
|
||||
@@ -133,6 +134,7 @@ class Drm {
|
||||
int revisionId = 0;
|
||||
GTTYPE eGtType = GTTYPE_UNDEFINED;
|
||||
RootDeviceEnvironment &rootDeviceEnvironment;
|
||||
uint64_t uuid = 0;
|
||||
|
||||
Drm(std::unique_ptr<HwDeviceId> hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
std::unique_ptr<EngineInfo> engineInfo;
|
||||
|
||||
Reference in New Issue
Block a user