Skip to content

Commit 9aba9c1

Browse files
drm/i915/perf: remove generated code
A little bit of history : Back when i915-perf was introduced (4.13), there was no way to dynamically add new OA configurations to i915. Only the generated configs baked in at build time were allowed. It quickly became obvious that we would need to allow applications to upload their own configurations, for instance to be able to test new ones, and so by the next stable version (4.14) we added uAPIs to allow uploading new configurations. When adding that capability, we took the opportunity to remove most HW configurations except the TestOa one which is a configuration IGT would rely on to verify that the HW is outputting correct values. At the time it made sense to have that confiuration in at the same time a given HW platform added to the i915-perf driver. Now that IGT has become the reference point for HW configurations (see commit 53f8f541ca ("lib: Add i915_perf library"), previously this was located in the GPUTop repository), the need for having those configurations in i915-perf is gone. On the Mesa side, we haven't relied on this test configuration for a while. The MDAPI library always required 4.14 feature level and always loaded its configuration into i915. I'm sure nobody will miss this generated stuff in i915 :) v2: Fix selftests by creating an empty config v3: Fix unlocking on allocation error (Dan Carpenter) v4: Fixup checkpatch warnings v5: Fix incorrect unlock in error path (Umesh) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200317132222.2638719-1-lionel.g.landwerlin@intel.com
1 parent a22f347 commit 9aba9c1

34 files changed

Lines changed: 96 additions & 1757 deletions

‎drivers/gpu/drm/i915/Makefile‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -243,23 +243,6 @@ i915-y += \
243243
display/vlv_dsi.o \
244244
display/vlv_dsi_pll.o
245245

246-
# perf code
247-
i915-y += \
248-
oa/i915_oa_hsw.o \
249-
oa/i915_oa_bdw.o \
250-
oa/i915_oa_chv.o \
251-
oa/i915_oa_sklgt2.o \
252-
oa/i915_oa_sklgt3.o \
253-
oa/i915_oa_sklgt4.o \
254-
oa/i915_oa_bxt.o \
255-
oa/i915_oa_kblgt2.o \
256-
oa/i915_oa_kblgt3.o \
257-
oa/i915_oa_glk.o \
258-
oa/i915_oa_cflgt2.o \
259-
oa/i915_oa_cflgt3.o \
260-
oa/i915_oa_cnl.o \
261-
oa/i915_oa_icl.o \
262-
oa/i915_oa_tgl.o
263246
i915-y += i915_perf.o
264247

265248
# Post-mortem debug and GPU hang state capture

‎drivers/gpu/drm/i915/i915_perf.c‎

Lines changed: 1 addition & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -204,21 +204,6 @@
204204

205205
#include "i915_drv.h"
206206
#include "i915_perf.h"
207-
#include "oa/i915_oa_hsw.h"
208-
#include "oa/i915_oa_bdw.h"
209-
#include "oa/i915_oa_chv.h"
210-
#include "oa/i915_oa_sklgt2.h"
211-
#include "oa/i915_oa_sklgt3.h"
212-
#include "oa/i915_oa_sklgt4.h"
213-
#include "oa/i915_oa_bxt.h"
214-
#include "oa/i915_oa_kblgt2.h"
215-
#include "oa/i915_oa_kblgt3.h"
216-
#include "oa/i915_oa_glk.h"
217-
#include "oa/i915_oa_cflgt2.h"
218-
#include "oa/i915_oa_cflgt3.h"
219-
#include "oa/i915_oa_cnl.h"
220-
#include "oa/i915_oa_icl.h"
221-
#include "oa/i915_oa_tgl.h"
222207

223208
/* HW requires this to be a power of two, between 128k and 16M, though driver
224209
* is currently generally designed assuming the largest 16M size is used such
@@ -409,10 +394,7 @@ i915_perf_get_oa_config(struct i915_perf *perf, int metrics_set)
409394
struct i915_oa_config *oa_config;
410395

411396
rcu_read_lock();
412-
if (metrics_set == 1)
413-
oa_config = &perf->test_config;
414-
else
415-
oa_config = idr_find(&perf->metrics_idr, metrics_set);
397+
oa_config = idr_find(&perf->metrics_idr, metrics_set);
416398
if (oa_config)
417399
oa_config = i915_oa_config_get(oa_config);
418400
rcu_read_unlock();
@@ -3716,7 +3698,6 @@ int i915_perf_open_ioctl(struct drm_device *dev, void *data,
37163698
void i915_perf_register(struct drm_i915_private *i915)
37173699
{
37183700
struct i915_perf *perf = &i915->perf;
3719-
int ret;
37203701

37213702
if (!perf->i915)
37223703
return;
@@ -3730,64 +3711,7 @@ void i915_perf_register(struct drm_i915_private *i915)
37303711
perf->metrics_kobj =
37313712
kobject_create_and_add("metrics",
37323713
&i915->drm.primary->kdev->kobj);
3733-
if (!perf->metrics_kobj)
3734-
goto exit;
3735-
3736-
sysfs_attr_init(&perf->test_config.sysfs_metric_id.attr);
3737-
3738-
if (IS_TIGERLAKE(i915)) {
3739-
i915_perf_load_test_config_tgl(i915);
3740-
} else if (INTEL_GEN(i915) >= 11) {
3741-
i915_perf_load_test_config_icl(i915);
3742-
} else if (IS_CANNONLAKE(i915)) {
3743-
i915_perf_load_test_config_cnl(i915);
3744-
} else if (IS_COFFEELAKE(i915)) {
3745-
if (IS_CFL_GT2(i915))
3746-
i915_perf_load_test_config_cflgt2(i915);
3747-
if (IS_CFL_GT3(i915))
3748-
i915_perf_load_test_config_cflgt3(i915);
3749-
} else if (IS_GEMINILAKE(i915)) {
3750-
i915_perf_load_test_config_glk(i915);
3751-
} else if (IS_KABYLAKE(i915)) {
3752-
if (IS_KBL_GT2(i915))
3753-
i915_perf_load_test_config_kblgt2(i915);
3754-
else if (IS_KBL_GT3(i915))
3755-
i915_perf_load_test_config_kblgt3(i915);
3756-
} else if (IS_BROXTON(i915)) {
3757-
i915_perf_load_test_config_bxt(i915);
3758-
} else if (IS_SKYLAKE(i915)) {
3759-
if (IS_SKL_GT2(i915))
3760-
i915_perf_load_test_config_sklgt2(i915);
3761-
else if (IS_SKL_GT3(i915))
3762-
i915_perf_load_test_config_sklgt3(i915);
3763-
else if (IS_SKL_GT4(i915))
3764-
i915_perf_load_test_config_sklgt4(i915);
3765-
} else if (IS_CHERRYVIEW(i915)) {
3766-
i915_perf_load_test_config_chv(i915);
3767-
} else if (IS_BROADWELL(i915)) {
3768-
i915_perf_load_test_config_bdw(i915);
3769-
} else if (IS_HASWELL(i915)) {
3770-
i915_perf_load_test_config_hsw(i915);
3771-
}
3772-
3773-
if (perf->test_config.id == 0)
3774-
goto sysfs_error;
3775-
3776-
ret = sysfs_create_group(perf->metrics_kobj,
3777-
&perf->test_config.sysfs_metric);
3778-
if (ret)
3779-
goto sysfs_error;
37803714

3781-
perf->test_config.perf = perf;
3782-
kref_init(&perf->test_config.ref);
3783-
3784-
goto exit;
3785-
3786-
sysfs_error:
3787-
kobject_put(perf->metrics_kobj);
3788-
perf->metrics_kobj = NULL;
3789-
3790-
exit:
37913715
mutex_unlock(&perf->lock);
37923716
}
37933717

@@ -3807,9 +3731,6 @@ void i915_perf_unregister(struct drm_i915_private *i915)
38073731
if (!perf->metrics_kobj)
38083732
return;
38093733

3810-
sysfs_remove_group(perf->metrics_kobj,
3811-
&perf->test_config.sysfs_metric);
3812-
38133734
kobject_put(perf->metrics_kobj);
38143735
perf->metrics_kobj = NULL;
38153736
}

‎drivers/gpu/drm/i915/i915_perf_types.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,6 @@ struct i915_perf {
413413
*/
414414
struct ratelimit_state spurious_report_rs;
415415

416-
struct i915_oa_config test_config;
417-
418416
u32 gen7_latched_oastatus1;
419417
u32 ctx_oactxctrl_offset;
420418
u32 ctx_flexeu0_offset;

‎drivers/gpu/drm/i915/oa/i915_oa_bdw.c‎

Lines changed: 0 additions & 90 deletions
This file was deleted.

‎drivers/gpu/drm/i915/oa/i915_oa_bdw.h‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎drivers/gpu/drm/i915/oa/i915_oa_bxt.c‎

Lines changed: 0 additions & 88 deletions
This file was deleted.

‎drivers/gpu/drm/i915/oa/i915_oa_bxt.h‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)