11/*
2- * Copyright (C) 2018-2021 Intel Corporation
2+ * Copyright (C) 2018-2022 Intel Corporation
33 *
44 * SPDX-License-Identifier: MIT
55 *
66 */
77
88#include " shared/source/os_interface/linux/device_time_drm.h"
99
10+ #include " shared/source/helpers/register_offsets.h"
1011#include " shared/source/os_interface/linux/drm_neo.h"
1112#include " shared/source/os_interface/os_interface.h"
1213
@@ -30,28 +31,25 @@ void DeviceTimeDrm::timestampTypeDetect() {
3031 if (pDrm == nullptr )
3132 return ;
3233
33- reg.offset = (TIMESTAMP_LOW_REG | 1 );
34+ reg.offset = (REG_GLOBAL_TIMESTAMP_LDW | 1 );
3435 err = pDrm->ioctl (DRM_IOCTL_I915_REG_READ, ®);
3536 if (err) {
36- reg.offset = TIMESTAMP_HIGH_REG ;
37+ reg.offset = REG_GLOBAL_TIMESTAMP_UN ;
3738 err = pDrm->ioctl (DRM_IOCTL_I915_REG_READ, ®);
3839 if (err) {
3940 getGpuTime = &DeviceTimeDrm::getGpuTime32;
40- timestampSizeInBits = OCLRT_NUM_TIMESTAMP_BITS_FALLBACK;
4141 } else {
4242 getGpuTime = &DeviceTimeDrm::getGpuTimeSplitted;
43- timestampSizeInBits = OCLRT_NUM_TIMESTAMP_BITS;
4443 }
4544 } else {
4645 getGpuTime = &DeviceTimeDrm::getGpuTime36;
47- timestampSizeInBits = OCLRT_NUM_TIMESTAMP_BITS;
4846 }
4947}
5048
5149bool DeviceTimeDrm::getGpuTime32 (uint64_t *timestamp) {
5250 struct drm_i915_reg_read reg = {};
5351
54- reg.offset = TIMESTAMP_LOW_REG ;
52+ reg.offset = REG_GLOBAL_TIMESTAMP_LDW ;
5553
5654 if (pDrm->ioctl (DRM_IOCTL_I915_REG_READ, ®)) {
5755 return false ;
@@ -63,7 +61,7 @@ bool DeviceTimeDrm::getGpuTime32(uint64_t *timestamp) {
6361bool DeviceTimeDrm::getGpuTime36 (uint64_t *timestamp) {
6462 struct drm_i915_reg_read reg = {};
6563
66- reg.offset = TIMESTAMP_LOW_REG | 1 ;
64+ reg.offset = REG_GLOBAL_TIMESTAMP_LDW | 1 ;
6765
6866 if (pDrm->ioctl (DRM_IOCTL_I915_REG_READ, ®)) {
6967 return false ;
@@ -78,8 +76,8 @@ bool DeviceTimeDrm::getGpuTimeSplitted(uint64_t *timestamp) {
7876 uint64_t tmp_hi;
7977 int err = 0 , loop = 3 ;
8078
81- reg_hi.offset = TIMESTAMP_HIGH_REG ;
82- reg_lo.offset = TIMESTAMP_LOW_REG ;
79+ reg_hi.offset = REG_GLOBAL_TIMESTAMP_UN ;
80+ reg_lo.offset = REG_GLOBAL_TIMESTAMP_LDW ;
8381
8482 err += pDrm->ioctl (DRM_IOCTL_I915_REG_READ, ®_hi);
8583 do {
0 commit comments