2019-02-14 11:38:04 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2019 Intel Corporation
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "runtime/os_interface/linux/drm_allocation.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2019-02-14 11:38:04 +01:00
|
|
|
#include "runtime/os_interface/linux/drm_buffer_object.h"
|
2019-06-06 16:26:47 +02:00
|
|
|
#include "runtime/os_interface/linux/drm_memory_manager.h"
|
2019-02-14 11:38:04 +01:00
|
|
|
|
|
|
|
|
#include <sstream>
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2019-02-14 11:38:04 +01:00
|
|
|
std::string DrmAllocation::getAllocationInfoString() const {
|
|
|
|
|
std::stringstream ss;
|
2019-09-01 21:36:15 +02:00
|
|
|
for (auto bo : bufferObjects) {
|
|
|
|
|
if (bo != nullptr) {
|
|
|
|
|
ss << " Handle: " << bo->peekHandle();
|
|
|
|
|
}
|
2019-02-14 11:38:04 +01:00
|
|
|
}
|
|
|
|
|
return ss.str();
|
|
|
|
|
}
|
2019-06-04 13:42:57 +02:00
|
|
|
|
2019-06-06 16:26:47 +02:00
|
|
|
uint64_t DrmAllocation::peekInternalHandle(MemoryManager *memoryManager) {
|
2019-11-15 08:29:02 +01:00
|
|
|
return static_cast<uint64_t>((static_cast<DrmMemoryManager *>(memoryManager))->obtainFdFromHandle(getBO()->peekHandle()));
|
2019-06-06 16:26:47 +02:00
|
|
|
}
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|