Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915 Advance by 4-byte quanti...



details:   https://anonhg.NetBSD.org/src/rev/6c88fda0b1d5
branches:  trunk
changeset: 366333:6c88fda0b1d5
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:52:56 2018 +0000

description:
Advance by 4-byte quantities, not by 1-byte quantities.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_irq.c  |  32 +++++++++++++++++++++++-
 sys/external/bsd/drm2/dist/drm/i915/intel_lrc.c |   8 +++---
 2 files changed, 34 insertions(+), 6 deletions(-)

diffs (82 lines):

diff -r 25ee771f8278 -r 6c88fda0b1d5 sys/external/bsd/drm2/dist/drm/i915/i915_irq.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c    Mon Aug 27 14:52:40 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c    Mon Aug 27 14:52:56 2018 +0000
@@ -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 @@
        }
 
        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
diff -r 25ee771f8278 -r 6c88fda0b1d5 sys/external/bsd/drm2/dist/drm/i915/intel_lrc.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_lrc.c   Mon Aug 27 14:52:40 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_lrc.c   Mon Aug 27 14:52:56 2018 +0000
@@ -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 @@
 
        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;



Home | Main Index | Thread Index | Old Index