mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
Related-To: NEO-3252 Change-Id: I8d976ae29875db83dd75802e0309cb4438d1332b Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
33 lines
854 B
C++
33 lines
854 B
C++
/*
|
|
* Copyright (C) 2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "runtime/os_interface/linux/drm_allocation.h"
|
|
|
|
#include "runtime/os_interface/linux/drm_buffer_object.h"
|
|
#include "runtime/os_interface/linux/drm_memory_manager.h"
|
|
|
|
#include <sstream>
|
|
|
|
namespace NEO {
|
|
std::string DrmAllocation::getAllocationInfoString() const {
|
|
std::stringstream ss;
|
|
if (bo != nullptr) {
|
|
ss << " Handle: " << bo->peekHandle();
|
|
}
|
|
return ss.str();
|
|
}
|
|
|
|
uint64_t DrmAllocation::peekInternalHandle(MemoryManager *memoryManager) {
|
|
auto drmMemoryManager = static_cast<DrmMemoryManager *>(memoryManager);
|
|
if (DebugManager.flags.AllowOpenFdOperations.get()) {
|
|
return static_cast<uint64_t>(drmMemoryManager->obtainFdFromHandle(getBO()->peekHandle()));
|
|
} else {
|
|
return 0llu;
|
|
}
|
|
}
|
|
} // namespace NEO
|