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-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/os_interface/linux/drm_neo.h"
|
|
|
|
#include "shared/source/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-17 23:14:22 +08:00
|
|
|
auto hwDeviceIds = OSInterface::discoverDevices();
|
|
|
|
if (!hwDeviceIds.empty()) {
|
|
|
|
return NEO::Drm::create(std::move(hwDeviceIds[0]), rootDeviceEnvironment);
|
2020-02-07 21:32:02 +08:00
|
|
|
}
|
|
|
|
return nullptr;
|
2019-03-27 19:44:49 +08:00
|
|
|
}
|
|
|
|
};
|