diff options
author | Chris Wilson <[email protected]> | 2019-09-27 22:17:48 +0100 |
---|---|---|
committer | Chris Wilson <[email protected]> | 2019-09-27 23:25:30 +0100 |
commit | 4e18ca703f2167d8bcb7f736271744131e3c390b (patch) | |
tree | e5ce22179ddae7ff9d5a1853005834324ddb43d4 | |
parent | 260e6b712769d74304093a699796ebf134aef095 (diff) |
drm/i915/selftests: Distinguish mock device from no wakeref
On systems that have no runtime-pm, we mark the wakeref as being -1. We
therefore cannot use that value for the mock-gt indicator, so opt for
-ENODEV instead. The wakeref should never be an error value -- one
hopes!
Signed-off-by: Chris Wilson <[email protected]>
Cc: Andi Shyti <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/gpu/drm/i915/gt/intel_gt_pm.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/selftests/mock_gem_device.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.h b/drivers/gpu/drm/i915/gt/intel_gt_pm.h index ab794e853356..997770d3a968 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.h +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.h @@ -57,7 +57,7 @@ int intel_gt_runtime_resume(struct intel_gt *gt); static inline bool is_mock_gt(const struct intel_gt *gt) { - return I915_SELFTEST_ONLY(gt->awake == -1); + return I915_SELFTEST_ONLY(gt->awake == -ENODEV); } #endif /* INTEL_GT_PM_H */ diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c index 91f15fa728cd..2448067822af 100644 --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c @@ -182,6 +182,7 @@ struct drm_i915_private *mock_gem_device(void) i915_gem_init__mm(i915); intel_gt_init_early(&i915->gt, i915); atomic_inc(&i915->gt.wakeref.count); /* disable; no hw support */ + i915->gt.awake = -ENODEV; i915->wq = alloc_ordered_workqueue("mock", 0); if (!i915->wq) @@ -192,8 +193,6 @@ struct drm_i915_private *mock_gem_device(void) INIT_DELAYED_WORK(&i915->gem.retire_work, mock_retire_work_handler); INIT_WORK(&i915->gem.idle_work, mock_idle_work_handler); - i915->gt.awake = -1; - intel_timelines_init(i915); mutex_lock(&i915->drm.struct_mutex); |