* Copyright © 2020 Intel Corporation
*/
+#include <linux/pm_qos.h>
#include <linux/sort.h>
#include "intel_engine_pm.h"
#include "selftests/igt_spinner.h"
#include "selftests/librapl.h"
+/* Try to isolate the impact of cstates from determing frequency response */
+#define CPU_LATENCY 0 /* -1 to disable pm_qos, 0 to disable cstates */
+
static void dummy_rps_work(struct work_struct *wrk)
{
}
struct intel_gt *gt = arg;
struct intel_rps *rps = >->rps;
struct intel_engine_cs *engine;
+ struct pm_qos_request qos;
enum intel_engine_id id;
int err = 0;
if (INTEL_GEN(gt->i915) < 8) /* for CS simplicity */
return 0;
+ if (CPU_LATENCY >= 0)
+ cpu_latency_qos_add_request(&qos, CPU_LATENCY);
+
intel_gt_pm_wait_for_idle(gt);
saved_work = rps->work.func;
rps->work.func = dummy_rps_work;
intel_gt_pm_wait_for_idle(gt);
rps->work.func = saved_work;
+ if (CPU_LATENCY >= 0)
+ cpu_latency_qos_remove_request(&qos);
+
return err;
}
struct intel_gt *gt = arg;
struct intel_rps *rps = >->rps;
struct intel_engine_cs *engine;
+ struct pm_qos_request qos;
enum intel_engine_id id;
int err = 0;
if (INTEL_GEN(gt->i915) < 8) /* for CS simplicity */
return 0;
+ if (CPU_LATENCY >= 0)
+ cpu_latency_qos_add_request(&qos, CPU_LATENCY);
+
intel_gt_pm_wait_for_idle(gt);
saved_work = rps->work.func;
rps->work.func = dummy_rps_work;
intel_gt_pm_wait_for_idle(gt);
rps->work.func = saved_work;
+ if (CPU_LATENCY >= 0)
+ cpu_latency_qos_remove_request(&qos);
+
return err;
}