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/i915drm i915: Odds and ends.



details:   https://anonhg.NetBSD.org/src/rev/83bdd9566bb6
branches:  trunk
changeset: 1028660:83bdd9566bb6
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:37:05 2021 +0000

description:
i915: Odds and ends.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.c |   6 ++++--
 sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.h |  12 +++---------
 sys/external/bsd/drm2/dist/drm/i915/i915_scheduler.c   |  11 ++++++++---
 sys/external/bsd/drm2/i915drm/files.i915drmkms         |   4 ++--
 sys/external/bsd/drm2/i915drm/i915_module.c            |   8 ++++++--
 5 files changed, 23 insertions(+), 18 deletions(-)

diffs (164 lines):

diff -r 61925e83e901 -r 83bdd9566bb6 sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.c    Sun Dec 19 11:36:56 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.c    Sun Dec 19 11:37:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_scatterlist.c,v 1.2 2021/12/18 23:45:28 riastradh Exp $   */
+/*     $NetBSD: i915_scatterlist.c,v 1.3 2021/12/19 11:37:05 riastradh Exp $   */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -7,12 +7,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_scatterlist.c,v 1.2 2021/12/18 23:45:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_scatterlist.c,v 1.3 2021/12/19 11:37:05 riastradh Exp $");
 
 #include "i915_scatterlist.h"
 
 bool i915_sg_trim(struct sg_table *orig_st)
 {
+#ifndef __NetBSD__
        struct sg_table new_st;
        struct scatterlist *sg, *new_sg;
        unsigned int i;
@@ -36,6 +37,7 @@
        sg_free_table(orig_st);
 
        *orig_st = new_st;
+#endif
        return true;
 }
 
diff -r 61925e83e901 -r 83bdd9566bb6 sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.h
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.h    Sun Dec 19 11:36:56 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.h    Sun Dec 19 11:37:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_scatterlist.h,v 1.7 2021/12/19 11:33:49 riastradh Exp $   */
+/*     $NetBSD: i915_scatterlist.h,v 1.8 2021/12/19 11:37:05 riastradh Exp $   */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -45,12 +45,6 @@
        return PAGE_SIZE;
 }
 
-static inline bool
-i915_sg_trim(struct sg_table *sgt)
-{
-       return true;
-}
-
 #else
 
 /*
@@ -162,8 +156,8 @@
        return size;
 }
 
+#endif
+
 bool i915_sg_trim(struct sg_table *orig_st);
 
 #endif
-
-#endif
diff -r 61925e83e901 -r 83bdd9566bb6 sys/external/bsd/drm2/dist/drm/i915/i915_scheduler.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_scheduler.c      Sun Dec 19 11:36:56 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_scheduler.c      Sun Dec 19 11:37:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_scheduler.c,v 1.2 2021/12/18 23:45:28 riastradh Exp $     */
+/*     $NetBSD: i915_scheduler.c,v 1.3 2021/12/19 11:37:05 riastradh Exp $     */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -7,7 +7,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_scheduler.c,v 1.2 2021/12/18 23:45:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_scheduler.c,v 1.3 2021/12/19 11:37:05 riastradh Exp $");
 
 #include <linux/mutex.h>
 
@@ -22,12 +22,17 @@
        struct kmem_cache *slab_priorities;
 } global;
 
+#ifdef __NetBSD__
+static spinlock_t schedule_lock;
+spinlock_t *const i915_schedule_lock = &schedule_lock;
+#else
 static DEFINE_SPINLOCK(schedule_lock);
+#endif
 
 static const struct i915_request *
 node_to_request(const struct i915_sched_node *node)
 {
-       return container_of(node, const struct i915_request, sched);
+       return const_container_of(node, const struct i915_request, sched);
 }
 
 static inline bool node_started(const struct i915_sched_node *node)
diff -r 61925e83e901 -r 83bdd9566bb6 sys/external/bsd/drm2/i915drm/files.i915drmkms
--- a/sys/external/bsd/drm2/i915drm/files.i915drmkms    Sun Dec 19 11:36:56 2021 +0000
+++ b/sys/external/bsd/drm2/i915drm/files.i915drmkms    Sun Dec 19 11:37:05 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.i915drmkms,v 1.71 2021/12/19 11:36:08 riastradh Exp $
+#      $NetBSD: files.i915drmkms,v 1.72 2021/12/19 11:37:06 riastradh Exp $
 
 version        20180827
 
@@ -210,7 +210,7 @@
 file   external/bsd/drm2/dist/drm/i915/i915_sw_fence_work.c    i915drmkms
 file   external/bsd/drm2/dist/drm/i915/i915_switcheroo.c       i915drmkms
 file   external/bsd/drm2/dist/drm/i915/i915_syncmap.c  i915drmkms
-file   external/bsd/drm2/dist/drm/i915/i915_sysfs.c    i915drmkms
+#file  external/bsd/drm2/dist/drm/i915/i915_sysfs.c    i915drmkms
 #file  external/bsd/drm2/dist/drm/i915/i915_trace_points.c     i915drmkms
 file   external/bsd/drm2/dist/drm/i915/i915_user_extensions.c  i915drmkms
 file   external/bsd/drm2/dist/drm/i915/i915_utils.c    i915drmkms
diff -r 61925e83e901 -r 83bdd9566bb6 sys/external/bsd/drm2/i915drm/i915_module.c
--- a/sys/external/bsd/drm2/i915drm/i915_module.c       Sun Dec 19 11:36:56 2021 +0000
+++ b/sys/external/bsd/drm2/i915drm/i915_module.c       Sun Dec 19 11:37:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_module.c,v 1.15 2021/12/19 11:36:08 riastradh Exp $       */
+/*     $NetBSD: i915_module.c,v 1.16 2021/12/19 11:37:06 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_module.c,v 1.15 2021/12/19 11:36:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_module.c,v 1.16 2021/12/19 11:37:06 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/module.h>
@@ -53,7 +53,9 @@
 
 struct drm_sysctl_def i915_def = DRM_SYSCTL_INIT();
 
+/* XXX use link sets for DEFINE_SPINLOCK */
 extern spinlock_t i915_sw_fence_lock;
+extern spinlock_t *const i915_schedule_lock;
 
 int i915_global_buddy_init(void); /* XXX */
 
@@ -73,6 +75,7 @@
        drm_sysctl_init(&i915_def);
        spin_lock_init(&mchdev_lock);
        spin_lock_init(&i915_sw_fence_lock);
+       spin_lock_init(i915_schedule_lock);
 
        return 0;
 }
@@ -94,6 +97,7 @@
 i915drmkms_fini(void)
 {
 
+       spin_lock_destroy(i915_schedule_lock);
        spin_lock_destroy(&i915_sw_fence_lock);
        spin_lock_destroy(&mchdev_lock);
        drm_sysctl_fini(&i915_def);



Home | Main Index | Thread Index | Old Index