performance: enable timestamp reuse on linux

Related-To: NEO-13456

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2024-12-10 09:25:56 +00:00
committed by Compute-Runtime-Automation
parent 74824f659a
commit c3ed6e062a
4 changed files with 11 additions and 1 deletions

View File

@@ -61,7 +61,7 @@ uint64_t DeviceTimeDrm::getDynamicDeviceTimerClock() const {
} }
bool DeviceTimeDrm::isTimestampsRefreshEnabled() const { bool DeviceTimeDrm::isTimestampsRefreshEnabled() const {
bool timestampsRefreshEnabled = false; bool timestampsRefreshEnabled = pDrm->getIoctlHelper()->isTimestampsRefreshEnabled();
if (debugManager.flags.EnableReusingGpuTimestamps.get() != -1) { if (debugManager.flags.EnableReusingGpuTimestamps.get() != -1) {
timestampsRefreshEnabled = debugManager.flags.EnableReusingGpuTimestamps.get(); timestampsRefreshEnabled = debugManager.flags.EnableReusingGpuTimestamps.get();
} }

View File

@@ -234,6 +234,8 @@ class IoctlHelper {
virtual bool queryDeviceParams(uint32_t *moduleId, uint16_t *serverType) { return false; } virtual bool queryDeviceParams(uint32_t *moduleId, uint16_t *serverType) { return false; }
virtual bool isTimestampsRefreshEnabled() { return false; }
protected: protected:
Drm &drm; Drm &drm;
ExternalCtx *externalCtx = nullptr; ExternalCtx *externalCtx = nullptr;

View File

@@ -132,6 +132,7 @@ class IoctlHelperXe : public IoctlHelper {
void registerBOBindHandle(Drm *drm, DrmAllocation *drmAllocation) override; void registerBOBindHandle(Drm *drm, DrmAllocation *drmAllocation) override;
bool resourceRegistrationEnabled() override { return true; } bool resourceRegistrationEnabled() override { return true; }
bool isPreemptionSupported() override { return true; } bool isPreemptionSupported() override { return true; }
bool isTimestampsRefreshEnabled() override { return true; }
protected: protected:
static constexpr uint32_t maxContextSetProperties = 4; static constexpr uint32_t maxContextSetProperties = 4;

View File

@@ -2566,3 +2566,10 @@ TEST(IoctlHelperXeTest, givenIoctlFailureWhenCallingSetVmPrefetchThenFalseIsRetu
EXPECT_FALSE(xeIoctlHelper->setVmPrefetch(0u, 0u, 0u, 0u)); EXPECT_FALSE(xeIoctlHelper->setVmPrefetch(0u, 0u, 0u, 0u));
EXPECT_EQ(0u, drm->vmBindInputs.size()); EXPECT_EQ(0u, drm->vmBindInputs.size());
} }
TEST(IoctlHelperXeTest, givenXeIoctlHelperWhenIsTimestampsRefreshEnabledCalledThenReturnTrue) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
auto xeIoctlHelper = std::make_unique<IoctlHelperXe>(drm);
EXPECT_TRUE(xeIoctlHelper->isTimestampsRefreshEnabled());
}