drm/i915/selftest: Fix ktime_get() and h/w access order
Use ktime_get() after accessing the mmio or any driver resource, while using wall time for various calculation that depends on the inserted delay in order to account any mmio and resource access latency. Cc: Chris Wilson <chris.p.wilson@intel.com> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230223100503.3323627-3-anshuman.gupta@intel.com
This commit is contained in:
parent
29b41cf707
commit
4d14d7717f
1 changed files with 3 additions and 3 deletions
|
@ -537,8 +537,8 @@ static u64 __measure_frequency(u32 *cntr, int duration_ms)
|
||||||
{
|
{
|
||||||
u64 dc, dt;
|
u64 dc, dt;
|
||||||
|
|
||||||
dt = ktime_get();
|
|
||||||
dc = READ_ONCE(*cntr);
|
dc = READ_ONCE(*cntr);
|
||||||
|
dt = ktime_get();
|
||||||
usleep_range(1000 * duration_ms, 2000 * duration_ms);
|
usleep_range(1000 * duration_ms, 2000 * duration_ms);
|
||||||
dc = READ_ONCE(*cntr) - dc;
|
dc = READ_ONCE(*cntr) - dc;
|
||||||
dt = ktime_get() - dt;
|
dt = ktime_get() - dt;
|
||||||
|
@ -566,8 +566,8 @@ static u64 __measure_cs_frequency(struct intel_engine_cs *engine,
|
||||||
{
|
{
|
||||||
u64 dc, dt;
|
u64 dc, dt;
|
||||||
|
|
||||||
dt = ktime_get();
|
|
||||||
dc = intel_uncore_read_fw(engine->uncore, CS_GPR(0));
|
dc = intel_uncore_read_fw(engine->uncore, CS_GPR(0));
|
||||||
|
dt = ktime_get();
|
||||||
usleep_range(1000 * duration_ms, 2000 * duration_ms);
|
usleep_range(1000 * duration_ms, 2000 * duration_ms);
|
||||||
dc = intel_uncore_read_fw(engine->uncore, CS_GPR(0)) - dc;
|
dc = intel_uncore_read_fw(engine->uncore, CS_GPR(0)) - dc;
|
||||||
dt = ktime_get() - dt;
|
dt = ktime_get() - dt;
|
||||||
|
@ -1094,8 +1094,8 @@ static u64 __measure_power(int duration_ms)
|
||||||
{
|
{
|
||||||
u64 dE, dt;
|
u64 dE, dt;
|
||||||
|
|
||||||
dt = ktime_get();
|
|
||||||
dE = librapl_energy_uJ();
|
dE = librapl_energy_uJ();
|
||||||
|
dt = ktime_get();
|
||||||
usleep_range(1000 * duration_ms, 2000 * duration_ms);
|
usleep_range(1000 * duration_ms, 2000 * duration_ms);
|
||||||
dE = librapl_energy_uJ() - dE;
|
dE = librapl_energy_uJ() - dE;
|
||||||
dt = ktime_get() - dt;
|
dt = ktime_get() - dt;
|
||||||
|
|
Loading…
Add table
Reference in a new issue