OSDN Git Service

drm/i915/pmu: Deprecate I915_PMU_LAST and optimize state tracking
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 1 Dec 2020 13:17:57 +0000 (13:17 +0000)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Wed, 2 Dec 2020 12:18:13 +0000 (12:18 +0000)
commit348fb0cb0a79bce03f402d689bbe0bf666577531
tree79d8b5d639510cb68771d8c19b90e690ae747748
parent37df0edf7048f4128953e18ffc9a6b84cf15f4cd
drm/i915/pmu: Deprecate I915_PMU_LAST and optimize state tracking

Adding any kinds of "last" abi markers is usually a mistake which I
repeated when implementing the PMU because it felt convenient at the time.

This patch marks I915_PMU_LAST as deprecated and stops the internal
implementation using it for sizing the event status bitmask and array.

New way of sizing the fields is a bit less elegant, but it omits reserving
slots for tracking events we are not interested in, and as such saves some
runtime space. Adding sampling events is likely to be a special event and
the new plumbing needed will be easily detected in testing. Existing
asserts against the bitfield and array sizes are keeping the code safe.

First event which gets the new treatment in this new scheme are the
interrupts - which neither needs any tracking in i915 pmu nor needs
waking up the GPU to read it.

v2:
 * Streamline helper names. (Chris)

v3:
 * Comment which events need tracking. (Chris)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20201201131757.206367-1-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/i915_pmu.c
drivers/gpu/drm/i915/i915_pmu.h
include/uapi/drm/i915_drm.h