diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gpu_error.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gpu_error.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 8762d17b6659..3eb33e000d6f 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c | |||
@@ -648,6 +648,9 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m, | |||
648 | return 0; | 648 | return 0; |
649 | } | 649 | } |
650 | 650 | ||
651 | if (IS_ERR(error)) | ||
652 | return PTR_ERR(error); | ||
653 | |||
651 | if (*error->error_msg) | 654 | if (*error->error_msg) |
652 | err_printf(m, "%s\n", error->error_msg); | 655 | err_printf(m, "%s\n", error->error_msg); |
653 | err_printf(m, "Kernel: " UTS_RELEASE "\n"); | 656 | err_printf(m, "Kernel: " UTS_RELEASE "\n"); |
@@ -1859,6 +1862,7 @@ void i915_capture_error_state(struct drm_i915_private *i915, | |||
1859 | error = i915_capture_gpu_state(i915); | 1862 | error = i915_capture_gpu_state(i915); |
1860 | if (!error) { | 1863 | if (!error) { |
1861 | DRM_DEBUG_DRIVER("out of memory, not capturing error state\n"); | 1864 | DRM_DEBUG_DRIVER("out of memory, not capturing error state\n"); |
1865 | i915_disable_error_state(i915, -ENOMEM); | ||
1862 | return; | 1866 | return; |
1863 | } | 1867 | } |
1864 | 1868 | ||
@@ -1914,5 +1918,14 @@ void i915_reset_error_state(struct drm_i915_private *i915) | |||
1914 | i915->gpu_error.first_error = NULL; | 1918 | i915->gpu_error.first_error = NULL; |
1915 | spin_unlock_irq(&i915->gpu_error.lock); | 1919 | spin_unlock_irq(&i915->gpu_error.lock); |
1916 | 1920 | ||
1917 | i915_gpu_state_put(error); | 1921 | if (!IS_ERR(error)) |
1922 | i915_gpu_state_put(error); | ||
1923 | } | ||
1924 | |||
1925 | void i915_disable_error_state(struct drm_i915_private *i915, int err) | ||
1926 | { | ||
1927 | spin_lock_irq(&i915->gpu_error.lock); | ||
1928 | if (!i915->gpu_error.first_error) | ||
1929 | i915->gpu_error.first_error = ERR_PTR(err); | ||
1930 | spin_unlock_irq(&i915->gpu_error.lock); | ||
1918 | } | 1931 | } |