drm/i915/pmu: add event_to_pmu() helper
authorJani Nikula <jani.nikula@intel.com>
Mon, 23 Oct 2023 15:02:55 +0000 (18:02 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 30 Oct 2023 16:21:02 +0000 (18:21 +0200)
commitcb476dd1b8b10a40f6ba6e230f0b408916365c1f
tree7db3d2c9331bf4e24d7755c3f5fe9c6d9f1e6dc8
parent874d6fe4a6962cc18bb0e62dfc23adbebd0abbe2
drm/i915/pmu: add event_to_pmu() helper

It's tedious to duplicate the container_of() everywhere. Add a helper.

Also do the logical steps of first getting from struct perf_event to
struct i915_pmu, and then from struct i915_pmu to struct
drm_i915_private if needed, instead of perf_event->i915->pmu. Not all
places even need the i915 pointer.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231023150256.438331-2-jani.nikula@intel.com
drivers/gpu/drm/i915/i915_pmu.c