OSDN Git Service

drm/i915/pmu: Support multiple GPUs
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Wed, 16 Oct 2019 09:38:02 +0000 (10:38 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 17 Oct 2019 09:50:47 +0000 (10:50 +0100)
commit05488673a4d41383f9dd537f298e525e6b00fb93
tree08ebbbf1fbab1dd2f48962d7e9b3affa70898b7d
parenteb8de23c955bd4dae47bfdac61179010d3e451d8
drm/i915/pmu: Support multiple GPUs

With discrete graphics system can have both integrated and discrete GPU
handled by i915.

Currently we use a fixed name ("i915") when registering as the uncore PMU
provider which stops working in this case.

To fix this we add the PCI device name string to non-integrated devices
handled by us. Integrated devices keep the legacy name preserving
backward compatibility.

v2:
 * Detect IGP and keep legacy name. (Michal)
 * Use PCI device name as suffix. (Michal, Chris)

v3:
 * Constify the name. (Chris)
 * Use pci_domain_nr. (Chris)

v4:
 * Fix kfree_const usage. (Chris)

v5:
 * kfree_const does not work for modules. (Chris)
 * Changed is_igp helper to take i915.

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