[PATCH 0/3] VF: Avoid reading inaccessible RING_TIMESTAMP

Marcin Bernatowicz marcin.bernatowicz at linux.intel.com
Tue Feb 4 18:05:19 UTC 2025


RING_TIMESTAMP registers are not available for VF (Virtual Function)
drivers. Return -EOPNOTSUPP when the DRM_XE_DEVICE_QUERY_ENGINE_CYCLES
ioctl is invoked on a VF device.

Modify xe_hw_engine_read_timestamp() to return an error code instead
of a u64 timestamp. Return -EOPNOTSUPP when called from Virtual Function
(VF) mode to avoid reading the inaccessible RING_TIMESTAMP register.

Ensure show_run_ticks() only prints drm-total-cycles when timestamp
retrieval succeeds.

Cc: Lucas De Marchi <lucas.demarchi at intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
Cc: Michał Winiarski <michal.winiarski at intel.com>
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>

Marcin Bernatowicz (3):
  drm/xe/vf: Return EOPNOTSUPP for DRM_XE_DEVICE_QUERY_ENGINE_CYCLES if
    VF
  drm/xe/vf: Return error code from xe_hw_engine_read_timestamp()
  drm/xe/client: Skip drm-total-cycles if unable to read timestamp

 drivers/gpu/drm/xe/xe_drm_client.c |  9 ++++++---
 drivers/gpu/drm/xe/xe_hw_engine.c  | 10 ++++++++--
 drivers/gpu/drm/xe/xe_hw_engine.h  |  2 +-
 drivers/gpu/drm/xe/xe_query.c      |  3 +++
 4 files changed, 18 insertions(+), 6 deletions(-)

-- 
2.31.1



More information about the Intel-xe mailing list