]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/i915: Copy default modparams to mock i915_device
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 28 Jul 2020 15:06:00 +0000 (16:06 +0100)
committerJani Nikula <jani.nikula@intel.com>
Wed, 19 Aug 2020 12:23:07 +0000 (15:23 +0300)
Since we use the module parameters stored inside the drm_i915_device
itself, we need to ensure the mock i915_device also sets up the right
defaults.

Fixes: 8a25c4be583d ("drm/i915/params: switch to device specific parameters")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200728150600.4509-1-chris@chris-wilson.co.uk
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit 98ef067453709444a264939940f7b3a5dfdfa09e)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/selftests/mock_gem_device.c

index b9810bf156c362a1b86fa013cb044491c61be559..f127e633f7ca816b40fccb64d6a7f3ac4aad44a8 100644 (file)
@@ -78,6 +78,7 @@ static void mock_device_release(struct drm_device *dev)
        drm_mode_config_cleanup(&i915->drm);
 
 out:
+       i915_params_free(&i915->params);
        put_device(&i915->drm.pdev->dev);
        i915->drm.pdev = NULL;
 }
@@ -165,6 +166,8 @@ struct drm_i915_private *mock_gem_device(void)
        i915->drm.pdev = pdev;
        drmm_add_final_kfree(&i915->drm, i915);
 
+       i915_params_copy(&i915->params, &i915_modparams);
+
        intel_runtime_pm_init_early(&i915->runtime_pm);
 
        /* Using the global GTT may ask questions about KMS users, so prepare */