Module Name: src
Committed By: riastradh
Date: Mon Aug 27 14:52:56 UTC 2018
Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: i915_irq.c intel_lrc.c
Log Message:
Advance by 4-byte quantities, not by 1-byte quantities.
To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/dist/drm/i915/intel_lrc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c:1.15 src/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c:1.16
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c:1.15 Mon Aug 27 14:45:11 2018
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c Mon Aug 27 14:52:56 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: i915_irq.c,v 1.15 2018/08/27 14:45:11 riastradh Exp $ */
+/* $NetBSD: i915_irq.c,v 1.16 2018/08/27 14:52:56 riastradh Exp $ */
/* i915_irq.c -- IRQ support for the I915 -*- linux-c -*-
*/
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_irq.c,v 1.15 2018/08/27 14:45:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_irq.c,v 1.16 2018/08/27 14:52:56 riastradh Exp $");
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -2677,6 +2677,34 @@ void i915_handle_error(struct drm_device
}
i915_reset_and_wakeup(dev);
+
+ do {
+ struct i915_error_state_file_priv error_priv;
+ struct drm_i915_error_state_buf error_str;
+ int ret;
+
+ memset(&error_priv, 0, sizeof(error_priv));
+
+ ret = i915_error_state_buf_init(&error_str, dev_priv, 512*1024, 0);
+ if (ret) {
+ DRM_ERROR("Failed to initialize error buf: %d\n", ret);
+ break;
+ }
+ error_priv.dev = dev;
+ i915_error_state_get(dev, &error_priv);
+
+ ret = i915_error_state_to_str(&error_str, &error_priv);
+ if (ret) {
+ DRM_ERROR("Failed to format error buf: %d\n", ret);
+ i915_error_state_put(&error_priv);
+ }
+
+ error_str.buf[MIN(error_str.size - 1, error_str.bytes)] = '\0';
+ DRM_ERROR("Error state:\n%s\n", error_str.buf);
+
+ i915_error_state_buf_release(&error_str);
+ i915_error_state_put(&error_priv);
+ } while (0);
}
/* Called from drm generic code, passed 'crtc' which
Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_lrc.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_lrc.c:1.6 src/sys/external/bsd/drm2/dist/drm/i915/intel_lrc.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_lrc.c:1.6 Mon Aug 27 07:24:25 2018
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_lrc.c Mon Aug 27 14:52:56 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: intel_lrc.c,v 1.6 2018/08/27 07:24:25 riastradh Exp $ */
+/* $NetBSD: intel_lrc.c,v 1.7 2018/08/27 14:52:56 riastradh Exp $ */
/*
* Copyright © 2014 Intel Corporation
@@ -135,7 +135,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_lrc.c,v 1.6 2018/08/27 07:24:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_lrc.c,v 1.7 2018/08/27 14:52:56 riastradh Exp $");
#include <drm/drmP.h>
#include <drm/i915_drm.h>
@@ -751,8 +751,8 @@ static void __wrap_ring_buffer(struct in
tail = ringbuf->tail;
rem /= 4;
- while (rem--)
- bus_space_write_4(ringbuf->bst, ringbuf->bsh, tail++, MI_NOOP);
+ for (; rem --> 0; tail += 4)
+ bus_space_write_4(ringbuf->bst, ringbuf->bsh, tail, MI_NOOP);
#else
uint32_t __iomem *virt;
int rem = ringbuf->size - ringbuf->tail;