[Intel-gfx] [PATCH] drm/i915/pmu: Deprecate I915_PMU_LAST and optimize state tracking
Chris Wilson
chris at chris-wilson.co.uk
Thu Nov 26 16:56:47 UTC 2020
Quoting Tvrtko Ursulin (2020-11-26 16:47:03)
> -static unsigned int config_enabled_bit(u64 config)
> +static unsigned int is_tracked_config(const u64 config)
> {
> - if (is_engine_config(config))
> + unsigned int val;
> +/**
> + * Non-engine events that we need to track enabled-disabled transition and
> + * current state.
> + */
I'm not understanding what is_tracked_config() actually means and how
that becomes config_enabled_bit().
These look like the non-engine ones where we interact with HW during the
sample.
How do the events we define a bit for here differ from the "untracked"
events?
> +
> + switch (config) {
> + case I915_PMU_ACTUAL_FREQUENCY:
> + val = __I915_PMU_ACTUAL_FREQUENCY_ENABLED;
> + break;
> + case I915_PMU_REQUESTED_FREQUENCY:
> + val = __I915_PMU_REQUESTED_FREQUENCY_ENABLED;
> + break;
> + case I915_PMU_RC6_RESIDENCY:
> + val = __I915_PMU_RC6_RESIDENCY_ENABLED;
> + break;
> + default:
> + return 0;
> + }
> +
> + return val + 1;
> +}
> +
> +static unsigned int config_enabled_bit(const u64 config)
> +{
> + if (is_engine_config(config)) {
> return engine_config_sample(config);
> - else
> - return ENGINE_SAMPLE_BITS + (config - __I915_PMU_OTHER(0));
> + } else {
> + unsigned int bit = is_tracked_config(config);
> +
> + if (bit)
> + return I915_ENGINE_SAMPLE_COUNT + bit - 1;
> + else
> + return -1;
> + }
> }
More information about the Intel-gfx
mailing list