2019-03-27 19:44:49 +08:00
|
|
|
/*
|
2020-01-21 22:24:52 +08:00
|
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
2019-03-27 19:44:49 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-01-21 22:24:52 +08:00
|
|
|
#include "core/os_interface/linux/drm_neo.h"
|
2020-02-13 20:26:40 +08:00
|
|
|
#include "core/os_interface/os_interface.h"
|
2019-03-27 19:44:49 +08:00
|
|
|
|
|
|
|
#include "drm/i915_drm.h"
|
|
|
|
|
|
|
|
class DrmWrap : public NEO::Drm {
|
|
|
|
public:
|
2020-02-07 21:32:02 +08:00
|
|
|
static NEO::Drm *createDrm(RootDeviceEnvironment &rootDeviceEnvironment) {
|
2020-02-13 20:26:40 +08:00
|
|
|
auto hwDeviceId = OSInterface::discoverDevices();
|
2020-02-07 21:32:02 +08:00
|
|
|
if (hwDeviceId != nullptr) {
|
|
|
|
return NEO::Drm::create(std::move(hwDeviceId), rootDeviceEnvironment);
|
|
|
|
}
|
|
|
|
return nullptr;
|
2019-03-27 19:44:49 +08:00
|
|
|
}
|
|
|
|
};
|