Commit 4ac2ba2f authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Introduce gpu_reset_clobbers_display()

Factor out the "does the GPU reset clobber the display?" check into a
small helper.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1470428910-12125-4-git-send-email-ville.syrjala@linux.intel.comReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 522a63de
...@@ -3135,6 +3135,11 @@ __intel_display_resume(struct drm_device *dev, ...@@ -3135,6 +3135,11 @@ __intel_display_resume(struct drm_device *dev,
return ret; return ret;
} }
static bool gpu_reset_clobbers_display(struct drm_i915_private *dev_priv)
{
return INTEL_GEN(dev_priv) < 5 && !IS_G4X(dev_priv);
}
void intel_prepare_reset(struct drm_i915_private *dev_priv) void intel_prepare_reset(struct drm_i915_private *dev_priv)
{ {
struct drm_device *dev = &dev_priv->drm; struct drm_device *dev = &dev_priv->drm;
...@@ -3162,7 +3167,7 @@ void intel_prepare_reset(struct drm_i915_private *dev_priv) ...@@ -3162,7 +3167,7 @@ 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 (!i915.force_reset_modeset_test && if (!i915.force_reset_modeset_test &&
(INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))) !gpu_reset_clobbers_display(dev_priv))
return; return;
/* /*
...@@ -3212,7 +3217,7 @@ void intel_finish_reset(struct drm_i915_private *dev_priv) ...@@ -3212,7 +3217,7 @@ void intel_finish_reset(struct drm_i915_private *dev_priv)
dev_priv->modeset_restore_state = NULL; dev_priv->modeset_restore_state = NULL;
/* reset doesn't touch the display */ /* reset doesn't touch the display */
if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv)) { if (!gpu_reset_clobbers_display(dev_priv)) {
if (!state) { if (!state) {
/* /*
* Flips in the rings have been nuked by the reset, * Flips in the rings have been nuked by the reset,
......
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