2018-11-08 20:05:46 +08:00
|
|
|
/*
|
2021-12-16 10:13:00 +08:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
2018-11-08 20:05:46 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-09-02 03:36:15 +08:00
|
|
|
#pragma once
|
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/os_interface/os_context.h"
|
2018-11-08 20:05:46 +08:00
|
|
|
|
2019-07-11 20:29:45 +08:00
|
|
|
#include <vector>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-11-08 20:05:46 +08:00
|
|
|
class Drm;
|
|
|
|
|
2019-02-27 18:17:17 +08:00
|
|
|
class OsContextLinux : public OsContext {
|
2018-11-08 20:05:46 +08:00
|
|
|
public:
|
2019-02-27 18:17:17 +08:00
|
|
|
OsContextLinux() = delete;
|
|
|
|
~OsContextLinux() override;
|
2021-08-12 01:36:00 +08:00
|
|
|
OsContextLinux(Drm &drm, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
2019-02-27 18:17:17 +08:00
|
|
|
|
2018-11-26 21:04:52 +08:00
|
|
|
unsigned int getEngineFlag() const { return engineFlag; }
|
2019-07-17 21:38:14 +08:00
|
|
|
const std::vector<uint32_t> &getDrmContextIds() const { return drmContextIds; }
|
2020-08-17 18:07:39 +08:00
|
|
|
const std::vector<uint32_t> &getDrmVmIds() const { return drmVmIds; }
|
2021-09-02 00:28:18 +08:00
|
|
|
void setNewResourceBound(bool value) { this->newResourceBound = value; };
|
|
|
|
bool getNewResourceBound() { return this->newResourceBound; };
|
2021-03-31 21:06:23 +08:00
|
|
|
bool isDirectSubmissionSupported(const HardwareInfo &hwInfo) const override;
|
2020-07-02 17:49:46 +08:00
|
|
|
Drm &getDrm() const;
|
2021-02-05 23:27:21 +08:00
|
|
|
void waitForPagingFence();
|
2021-08-12 01:36:00 +08:00
|
|
|
static OsContext *create(OSInterface *osInterface, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
2021-12-16 10:13:00 +08:00
|
|
|
void reInitializeContext() override;
|
2018-11-08 20:05:46 +08:00
|
|
|
|
|
|
|
protected:
|
2021-04-16 00:14:04 +08:00
|
|
|
void initializeContext() override;
|
|
|
|
|
2018-11-26 21:04:52 +08:00
|
|
|
unsigned int engineFlag = 0;
|
2021-09-02 00:28:18 +08:00
|
|
|
bool newResourceBound = false;
|
2019-07-11 20:29:45 +08:00
|
|
|
std::vector<uint32_t> drmContextIds;
|
2020-08-17 18:07:39 +08:00
|
|
|
std::vector<uint32_t> drmVmIds;
|
2018-11-08 20:05:46 +08:00
|
|
|
Drm &drm;
|
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|