2020-09-14 13:28:47 +02:00
|
|
|
/*
|
2024-01-09 13:39:18 +00:00
|
|
|
* Copyright (C) 2020-2024 Intel Corporation
|
2020-09-14 13:28:47 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2022-02-28 13:56:41 +00:00
|
|
|
#include "shared/source/os_interface/linux/drm_debug.h"
|
|
|
|
|
|
2022-05-17 19:04:23 +00:00
|
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
2022-02-28 13:56:41 +00:00
|
|
|
#include "shared/source/helpers/string.h"
|
|
|
|
|
#include "shared/source/os_interface/linux/drm_neo.h"
|
2023-01-23 14:55:52 +00:00
|
|
|
#include "shared/source/os_interface/linux/ioctl_helper.h"
|
2022-02-28 13:56:41 +00:00
|
|
|
|
2022-11-04 18:57:04 +00:00
|
|
|
#include <cinttypes>
|
2022-02-28 13:56:41 +00:00
|
|
|
#include <string>
|
|
|
|
|
#include <utility>
|
2020-09-14 13:28:47 +02:00
|
|
|
|
|
|
|
|
namespace NEO {
|
2020-10-26 14:48:20 +01:00
|
|
|
|
2024-01-09 13:39:18 +00:00
|
|
|
bool Drm::registerResourceClasses() { return ioctlHelper->registerResourceClasses(); }
|
|
|
|
|
uint32_t Drm::registerResource(DrmResourceClass classType, const void *data, size_t size) { return ioctlHelper->registerResource(classType, data, size); }
|
|
|
|
|
uint32_t Drm::registerIsaCookie(uint32_t isaHandle) { return ioctlHelper->registerIsaCookie(isaHandle); }
|
|
|
|
|
void Drm::unregisterResource(uint32_t handle) { return ioctlHelper->unregisterResource(handle); }
|
|
|
|
|
bool Drm::resourceRegistrationEnabled() { return ioctlHelper->resourceRegistrationEnabled(); }
|
2022-02-28 13:56:41 +00:00
|
|
|
|
2024-01-09 13:39:18 +00:00
|
|
|
uint32_t Drm::notifyFirstCommandQueueCreated(const void *data, size_t size) { return ioctlHelper->notifyFirstCommandQueueCreated(data, size); }
|
|
|
|
|
void Drm::notifyLastCommandQueueDestroyed(uint32_t handle) { return ioctlHelper->notifyLastCommandQueueDestroyed(handle); }
|
2022-02-28 13:56:41 +00:00
|
|
|
|
|
|
|
|
void Drm::checkContextDebugSupport() {
|
2022-06-29 16:49:29 +00:00
|
|
|
contextDebugSupported = ioctlHelper->isContextDebugSupported();
|
2022-02-28 13:56:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Drm::setContextDebugFlag(uint32_t drmContextId) {
|
2022-06-29 16:49:29 +00:00
|
|
|
[[maybe_unused]] const auto retVal = ioctlHelper->setContextDebugFlag(drmContextId);
|
2022-02-28 13:56:41 +00:00
|
|
|
DEBUG_BREAK_IF(retVal != 0 && contextDebugSupported);
|
2020-12-11 13:28:22 -08:00
|
|
|
}
|
|
|
|
|
|
2020-10-16 15:52:18 -07:00
|
|
|
} // namespace NEO
|