drm/i915/selftests: Disable runtime pm wakeref tracking for the mock device
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 4 Feb 2022 17:10:53 +0000 (19:10 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 11 Feb 2022 11:22:10 +0000 (13:22 +0200)
commit c50df701d49e ("drm/i915: Enable rpm wakeref tracking
whether runtime pm is enabled or not") enabled wakeref tracking
even for the mock device. Turns out that has somewhat significant
overhead, and on the glacial Core m3's we have in CI the vma
selftests are now exceeding the allotted time budget.

So let's disable the wakeref tracking once again for the mock
device in order to avoid blowing up the selftest runtime.

Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Acked-by: Tomi Sarvela <tomi.p.sarvela@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220204171053.18409-1-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/intel_runtime_pm.c
drivers/gpu/drm/i915/intel_runtime_pm.h
drivers/gpu/drm/i915/selftests/mock_gem_device.c

index 3293ac71bcf865bb0ede9db4eb77e3c1e1dda845..6ed5786bcd299cec96a66025f9b924626ed4d172 100644 (file)
@@ -77,6 +77,9 @@ track_intel_runtime_pm_wakeref(struct intel_runtime_pm *rpm)
        depot_stack_handle_t stack, *stacks;
        unsigned long flags;
 
+       if (rpm->no_wakeref_tracking)
+               return -1;
+
        stack = __save_depot_stack();
        if (!stack)
                return -1;
index 47a85fab4130787067575ccbd2c7c2d374644083..d9160e3ff4afcf99adb8da12c58f0b1779da252b 100644 (file)
@@ -51,6 +51,7 @@ struct intel_runtime_pm {
        bool available;
        bool suspended;
        bool irqs_enabled;
+       bool no_wakeref_tracking;
 
 #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM)
        /*
index 8aa7b1d338659c2c249fe6e21b7f91fd0427f174..79e819334b4ee7227c6ffb6aeba99ad907d9ef7d 100644 (file)
@@ -161,6 +161,8 @@ struct drm_i915_private *mock_gem_device(void)
        i915_params_copy(&i915->params, &i915_modparams);
 
        intel_runtime_pm_init_early(&i915->runtime_pm);
+       /* wakeref tracking has significant overhead */
+       i915->runtime_pm.no_wakeref_tracking = true;
 
        /* Using the global GTT may ask questions about KMS users, so prepare */
        drm_mode_config_init(&i915->drm);