diff options
| author | Jonathan Kim <[email protected]> | 2019-06-20 03:37:59 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2019-06-20 16:35:45 +0000 |
| commit | e4cf4bf5b876df83ad42604e21337eb3e7dfa52c (patch) | |
| tree | 33d2bfe864e3a386482c00f57210daa4b019641e /drivers/gpu/drm/amd/amdgpu/df_v3_6.h | |
| parent | drm/amd/display: Fix null-deref on vega20 with xgmi (diff) | |
| download | kernel-e4cf4bf5b876df83ad42604e21337eb3e7dfa52c.tar.gz kernel-e4cf4bf5b876df83ad42604e21337eb3e7dfa52c.zip | |
drm/amdgpu: update df_v3_6 for xgmi perfmons (v2)
add pmu attribute groups and structures for perf events.
add sysfs to track available df perfmon counters
fix overflow handling in perfmon counter reads.
v2: squash in fix (Alex)
Signed-off-by: Jonathan Kim <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/df_v3_6.h')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/df_v3_6.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/df_v3_6.h b/drivers/gpu/drm/amd/amdgpu/df_v3_6.h index fcffd807764d..76998541bc30 100644 --- a/drivers/gpu/drm/amd/amdgpu/df_v3_6.h +++ b/drivers/gpu/drm/amd/amdgpu/df_v3_6.h @@ -36,22 +36,15 @@ enum DF_V3_6_MGCG { }; /* Defined in global_features.h as FTI_PERFMON_VISIBLE */ -#define AMDGPU_DF_MAX_COUNTERS 4 +#define DF_V3_6_MAX_COUNTERS 4 /* get flags from df perfmon config */ -#define GET_EVENT(x) (x & 0xFFUL) -#define GET_INSTANCE(x) ((x >> 8) & 0xFFUL) -#define GET_UNITMASK(x) ((x >> 16) & 0xFFUL) -#define GET_INSTANCE_CONFIG(x) (0ULL | (0x07ULL) \ - | ((0x046ULL + x) << 8) \ - | (0x02 << 16)) - -/* df event conf macros */ -#define IS_DF_XGMI_0_TX(x) (GET_EVENT(x) == 0x7 \ - && GET_INSTANCE(x) == 0x46 && GET_UNITMASK(x) == 0x2) -#define IS_DF_XGMI_1_TX(x) (GET_EVENT(x) == 0x7 \ - && GET_INSTANCE(x) == 0x47 && GET_UNITMASK(x) == 0x2) +#define DF_V3_6_GET_EVENT(x) (x & 0xFFUL) +#define DF_V3_6_GET_INSTANCE(x) ((x >> 8) & 0xFFUL) +#define DF_V3_6_GET_UNITMASK(x) ((x >> 16) & 0xFFUL) +#define DF_V3_6_PERFMON_OVERFLOW 0xFFFFFFFFFFFFULL +extern const struct attribute_group *df_v3_6_attr_groups[]; extern const struct amdgpu_df_funcs df_v3_6_funcs; #endif |
