提交 f803aa55 编写于 作者: C Chris Wilson

drm/i915: Clean up bo lists on all hung gpus

Previously we only tidied up the active bo lists for chipsets were we
would attempt to reset the GPU. However, this action is necessary for
the system to continue and reclaim the dead bo for all chipsets.

Pointed out, in passing, by Owain Ainsworth.
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
上级 77f01230
...@@ -368,7 +368,7 @@ static int ironlake_do_reset(struct drm_device *dev, u8 flags) ...@@ -368,7 +368,7 @@ static int ironlake_do_reset(struct drm_device *dev, u8 flags)
* - re-init interrupt state * - re-init interrupt state
* - re-init display * - re-init display
*/ */
int i965_reset(struct drm_device *dev, u8 flags) int i915_reset(struct drm_device *dev, u8 flags)
{ {
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
/* /*
...@@ -401,14 +401,19 @@ int i965_reset(struct drm_device *dev, u8 flags) ...@@ -401,14 +401,19 @@ int i965_reset(struct drm_device *dev, u8 flags)
* well as the reset bit (GR/bit 0). Setting the GR bit * well as the reset bit (GR/bit 0). Setting the GR bit
* triggers the reset; when done, the hardware will clear it. * triggers the reset; when done, the hardware will clear it.
*/ */
if (IS_IRONLAKE(dev)) ret = -ENODEV;
switch (INTEL_INFO(dev)->gen) {
case 5:
ret = ironlake_do_reset(dev, flags); ret = ironlake_do_reset(dev, flags);
else break;
case 4:
ret = i965_do_reset(dev, flags); ret = i965_do_reset(dev, flags);
break;
}
if (ret) { if (ret) {
WARN(true, "i915: Failed to reset chip\n"); DRM_ERROR("Failed to reset chip.\n");
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
return -EIO; return ret;
} }
/* Ok, now get things going again... */ /* Ok, now get things going again... */
......
...@@ -874,7 +874,7 @@ extern long i915_compat_ioctl(struct file *filp, unsigned int cmd, ...@@ -874,7 +874,7 @@ extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
extern int i915_emit_box(struct drm_device *dev, extern int i915_emit_box(struct drm_device *dev,
struct drm_clip_rect *boxes, struct drm_clip_rect *boxes,
int i, int DR1, int DR4); int i, int DR1, int DR4);
extern int i965_reset(struct drm_device *dev, u8 flags); extern int i915_reset(struct drm_device *dev, u8 flags);
extern unsigned long i915_chipset_val(struct drm_i915_private *dev_priv); extern unsigned long i915_chipset_val(struct drm_i915_private *dev_priv);
extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv); extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv);
extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv); extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv);
......
...@@ -397,19 +397,11 @@ static void i915_error_work_func(struct work_struct *work) ...@@ -397,19 +397,11 @@ static void i915_error_work_func(struct work_struct *work)
kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, error_event); kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, error_event);
if (atomic_read(&dev_priv->mm.wedged)) { if (atomic_read(&dev_priv->mm.wedged)) {
switch (INTEL_INFO(dev)->gen) { DRM_DEBUG_DRIVER("resetting chip\n");
case 5: kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, reset_event);
case 4: if (!i915_reset(dev, GRDOM_RENDER)) {
DRM_DEBUG_DRIVER("resetting chip\n"); atomic_set(&dev_priv->mm.wedged, 0);
kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, reset_event); kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, reset_done_event);
if (!i965_reset(dev, GRDOM_RENDER)) {
atomic_set(&dev_priv->mm.wedged, 0);
kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, reset_done_event);
}
break;
default:
DRM_DEBUG_DRIVER("reboot required\n");
break;
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册