]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/selftests: Assign the intel_runtime_pm pointer for mock_uncore
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 8 Oct 2019 14:50:45 +0000 (15:50 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 8 Oct 2019 15:21:50 +0000 (16:21 +0100)
Couple up our mock_uncore to know about the fake global device and its
runtime powermanagement.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Reviewed-by: Matthew Auld <matthew.william.auld@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191008145045.23157-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/mock_engine.c
drivers/gpu/drm/i915/selftests/mock_gem_device.c
drivers/gpu/drm/i915/selftests/mock_uncore.c
drivers/gpu/drm/i915/selftests/mock_uncore.h

index 3d88397c0dbbccf70b8851b1e0b3dd0408dcf174..747f7c7790eb9687b0f91c068b5c5bf9d675f23a 100644 (file)
@@ -240,6 +240,7 @@ struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,
        struct mock_engine *engine;
 
        GEM_BUG_ON(id >= I915_NUM_ENGINES);
+       GEM_BUG_ON(!i915->gt.uncore);
 
        engine = kzalloc(sizeof(*engine) + PAGE_SIZE, GFP_KERNEL);
        if (!engine)
index 70a7026db08dd281015680bf067c31cbc7c21dc0..d14c6d8735fe8bf586f9dbbcaa875a73cdfaa2bf 100644 (file)
@@ -162,7 +162,7 @@ struct drm_i915_private *mock_gem_device(void)
                I915_GTT_PAGE_SIZE_64K |
                I915_GTT_PAGE_SIZE_2M;
 
-       mock_uncore_init(&i915->uncore);
+       mock_uncore_init(&i915->uncore, i915);
        i915_gem_init__mm(i915);
        intel_gt_init_early(&i915->gt, i915);
        atomic_inc(&i915->gt.wakeref.count); /* disable; no hw support */
index 49585f16d4a2f3f54347da0332078f4b328bcb42..ca57e4008701d86aff8f03ec1289ce2049d20a37 100644 (file)
@@ -39,8 +39,11 @@ __nop_read(16)
 __nop_read(32)
 __nop_read(64)
 
-void mock_uncore_init(struct intel_uncore *uncore)
+void mock_uncore_init(struct intel_uncore *uncore,
+                     struct drm_i915_private *i915)
 {
+       intel_uncore_init_early(uncore, i915);
+
        ASSIGN_RAW_WRITE_MMIO_VFUNCS(uncore, nop);
        ASSIGN_RAW_READ_MMIO_VFUNCS(uncore, nop);
 }
index dacb36b5ffcdf6a147d5402e7d54cd352cd5d631..8a2cc553f466dde3af03f2b2e4f6280de6c4666b 100644 (file)
@@ -25,6 +25,7 @@
 #ifndef __MOCK_UNCORE_H
 #define __MOCK_UNCORE_H
 
-void mock_uncore_init(struct intel_uncore *uncore);
+void mock_uncore_init(struct intel_uncore *uncore,
+                     struct drm_i915_private *i915);
 
 #endif /* !__MOCK_UNCORE_H */