Commit 542c184f authored by Robert Beckett's avatar Robert Beckett Committed by Daniel Vetter

drm/i915: Simplify intel_gpu_reset

Replaced ever growing switch for gen version with chained conditionals.
Futre gen's only need to add a new one if they require something different.
Reviewed-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
Signed-off-by: default avatarRobert Beckett <robert.beckett@intel.com>
[danvet: Picked from internal tree and white-wash commit message.]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent d5ec2639
...@@ -1154,18 +1154,16 @@ static int gen6_do_reset(struct drm_device *dev) ...@@ -1154,18 +1154,16 @@ static int gen6_do_reset(struct drm_device *dev)
int intel_gpu_reset(struct drm_device *dev) int intel_gpu_reset(struct drm_device *dev)
{ {
switch (INTEL_INFO(dev)->gen) { if (INTEL_INFO(dev)->gen >= 6)
case 8: return gen6_do_reset(dev);
case 7: else if (IS_GEN5(dev))
case 6: return gen6_do_reset(dev); return ironlake_do_reset(dev);
case 5: return ironlake_do_reset(dev); else if (IS_G4X(dev))
case 4:
if (IS_G4X(dev))
return g4x_do_reset(dev); return g4x_do_reset(dev);
else else if (IS_GEN4(dev))
return i965_do_reset(dev); return i965_do_reset(dev);
default: return -ENODEV; else
} return -ENODEV;
} }
void intel_uncore_check_errors(struct drm_device *dev) void intel_uncore_check_errors(struct drm_device *dev)
......
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