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 More crap to make this t...



details:   https://anonhg.NetBSD.org/src/rev/9474d36789a3
branches:  trunk
changeset: 1028047:9474d36789a3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 01:43:50 2021 +0000

description:
More crap to make this thing get closer to building.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/gt/intel_reset.c |  30 ++++++++++++++++++-
 sys/external/bsd/drm2/dist/drm/i915/i915_irq.c       |   6 ++--
 sys/external/bsd/drm2/dist/drm/i915/i915_params.c    |   6 ++--
 sys/external/bsd/drm2/dist/drm/i915/i915_pci.c       |   6 ++-
 4 files changed, 38 insertions(+), 10 deletions(-)

diffs (173 lines):

diff -r cc9da5ed5511 -r 9474d36789a3 sys/external/bsd/drm2/dist/drm/i915/gt/intel_reset.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gt/intel_reset.c      Sun Dec 19 01:43:37 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gt/intel_reset.c      Sun Dec 19 01:43:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_reset.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $        */
+/*     $NetBSD: intel_reset.c,v 1.3 2021/12/19 01:43:50 riastradh Exp $        */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -7,7 +7,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_reset.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_reset.c,v 1.3 2021/12/19 01:43:50 riastradh Exp $");
 
 #include <linux/sched/mm.h>
 #include <linux/stop_machine.h>
@@ -1163,15 +1163,21 @@
                                  const char *reason)
 {
        struct kobject *kobj = &gt->i915->drm.primary->kdev->kobj;
+#ifndef __NetBSD__             /* XXX kobject uevent...?  */
        char *error_event[] = { I915_ERROR_UEVENT "=1", NULL };
        char *reset_event[] = { I915_RESET_UEVENT "=1", NULL };
        char *reset_done_event[] = { I915_ERROR_UEVENT "=0", NULL };
+#endif
        struct intel_wedge_me w;
 
+#ifndef __NetBSD__
        kobject_uevent_env(kobj, KOBJ_CHANGE, error_event);
+#endif
 
        DRM_DEBUG_DRIVER("resetting chip\n");
+#ifndef __NetBSD__
        kobject_uevent_env(kobj, KOBJ_CHANGE, reset_event);
+#endif
 
        /* Use a watchdog to ensure that our reset completes */
        intel_wedge_on_timeout(&w, gt, 5 * HZ) {
@@ -1185,8 +1191,10 @@
                intel_finish_reset(gt->i915);
        }
 
+#ifndef __NetBSD__             /* XXX kobj uevent...?  */
        if (!test_bit(I915_WEDGED, &gt->reset.flags))
                kobject_uevent_env(kobj, KOBJ_CHANGE, reset_done_event);
+#endif
 }
 
 /**
@@ -1263,8 +1271,19 @@
 
        /* Full reset needs the mutex, stop any other user trying to do so. */
        if (test_and_set_bit(I915_RESET_BACKOFF, &gt->reset.flags)) {
+#ifdef __NetBSD__
+               int ret;
+               spin_lock(&dev_priv->gpu_error.reset_lock);
+               DRM_SPIN_WAIT_NOINTR_UNTIL(ret,
+                   &dev_priv->gpu_error.reset_queue,
+                   &dev_priv->gpu_error.reset_lock,
+                   !test_bit(I915_RESET_BACKOFF,
+                       &dev_priv->gpu_error.flags));
+               spin_unlock(&dev_priv->gpu_error.reset_lock);
+#else
                wait_event(gt->reset.queue,
                           !test_bit(I915_RESET_BACKOFF, &gt->reset.flags));
+#endif
                goto out; /* piggy-back on the other reset */
        }
 
@@ -1287,7 +1306,14 @@
                                 &gt->reset.flags);
        clear_bit_unlock(I915_RESET_BACKOFF, &gt->reset.flags);
        smp_mb__after_atomic();
+#ifdef __NetBSD__
+       spin_lock(&dev_priv->gpu_error.reset_lock);
+       DRM_SPIN_WAKEUP_ALL(&dev_priv->gpu_error.reset_queue,
+           &dev_priv->gpu_error.reset_lock);
+       spin_unlock(&dev_priv->gpu_error.reset_lock);
+#else
        wake_up_all(&gt->reset.queue);
+#endif
 
 out:
        intel_runtime_pm_put(gt->uncore->rpm, wakeref);
diff -r cc9da5ed5511 -r 9474d36789a3 sys/external/bsd/drm2/dist/drm/i915/i915_irq.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c    Sun Dec 19 01:43:37 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c    Sun Dec 19 01:43:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_irq.c,v 1.21 2021/12/19 01:43:37 riastradh Exp $  */
+/*     $NetBSD: i915_irq.c,v 1.22 2021/12/19 01:43:51 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.21 2021/12/19 01:43:37 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_irq.c,v 1.22 2021/12/19 01:43:51 riastradh Exp $");
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
@@ -2408,7 +2408,7 @@
        raw_reg_write(regs, GEN8_MASTER_IRQ, GEN8_MASTER_IRQ_CONTROL);
 }
 
-static irqreturn_t gen8_irq_handler(int irq, void *arg)
+static irqreturn_t gen8_irq_handler(DRM_IRQ_ARGS)
 {
        struct drm_i915_private *dev_priv = arg;
        u32 master_ctl;
diff -r cc9da5ed5511 -r 9474d36789a3 sys/external/bsd/drm2/dist/drm/i915/i915_params.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_params.c Sun Dec 19 01:43:37 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_params.c Sun Dec 19 01:43:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_params.c,v 1.5 2021/12/18 23:45:28 riastradh Exp $        */
+/*     $NetBSD: i915_params.c,v 1.6 2021/12/19 01:43:51 riastradh Exp $        */
 
 /*
  * Copyright © 2014 Intel Corporation
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_params.c,v 1.5 2021/12/18 23:45:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_params.c,v 1.6 2021/12/19 01:43:51 riastradh Exp $");
 
 #include <drm/drm_print.h>
 
@@ -203,7 +203,7 @@
        else if (!__builtin_strcmp(type, "unsigned long"))
                drm_printf(p, "i915.%s=%lu\n", name, *(const unsigned long *)x);
        else if (!__builtin_strcmp(type, "char *"))
-               drm_printf(p, "i915.%s=%s\n", name, *(const char **)x);
+               drm_printf(p, "i915.%s=%s\n", name, *(const char *const *)x);
        else
                WARN_ONCE(1, "no printer defined for param type %s (i915.%s)\n",
                          type, name);
diff -r cc9da5ed5511 -r 9474d36789a3 sys/external/bsd/drm2/dist/drm/i915/i915_pci.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_pci.c    Sun Dec 19 01:43:37 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_pci.c    Sun Dec 19 01:43:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_pci.c,v 1.2 2021/12/18 23:45:28 riastradh Exp $   */
+/*     $NetBSD: i915_pci.c,v 1.3 2021/12/19 01:43:51 riastradh Exp $   */
 
 /*
  * Copyright © 2016 Intel Corporation
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_pci.c,v 1.2 2021/12/18 23:45:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_pci.c,v 1.3 2021/12/19 01:43:51 riastradh Exp $");
 
 #include <linux/console.h>
 #include <linux/vga_switcheroo.h>
@@ -989,12 +989,14 @@
        if (PCI_FUNC(pdev->devfn))
                return -ENODEV;
 
+#ifndef __NetBSD__             /* XXX vga switcheroo */
        /*
         * apple-gmux is needed on dual GPU MacBook Pro
         * to probe the panel if we're the inactive GPU.
         */
        if (vga_switcheroo_client_probe_defer(pdev))
                return -EPROBE_DEFER;
+#endif
 
        err = i915_driver_probe(pdev, ent);
        if (err)



Home | Main Index | Thread Index | Old Index