1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

drm/i915/debugfs: Add perf_limit_reasons in debugfs

Add perf_limit_reasons in debugfs. The upper 16 perf_limit_reasons RW "log"
bits are identical to the lower 16 RO "status" bits except that the "log"
bits remain set until cleared, thereby ensuring the throttling occurrence
is not missed. The clear fop clears the upper 16 "log" bits, the get fop
gets all 32 "log" and "status" bits.

v2: Expand commit message and clarify "log" and "status" bits in
    comment (Rodrigo)

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Tilak Tangudu <tilak.tangudu@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220910143844.1755324-2-ashutosh.dixit@intel.com
This commit is contained in:
Tilak Tangudu 2022-09-10 07:38:42 -07:00 committed by Rodrigo Vivi
parent f569ae7594
commit fe5979665f
2 changed files with 32 additions and 0 deletions

View file

@ -655,6 +655,36 @@ static bool rps_eval(void *data)
DEFINE_INTEL_GT_DEBUGFS_ATTRIBUTE(rps_boost); DEFINE_INTEL_GT_DEBUGFS_ATTRIBUTE(rps_boost);
static int perf_limit_reasons_get(void *data, u64 *val)
{
struct intel_gt *gt = data;
intel_wakeref_t wakeref;
with_intel_runtime_pm(gt->uncore->rpm, wakeref)
*val = intel_uncore_read(gt->uncore, GT0_PERF_LIMIT_REASONS);
return 0;
}
static int perf_limit_reasons_clear(void *data, u64 val)
{
struct intel_gt *gt = data;
intel_wakeref_t wakeref;
/*
* Clear the upper 16 "log" bits, the lower 16 "status" bits are
* read-only. The upper 16 "log" bits are identical to the lower 16
* "status" bits except that the "log" bits remain set until cleared.
*/
with_intel_runtime_pm(gt->uncore->rpm, wakeref)
intel_uncore_rmw(gt->uncore, GT0_PERF_LIMIT_REASONS,
GT0_PERF_LIMIT_REASONS_LOG_MASK, 0);
return 0;
}
DEFINE_SIMPLE_ATTRIBUTE(perf_limit_reasons_fops, perf_limit_reasons_get,
perf_limit_reasons_clear, "%llu\n");
void intel_gt_pm_debugfs_register(struct intel_gt *gt, struct dentry *root) void intel_gt_pm_debugfs_register(struct intel_gt *gt, struct dentry *root)
{ {
static const struct intel_gt_debugfs_file files[] = { static const struct intel_gt_debugfs_file files[] = {
@ -664,6 +694,7 @@ void intel_gt_pm_debugfs_register(struct intel_gt *gt, struct dentry *root)
{ "forcewake_user", &forcewake_user_fops, NULL}, { "forcewake_user", &forcewake_user_fops, NULL},
{ "llc", &llc_fops, llc_eval }, { "llc", &llc_fops, llc_eval },
{ "rps_boost", &rps_boost_fops, rps_eval }, { "rps_boost", &rps_boost_fops, rps_eval },
{ "perf_limit_reasons", &perf_limit_reasons_fops, NULL },
}; };
intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), gt); intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), gt);

View file

@ -1866,6 +1866,7 @@
#define POWER_LIMIT_4_MASK REG_BIT(8) #define POWER_LIMIT_4_MASK REG_BIT(8)
#define POWER_LIMIT_1_MASK REG_BIT(10) #define POWER_LIMIT_1_MASK REG_BIT(10)
#define POWER_LIMIT_2_MASK REG_BIT(11) #define POWER_LIMIT_2_MASK REG_BIT(11)
#define GT0_PERF_LIMIT_REASONS_LOG_MASK REG_GENMASK(31, 16)
#define CHV_CLK_CTL1 _MMIO(0x101100) #define CHV_CLK_CTL1 _MMIO(0x101100)
#define VLV_CLK_CTL2 _MMIO(0x101104) #define VLV_CLK_CTL2 _MMIO(0x101104)