]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/i915/pmu: Add support for gen2
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 8 Oct 2024 21:43:49 +0000 (00:43 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 15 Oct 2024 14:51:00 +0000 (17:51 +0300)
commite217f22041fe2478e8ab6e4cfa1774089db9a918
tree36fba6ccce0407b3b5707eebd52e82dec3b6949b
parentbdc2917fbd4b32e4b1cb127e99752e6004a62a6c
drm/i915/pmu: Add support for gen2

Implement pmu support for gen2 so that one can use intel_gpu_top
on it once again.

Gen2 lacks MI_MODE/MODE_IDLE so we'll have to do a bit more work
to determine the state of the engine:
- to determine if the ring contains unconsumed data we can simply
  compare RING_TAIL vs. RING_HEAD
- also check RING_HEAD vs. ACTHD to catch cases where the hardware
  is still executing a batch buffer but the ring head has already
  caught up with the tail. Not entirely sure if that's actually
  possible or not, but maybe it can happen if the batch buffer is
  initiated from the very end of the ring? But even if not strictly
  necessary there's no real harm in checking anyway.
- MI_WAIT_FOR_EVENT can be detected via a dedicated bit in RING_HEAD

v2: Use genX_ prefix rarther than suffix (Jani)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241008214349.23331-5-ville.syrjala@linux.intel.com
Acked-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/gt/intel_engine_regs.h
drivers/gpu/drm/i915/i915_pmu.c