2019-02-14 18:38:04 +08:00
|
|
|
/*
|
2021-03-10 07:02:59 +08:00
|
|
|
* Copyright (C) 2019-2021 Intel Corporation
|
2019-02-14 18:38:04 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/os_interface/linux/drm_allocation.h"
|
|
|
|
#include "shared/source/os_interface/linux/drm_buffer_object.h"
|
2019-02-14 18:38:04 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2019-02-14 18:38:04 +08:00
|
|
|
|
|
|
|
class MockBufferObject : public BufferObject {
|
|
|
|
public:
|
2020-09-14 19:28:47 +08:00
|
|
|
using BufferObject::bindExtHandles;
|
2020-08-11 20:00:41 +08:00
|
|
|
using BufferObject::bindInfo;
|
2020-08-20 19:20:20 +08:00
|
|
|
using BufferObject::BufferObject;
|
2019-02-14 18:38:04 +08:00
|
|
|
using BufferObject::handle;
|
|
|
|
|
2020-08-20 19:20:20 +08:00
|
|
|
MockBufferObject(Drm *drm) : BufferObject(drm, 0, 0, 1) {
|
2019-02-14 18:38:04 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class MockDrmAllocation : public DrmAllocation {
|
|
|
|
public:
|
2019-09-02 03:36:15 +08:00
|
|
|
using DrmAllocation::bufferObjects;
|
2021-10-11 17:27:26 +08:00
|
|
|
using DrmAllocation::enabledMemAdviseFlags;
|
2019-02-14 18:38:04 +08:00
|
|
|
using DrmAllocation::memoryPool;
|
2020-09-17 19:27:32 +08:00
|
|
|
using DrmAllocation::registeredBoBindHandles;
|
2019-02-14 18:38:04 +08:00
|
|
|
|
2019-11-04 23:03:30 +08:00
|
|
|
MockDrmAllocation(AllocationType allocationType, MemoryPool::Type pool) : DrmAllocation(0, allocationType, nullptr, nullptr, 0, static_cast<size_t>(0), pool) {
|
2019-02-14 18:38:04 +08:00
|
|
|
}
|
2020-11-19 22:11:37 +08:00
|
|
|
|
|
|
|
void registerBOBindExtHandle(Drm *drm) override {
|
|
|
|
registerBOBindExtHandleCalled = true;
|
|
|
|
DrmAllocation::registerBOBindExtHandle(drm);
|
|
|
|
}
|
|
|
|
|
2021-03-10 07:02:59 +08:00
|
|
|
void markForCapture() override {
|
|
|
|
markedForCapture = true;
|
|
|
|
DrmAllocation::markForCapture();
|
|
|
|
}
|
|
|
|
|
2020-11-19 22:11:37 +08:00
|
|
|
bool registerBOBindExtHandleCalled = false;
|
2021-03-10 07:02:59 +08:00
|
|
|
bool markedForCapture = false;
|
2019-02-14 18:38:04 +08:00
|
|
|
};
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|