Commit 522a63de authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Ville Syrjälä

drm/i915: Add a way to test the modeset done during gpu reset, v3.

Add force_reset_modeset_test as a parameter to force the modeset path during gpu reset.
This allows a IGT test to set the knob and trigger a hang to force the gpu reset,
even on platforms that wouldn't otherwise require it.

Changes since v1:
- Split out fix to separate commit.
Changes since v2:
- This commit is purely about force_reset_modeset_test now.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Testcase: drv_hangman.reset-with-forced-modeset
Tested-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1470428910-12125-3-git-send-email-ville.syrjala@linux.intel.comSigned-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
parent 73974893
...@@ -45,6 +45,7 @@ struct i915_params i915 __read_mostly = { ...@@ -45,6 +45,7 @@ struct i915_params i915 __read_mostly = {
.fastboot = 0, .fastboot = 0,
.prefault_disable = 0, .prefault_disable = 0,
.load_detect_test = 0, .load_detect_test = 0,
.force_reset_modeset_test = 0,
.reset = true, .reset = true,
.invert_brightness = 0, .invert_brightness = 0,
.disable_display = 0, .disable_display = 0,
...@@ -161,6 +162,11 @@ MODULE_PARM_DESC(load_detect_test, ...@@ -161,6 +162,11 @@ MODULE_PARM_DESC(load_detect_test,
"Force-enable the VGA load detect code for testing (default:false). " "Force-enable the VGA load detect code for testing (default:false). "
"For developers only."); "For developers only.");
module_param_named_unsafe(force_reset_modeset_test, i915.force_reset_modeset_test, bool, 0600);
MODULE_PARM_DESC(force_reset_modeset_test,
"Force a modeset during gpu reset for testing (default:false). "
"For developers only.");
module_param_named_unsafe(invert_brightness, i915.invert_brightness, int, 0600); module_param_named_unsafe(invert_brightness, i915.invert_brightness, int, 0600);
MODULE_PARM_DESC(invert_brightness, MODULE_PARM_DESC(invert_brightness,
"Invert backlight brightness " "Invert backlight brightness "
......
...@@ -57,6 +57,7 @@ struct i915_params { ...@@ -57,6 +57,7 @@ struct i915_params {
bool fastboot; bool fastboot;
bool prefault_disable; bool prefault_disable;
bool load_detect_test; bool load_detect_test;
bool force_reset_modeset_test;
bool reset; bool reset;
bool disable_display; bool disable_display;
bool verbose_state_checks; bool verbose_state_checks;
......
...@@ -3161,7 +3161,8 @@ void intel_prepare_reset(struct drm_i915_private *dev_priv) ...@@ -3161,7 +3161,8 @@ void intel_prepare_reset(struct drm_i915_private *dev_priv)
} }
/* reset doesn't touch the display, but flips might get nuked anyway, */ /* reset doesn't touch the display, but flips might get nuked anyway, */
if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv)) if (!i915.force_reset_modeset_test &&
(INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv)))
return; return;
/* /*
...@@ -3212,16 +3213,22 @@ void intel_finish_reset(struct drm_i915_private *dev_priv) ...@@ -3212,16 +3213,22 @@ void intel_finish_reset(struct drm_i915_private *dev_priv)
/* reset doesn't touch the display */ /* reset doesn't touch the display */
if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv)) { if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv)) {
/* if (!state) {
* Flips in the rings have been nuked by the reset, /*
* so update the base address of all primary * Flips in the rings have been nuked by the reset,
* planes to the the last fb to make sure we're * so update the base address of all primary
* showing the correct fb after a reset. * planes to the the last fb to make sure we're
* * showing the correct fb after a reset.
* FIXME: Atomic will make this obsolete since we won't schedule *
* CS-based flips (which might get lost in gpu resets) any more. * FIXME: Atomic will make this obsolete since we won't schedule
*/ * CS-based flips (which might get lost in gpu resets) any more.
intel_update_primary_planes(dev); */
intel_update_primary_planes(dev);
} else {
ret = __intel_display_resume(dev, state);
if (ret)
DRM_ERROR("Restoring old state failed with %i\n", ret);
}
} else { } else {
/* /*
* The display has been reset as well, * The display has been reset as well,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment