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 Fix some merge mistakes, ...



details:   https://anonhg.NetBSD.org/src/rev/da93d3d95f52
branches:  trunk
changeset: 365880:da93d3d95f52
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:05:50 2018 +0000

description:
Fix some merge mistakes, 64-bit printfs, &c.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c |  50 ++++++++++++++++++++-----
 1 files changed, 40 insertions(+), 10 deletions(-)

diffs (198 lines):

diff -r 909a8f9c2e95 -r da93d3d95f52 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c    Mon Aug 27 07:05:39 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c    Mon Aug 27 07:05:50 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem.c,v 1.38 2018/08/27 06:33:34 riastradh Exp $  */
+/*     $NetBSD: i915_gem.c,v 1.39 2018/08/27 07:05:50 riastradh Exp $  */
 
 /*
  * Copyright © 2008-2015 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.38 2018/08/27 06:33:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.39 2018/08/27 07:05:50 riastradh Exp $");
 
 #ifdef __NetBSD__
 #if 0                          /* XXX uvmhist option?  */
@@ -301,7 +301,6 @@
 
 #ifdef __NetBSD__
                        struct pglist pages = TAILQ_HEAD_INITIALIZER(pages);
-                       int ret;
                        /* XXX errno NetBSD->Linux */
                        ret = -uvm_obj_wirepages(obj->base.gemo_shm_uao,
                            i*PAGE_SIZE, (i + 1)*PAGE_SIZE, &pages);
@@ -317,7 +316,7 @@
                        kunmap_atomic(dst);
 
 #ifdef __NetBSD__
-                       vm_page->flags &= ~PG_CLEAN;
+                       page->p_vmp.flags &= ~PG_CLEAN;
                        /* XXX mark page accessed */
                        uvm_obj_unwirepages(obj->base.gemo_shm_uao,
                            i*PAGE_SIZE, (i+1)*PAGE_SIZE);
@@ -332,8 +331,12 @@
                obj->dirty = 0;
        }
 
+#ifdef __NetBSD__
+       obj->pages = NULL;
+#else
        sg_free_table(obj->pages);
        kfree(obj->pages);
+#endif
 }
 
 static void
@@ -1314,6 +1317,7 @@
        return test_bit(ring->id, &dev_priv->gpu_error.missed_irq_rings);
 }
 
+#ifndef __NetBSD__
 static unsigned long local_clock_us(unsigned *cpu)
 {
        unsigned long t;
@@ -1345,6 +1349,7 @@
 
        return this_cpu != cpu;
 }
+#endif
 
 static int __i915_spin_request(struct drm_i915_gem_request *req, int state)
 {
@@ -1419,15 +1424,20 @@
        struct drm_device *dev = ring->dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
        const bool irq_test_in_progress =
-               ACCESS_ONCE(dev_priv->gpu_error.test_irq_rings) & intel_ring_flag(ring);
+           dev_priv->gpu_error.test_irq_rings & intel_ring_flag(ring);
+#ifdef __NetBSD__
+       int state = 0;
+       bool wedged;
+#else
        int state = interruptible ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE;
-#ifndef __NetBSD__
        DEFINE_WAIT(wait);
+       unsigned long timeout_expire;
 #endif
-       unsigned long timeout_expire;
        s64 before, now;
        int ret;
 
+       __insn_barrier();       /* ACCESS_ONCE for irq_test_in_progress */
+
        WARN(!intel_irqs_enabled(dev_priv), "IRQs disabled");
 
        if (list_empty(&req->list))
@@ -1436,6 +1446,7 @@
        if (i915_gem_request_completed(req, true))
                return 0;
 
+#ifndef __NetBSD__
        timeout_expire = 0;
        if (timeout) {
                if (WARN_ON(*timeout < 0))
@@ -1446,6 +1457,7 @@
 
                timeout_expire = jiffies + nsecs_to_jiffies_timeout(*timeout);
        }
+#endif
 
        if (INTEL_INFO(dev_priv)->gen >= 6)
                gen6_rps_boost(dev_priv, rps, req->emitted_jiffies);
@@ -1468,7 +1480,7 @@
 #  define      EXIT_COND                                                     \
        ((wedged = (reset_counter !=                                          \
                atomic_read(&dev_priv->gpu_error.reset_counter))) ||          \
-           i915_request_completed(req, false))
+           i915_gem_request_completed(req, false))
        if (timeout) {
                int ticks = nsecs_to_jiffies_timeout(*timeout);
                if (interruptible) {
@@ -1494,6 +1506,11 @@
                }
                /* ret is negative on failure or zero on success.  */
        }
+       if (wedged) {
+               ret = i915_gem_check_wedge(&dev_priv->gpu_error, interruptible);
+               if (ret == 0)
+                       ret = -EAGAIN;
+       }
 #else
        for (;;) {
                struct timer_list timer;
@@ -1576,7 +1593,7 @@
 int i915_gem_request_add_to_client(struct drm_i915_gem_request *req,
                                   struct drm_file *file)
 {
-       struct drm_i915_private *dev_private;
+       struct drm_i915_private *dev_private __unused;
        struct drm_i915_file_private *file_priv;
 
        WARN_ON(!req || !file || req->file_priv);
@@ -1595,7 +1612,9 @@
        list_add_tail(&req->client_list, &file_priv->mm.request_list);
        spin_unlock(&file_priv->mm.lock);
 
+#ifndef __NetBSD__
        req->pid = get_pid(task_pid(current));
+#endif
 
        return 0;
 }
@@ -1613,8 +1632,10 @@
        request->file_priv = NULL;
        spin_unlock(&file_priv->mm.lock);
 
+#ifndef __NetBSD__
        put_pid(request->pid);
        request->pid = NULL;
+#endif
 }
 
 static void i915_gem_request_retire(struct drm_i915_gem_request *request)
@@ -2963,8 +2984,10 @@
 
        list_add_tail(&obj->global_list, &dev_priv->mm.unbound_list);
 
+#ifndef __NetBSD__
        obj->get_page.sg = obj->pages->sgl;
        obj->get_page.last = 0;
+#endif
 
        return 0;
 }
@@ -3885,8 +3908,12 @@
                if (vma->ggtt_view.type == I915_GGTT_VIEW_NORMAL) {
                        obj->map_and_fenceable = false;
                } else if (vma->ggtt_view.pages) {
+#ifdef __NetBSD__
+                       panic("rotated/partial views can't happen");
+#else
                        sg_free_table(vma->ggtt_view.pages);
                        kfree(vma->ggtt_view.pages);
+#endif
                }
                vma->ggtt_view.pages = NULL;
        }
@@ -4062,7 +4089,7 @@
         * attempt to find space.
         */
        if (size > end) {
-               DRM_DEBUG("Attempting to bind an object (view type=%u) larger than the aperture: size=%llu > %s aperture=%llu\n",
+               DRM_DEBUG("Attempting to bind an object (view type=%u) larger than the aperture: size=%"PRIx64" > %s aperture=%"PRIx64"\n",
                          ggtt_view ? ggtt_view->type : 0,
                          size,
                          flags & PIN_MAPPABLE ? "mappable" : "total",
@@ -4499,6 +4526,9 @@
 rpm_put:
        intel_runtime_pm_put(dev_priv);
 
+       return ret;
+}
+
 /*
  * Prepare buffer for display plane (scanout, cursors, etc).
  * Can be called from an uninterruptible phase (modesetting) and allows



Home | Main Index | Thread Index | Old Index