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 Simplify loop with bus_s...



details:   https://anonhg.NetBSD.org/src/rev/e7ee18038152
branches:  trunk
changeset: 835415:e7ee18038152
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:53:12 2018 +0000

description:
Simplify loop with bus_space_set_region_4

Match the original copypasta in intel_ringbuffer.c.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/intel_lrc.c |  19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diffs (43 lines):

diff -r dc090c0ead44 -r e7ee18038152 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:56 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_lrc.c   Mon Aug 27 14:53:12 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_lrc.c,v 1.7 2018/08/27 14:52:56 riastradh Exp $  */
+/*     $NetBSD: intel_lrc.c,v 1.8 2018/08/27 14:53:12 riastradh Exp $  */
 
 /*
  * Copyright © 2014 Intel Corporation
@@ -135,7 +135,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_lrc.c,v 1.7 2018/08/27 14:52:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_lrc.c,v 1.8 2018/08/27 14:53:12 riastradh Exp $");
 
 #include <drm/drmP.h>
 #include <drm/i915_drm.h>
@@ -745,18 +745,15 @@
 
 static void __wrap_ring_buffer(struct intel_ringbuffer *ringbuf)
 {
-#ifdef __NetBSD__
-       bus_size_t tail;
+#ifndef __NetBSD__
+       uint32_t __iomem *virt;
+#endif
        int rem = ringbuf->size - ringbuf->tail;
 
-       tail = ringbuf->tail;
-       rem /= 4;
-       for (; rem --> 0; tail += 4)
-               bus_space_write_4(ringbuf->bst, ringbuf->bsh, tail, MI_NOOP);
+#ifdef __NetBSD__
+       bus_space_set_region_4(ringbuf->bst, ringbuf->bsh, ringbuf->tail,
+           MI_NOOP, rem/4);
 #else
-       uint32_t __iomem *virt;
-       int rem = ringbuf->size - ringbuf->tail;
-
        virt = ringbuf->virtual_start + ringbuf->tail;
        rem /= 4;
        while (rem--)



Home | Main Index | Thread Index | Old Index