mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Pass Drm object to OsContext on Linux
Change-Id: I341925eef9bc892f5c321c668736bb6a3aff38f5 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
76efeae9d8
commit
728932ed44
@@ -32,6 +32,7 @@ set(RUNTIME_SRCS_OS_INTERFACE_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/linux_inc.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_context_linux.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_context_linux.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_inc.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_interface.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_interface.h
|
||||
|
||||
@@ -6,12 +6,19 @@
|
||||
*/
|
||||
|
||||
#include "runtime/os_interface/os_context.h"
|
||||
#include "runtime/os_interface/linux/drm_neo.h"
|
||||
#include "runtime/os_interface/linux/os_context_linux.h"
|
||||
#include "runtime/os_interface/linux/os_interface.h"
|
||||
|
||||
namespace OCLRT {
|
||||
class OsContext::OsContextImpl {};
|
||||
|
||||
OsContext::OsContext(OSInterface *osInterface, uint32_t contextId) : contextId(contextId) {
|
||||
osContextImpl = std::make_unique<OsContext::OsContextImpl>();
|
||||
if (osInterface) {
|
||||
osContextImpl = std::make_unique<OsContextLinux>(*osInterface->get()->getDrm());
|
||||
}
|
||||
}
|
||||
|
||||
OsContext::~OsContext() = default;
|
||||
|
||||
OsContextLinux::OsContextImpl(Drm &drm) : drm(drm) {}
|
||||
} // namespace OCLRT
|
||||
|
||||
21
runtime/os_interface/linux/os_context_linux.h
Normal file
21
runtime/os_interface/linux/os_context_linux.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "runtime/os_interface/os_context.h"
|
||||
|
||||
namespace OCLRT {
|
||||
class Drm;
|
||||
using OsContextLinux = OsContext::OsContextImpl;
|
||||
|
||||
class OsContext::OsContextImpl {
|
||||
public:
|
||||
OsContextImpl(Drm &drm);
|
||||
|
||||
protected:
|
||||
Drm &drm;
|
||||
};
|
||||
} // namespace OCLRT
|
||||
Reference in New Issue
Block a user