aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2016-08-05 16:28:28 -0400
committerVille Syrjälä <ville.syrjala@linux.intel.com>2016-08-05 16:28:28 -0400
commit522a63de18a12a3c74609323f984790e21d4a47e (patch)
tree1a8f74f296f698d39df7fecff457e9187635c279
parent739748939974791b84629a8790527a16f76873a4 (diff)
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: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Testcase: drv_hangman.reset-with-forced-modeset Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1470428910-12125-3-git-send-email-ville.syrjala@linux.intel.com Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-rw-r--r--drivers/gpu/drm/i915/i915_params.c6
-rw-r--r--drivers/gpu/drm/i915/i915_params.h1
-rw-r--r--drivers/gpu/drm/i915/intel_display.c29
3 files changed, 25 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index b6e404c91eed..768ad89d9cd4 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -45,6 +45,7 @@ struct i915_params i915 __read_mostly = {
45 .fastboot = 0, 45 .fastboot = 0,
46 .prefault_disable = 0, 46 .prefault_disable = 0,
47 .load_detect_test = 0, 47 .load_detect_test = 0,
48 .force_reset_modeset_test = 0,
48 .reset = true, 49 .reset = true,
49 .invert_brightness = 0, 50 .invert_brightness = 0,
50 .disable_display = 0, 51 .disable_display = 0,
@@ -161,6 +162,11 @@ MODULE_PARM_DESC(load_detect_test,
161 "Force-enable the VGA load detect code for testing (default:false). " 162 "Force-enable the VGA load detect code for testing (default:false). "
162 "For developers only."); 163 "For developers only.");
163 164
165module_param_named_unsafe(force_reset_modeset_test, i915.force_reset_modeset_test, bool, 0600);
166MODULE_PARM_DESC(force_reset_modeset_test,
167 "Force a modeset during gpu reset for testing (default:false). "
168 "For developers only.");
169
164module_param_named_unsafe(invert_brightness, i915.invert_brightness, int, 0600); 170module_param_named_unsafe(invert_brightness, i915.invert_brightness, int, 0600);
165MODULE_PARM_DESC(invert_brightness, 171MODULE_PARM_DESC(invert_brightness,
166 "Invert backlight brightness " 172 "Invert backlight brightness "
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 0ad020b4a925..3a0dd78ddb38 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -57,6 +57,7 @@ struct i915_params {
57 bool fastboot; 57 bool fastboot;
58 bool prefault_disable; 58 bool prefault_disable;
59 bool load_detect_test; 59 bool load_detect_test;
60 bool force_reset_modeset_test;
60 bool reset; 61 bool reset;
61 bool disable_display; 62 bool disable_display;
62 bool verbose_state_checks; 63 bool verbose_state_checks;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a95139575324..8fa200bfc2c1 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3161,7 +3161,8 @@ void intel_prepare_reset(struct drm_i915_private *dev_priv)
3161 } 3161 }
3162 3162
3163 /* reset doesn't touch the display, but flips might get nuked anyway, */ 3163 /* reset doesn't touch the display, but flips might get nuked anyway, */
3164 if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv)) 3164 if (!i915.force_reset_modeset_test &&
3165 (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv)))
3165 return; 3166 return;
3166 3167
3167 /* 3168 /*
@@ -3212,16 +3213,22 @@ void intel_finish_reset(struct drm_i915_private *dev_priv)
3212 3213
3213 /* reset doesn't touch the display */ 3214 /* reset doesn't touch the display */
3214 if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv)) { 3215 if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv)) {
3215 /* 3216 if (!state) {
3216 * Flips in the rings have been nuked by the reset, 3217 /*
3217 * so update the base address of all primary 3218 * Flips in the rings have been nuked by the reset,
3218 * planes to the the last fb to make sure we're 3219 * so update the base address of all primary
3219 * showing the correct fb after a reset. 3220 * planes to the the last fb to make sure we're
3220 * 3221 * showing the correct fb after a reset.
3221 * FIXME: Atomic will make this obsolete since we won't schedule 3222 *
3222 * CS-based flips (which might get lost in gpu resets) any more. 3223 * FIXME: Atomic will make this obsolete since we won't schedule
3223 */ 3224 * CS-based flips (which might get lost in gpu resets) any more.
3224 intel_update_primary_planes(dev); 3225 */
3226 intel_update_primary_planes(dev);
3227 } else {
3228 ret = __intel_display_resume(dev, state);
3229 if (ret)
3230 DRM_ERROR("Restoring old state failed with %i\n", ret);
3231 }
3225 } else { 3232 } else {
3226 /* 3233 /*
3227 * The display has been reset as well, 3234 * The display has been reset as well,