History

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)

Tvrtko Ursulin committed 5 years ago

Commit 348fb0c1 parent 37df0ed3 files · +87 −34Browse files

Showing the changes to include/uapi (1 of 3 files). Show all

Unified · Split

include/uapi/drm/i915_drm.h+1−1
@@ -178,7 +178,7 @@ enum drm_i915_pmu_engine_sample { · 177 unmodified lines
178#define I915_PMU_INTERRUPTS __I915_PMU_OTHER(2)178#define I915_PMU_INTERRUPTS __I915_PMU_OTHER(2)
179#define I915_PMU_RC6_RESIDENCY __I915_PMU_OTHER(3)179#define I915_PMU_RC6_RESIDENCY __I915_PMU_OTHER(3)
180 180
181#define I915_PMU_LAST I915_PMU_RC6_RESIDENCY181#define I915_PMU_LAST /* Deprecated - do not use */ I915_PMU_RC6_RESIDENCY
182 182
183/* Each region is a minimum of 16k, and there are at most 255 of them.183/* Each region is a minimum of 16k, and there are at most 255 of them.
184 */184 */