drm/i915: Copy default modparams to mock i915_device
diff mbox series

Message ID 20200721204001.12473-1-chris@chris-wilson.co.uk
State New
Headers show
Series
  • drm/i915: Copy default modparams to mock i915_device
Related show

Commit Message

Chris Wilson July 21, 2020, 8:40 p.m. UTC
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>
---
 drivers/gpu/drm/i915/selftests/mock_gem_device.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Tvrtko Ursulin July 22, 2020, 8:13 a.m. UTC | #1
On 21/07/2020 21:40, Chris Wilson wrote:
> 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>
> ---
>   drivers/gpu/drm/i915/selftests/mock_gem_device.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> index 9a46be05425a..ce4d4303229c 100644
> --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
> @@ -77,6 +77,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;
>   }
> @@ -159,6 +160,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 */
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
index 9a46be05425a..ce4d4303229c 100644
--- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
+++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
@@ -77,6 +77,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;
 }
@@ -159,6 +160,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 */