mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
feature: add device caps query ioctl
Related-To: NEO-13039 Signed-off-by: Radoslaw Jablonski <radoslaw.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e2228201ce
commit
2762166a7b
@@ -241,6 +241,7 @@ class IoctlHelper {
|
|||||||
virtual void syncUserptrAlloc(DrmMemoryManager &memoryManager, GraphicsAllocation &allocation) { return; };
|
virtual void syncUserptrAlloc(DrmMemoryManager &memoryManager, GraphicsAllocation &allocation) { return; };
|
||||||
|
|
||||||
virtual bool queryDeviceParams(uint32_t *moduleId, uint16_t *serverType) { return false; }
|
virtual bool queryDeviceParams(uint32_t *moduleId, uint16_t *serverType) { return false; }
|
||||||
|
virtual std::unique_ptr<std::vector<uint32_t>> queryDeviceCaps() { return nullptr; }
|
||||||
|
|
||||||
virtual bool isTimestampsRefreshEnabled() { return false; }
|
virtual bool isTimestampsRefreshEnabled() { return false; }
|
||||||
virtual uint32_t getNumProcesses() const { return 1; }
|
virtual uint32_t getNumProcesses() const { return 1; }
|
||||||
|
|||||||
@@ -413,6 +413,10 @@ TEST_F(IoctlPrelimHelperTests, givenPrelimWhenQueryDeviceParamsIsCalledThenFalse
|
|||||||
EXPECT_FALSE(ioctlHelper.queryDeviceParams(&moduleId, &serverType));
|
EXPECT_FALSE(ioctlHelper.queryDeviceParams(&moduleId, &serverType));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(IoctlPrelimHelperTests, givenPrelimWhenQueryDeviceCapsIsCalledThenNullptrIsReturned) {
|
||||||
|
EXPECT_EQ(ioctlHelper.queryDeviceCaps(), nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
struct MockIoctlHelperPrelim20 : IoctlHelperPrelim20 {
|
struct MockIoctlHelperPrelim20 : IoctlHelperPrelim20 {
|
||||||
using IoctlHelperPrelim20::createGemExt;
|
using IoctlHelperPrelim20::createGemExt;
|
||||||
using IoctlHelperPrelim20::IoctlHelperPrelim20;
|
using IoctlHelperPrelim20::IoctlHelperPrelim20;
|
||||||
|
|||||||
@@ -895,3 +895,11 @@ TEST(IoctlHelperTestsUpstream, givenUpstreamWhenQueryDeviceParamsIsCalledThenFal
|
|||||||
uint16_t serverType = 0;
|
uint16_t serverType = 0;
|
||||||
EXPECT_FALSE(ioctlHelper.queryDeviceParams(&moduleId, &serverType));
|
EXPECT_FALSE(ioctlHelper.queryDeviceParams(&moduleId, &serverType));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(IoctlHelperTestsUpstream, givenPrelimWhenQueryDeviceCapsIsCalledThenNullptrIsReturned) {
|
||||||
|
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||||
|
auto drm = std::make_unique<DrmTipMock>(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||||
|
IoctlHelperUpstream ioctlHelper{*drm};
|
||||||
|
|
||||||
|
EXPECT_EQ(ioctlHelper.queryDeviceCaps(), nullptr);
|
||||||
|
}
|
||||||
|
|||||||
@@ -2588,6 +2588,14 @@ TEST_F(IoctlHelperXeTest, givenIoctlWhenQueryDeviceParamsIsCalledThenFalseIsRetu
|
|||||||
EXPECT_FALSE(xeIoctlHelper->queryDeviceParams(&moduleId, &serverType));
|
EXPECT_FALSE(xeIoctlHelper->queryDeviceParams(&moduleId, &serverType));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(IoctlHelperXeTest, givenPrelimWhenQueryDeviceCapsIsCalledThenNullptrIsReturned) {
|
||||||
|
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||||
|
auto drm = DrmMockXe::create(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||||
|
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
|
||||||
|
|
||||||
|
EXPECT_EQ(xeIoctlHelper->queryDeviceCaps(), nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingSetVmPrefetchThenVmBindIsCalled) {
|
TEST_F(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingSetVmPrefetchThenVmBindIsCalled) {
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
debugManager.flags.EnableLocalMemory.set(1);
|
debugManager.flags.EnableLocalMemory.set(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user