Skip to content

Commit 10a7210

Browse files
committed
drm/i915/pmu: Drop is_igp()
There's no reason to hardcode checking for integrated graphics on a specific pci slot. That information is already available per platform an can be checked with IS_DGFX(). Reviewed-by: Ashutosh Dixit <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 1f1c1bd commit 10a7210

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

drivers/gpu/drm/i915/i915_pmu.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,17 +1232,6 @@ static void i915_pmu_unregister_cpuhp_state(struct i915_pmu *pmu)
12321232
cpuhp_state_remove_instance(cpuhp_slot, &pmu->cpuhp.node);
12331233
}
12341234

1235-
static bool is_igp(struct drm_i915_private *i915)
1236-
{
1237-
struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
1238-
1239-
/* IGP is 0000:00:02.0 */
1240-
return pci_domain_nr(pdev->bus) == 0 &&
1241-
pdev->bus->number == 0 &&
1242-
PCI_SLOT(pdev->devfn) == 2 &&
1243-
PCI_FUNC(pdev->devfn) == 0;
1244-
}
1245-
12461235
void i915_pmu_register(struct drm_i915_private *i915)
12471236
{
12481237
struct i915_pmu *pmu = &i915->pmu;
@@ -1266,7 +1255,7 @@ void i915_pmu_register(struct drm_i915_private *i915)
12661255
pmu->cpuhp.cpu = -1;
12671256
init_rc6(pmu);
12681257

1269-
if (!is_igp(i915)) {
1258+
if (IS_DGFX(i915)) {
12701259
pmu->name = kasprintf(GFP_KERNEL,
12711260
"i915_%s",
12721261
dev_name(i915->drm.dev));
@@ -1318,7 +1307,7 @@ void i915_pmu_register(struct drm_i915_private *i915)
13181307
pmu->base.event_init = NULL;
13191308
free_event_attributes(pmu);
13201309
err_name:
1321-
if (!is_igp(i915))
1310+
if (IS_DGFX(i915))
13221311
kfree(pmu->name);
13231312
err:
13241313
drm_notice(&i915->drm, "Failed to register PMU!\n");
@@ -1346,7 +1335,7 @@ void i915_pmu_unregister(struct drm_i915_private *i915)
13461335
perf_pmu_unregister(&pmu->base);
13471336
pmu->base.event_init = NULL;
13481337
kfree(pmu->base.attr_groups);
1349-
if (!is_igp(i915))
1338+
if (IS_DGFX(i915))
13501339
kfree(pmu->name);
13511340
free_event_attributes(pmu);
13521341
}

0 commit comments

Comments
 (0)