diff options
author | Keith Packard <keithp@keithp.com> | 2012-01-06 14:34:04 -0500 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-01-19 15:27:24 -0500 |
commit | b6e45f866465f42b53d803b0c574da0fc508a0e9 (patch) | |
tree | 276400002339e2475f01074430b32373a76179c8 /drivers/gpu/drm/i915/i915_drv.c | |
parent | 9f1f46a45a681d357d1ceedecec3671a5ae957f4 (diff) |
drm/i915: Move reset forcewake processing to gen6_do_reset
No reason to have half of the reset split from the other half.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index bdf6a1b36223..a6fcd941e3ab 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -600,9 +600,17 @@ static int ironlake_do_reset(struct drm_device *dev, u8 flags) | |||
600 | static int gen6_do_reset(struct drm_device *dev, u8 flags) | 600 | static int gen6_do_reset(struct drm_device *dev, u8 flags) |
601 | { | 601 | { |
602 | struct drm_i915_private *dev_priv = dev->dev_private; | 602 | struct drm_i915_private *dev_priv = dev->dev_private; |
603 | int ret; | ||
604 | unsigned long irqflags; | ||
603 | 605 | ||
604 | I915_WRITE(GEN6_GDRST, GEN6_GRDOM_FULL); | 606 | I915_WRITE(GEN6_GDRST, GEN6_GRDOM_FULL); |
605 | return wait_for((I915_READ(GEN6_GDRST) & GEN6_GRDOM_FULL) == 0, 500); | 607 | ret = wait_for((I915_READ(GEN6_GDRST) & GEN6_GRDOM_FULL) == 0, 500); |
608 | /* If reset with a user forcewake, try to restore */ | ||
609 | spin_lock_irqsave(&dev_priv->gt_lock, irqflags); | ||
610 | if (dev_priv->forcewake_count) | ||
611 | dev_priv->display.force_wake_get(dev_priv); | ||
612 | spin_unlock_irqrestore(&dev_priv->gt_lock, irqflags); | ||
613 | return ret; | ||
606 | } | 614 | } |
607 | 615 | ||
608 | /** | 616 | /** |
@@ -629,7 +637,6 @@ int i915_reset(struct drm_device *dev, u8 flags) | |||
629 | * need to | 637 | * need to |
630 | */ | 638 | */ |
631 | bool need_display = true; | 639 | bool need_display = true; |
632 | unsigned long irqflags; | ||
633 | int ret; | 640 | int ret; |
634 | 641 | ||
635 | if (!i915_try_reset) | 642 | if (!i915_try_reset) |
@@ -647,11 +654,6 @@ int i915_reset(struct drm_device *dev, u8 flags) | |||
647 | case 7: | 654 | case 7: |
648 | case 6: | 655 | case 6: |
649 | ret = gen6_do_reset(dev, flags); | 656 | ret = gen6_do_reset(dev, flags); |
650 | /* If reset with a user forcewake, try to restore */ | ||
651 | spin_lock_irqsave(&dev_priv->gt_lock, irqflags); | ||
652 | if (dev_priv->forcewake_count) | ||
653 | dev_priv->display.force_wake_get(dev_priv); | ||
654 | spin_unlock_irqrestore(&dev_priv->gt_lock, irqflags); | ||
655 | break; | 657 | break; |
656 | case 5: | 658 | case 5: |
657 | ret = ironlake_do_reset(dev, flags); | 659 | ret = ironlake_do_reset(dev, flags); |