Source-Changes-HG archive

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

[src/trunk]: src/sys/modules/drmkms_sched drm: Split scheduler into separate ...



details:   https://anonhg.NetBSD.org/src/rev/0e527896708b
branches:  trunk
changeset: 368641:0e527896708b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Jul 23 12:52:09 2022 +0000

description:
drm: Split scheduler into separate module.

Used only by amdgpu, and it uses something that is currently broken
from the gcc update on aarch64, so let's make it a little more
optional.

diffstat:

 sys/external/bsd/drm2/amdgpu/amdgpu_module.c |   6 +-
 sys/external/bsd/drm2/amdgpu/files.amdgpu    |   4 +-
 sys/external/bsd/drm2/drm/files.drmkms       |  12 ++++--
 sys/external/bsd/drm2/drm/sched_module.c     |  48 ++++++++++++++++++++++++++++
 sys/modules/drmkms_sched/Makefile            |  18 ++++++++++
 5 files changed, 79 insertions(+), 9 deletions(-)

diffs (142 lines):

diff -r 63ddf3459332 -r 0e527896708b sys/external/bsd/drm2/amdgpu/amdgpu_module.c
--- a/sys/external/bsd/drm2/amdgpu/amdgpu_module.c      Sat Jul 23 11:49:58 2022 +0000
+++ b/sys/external/bsd/drm2/amdgpu/amdgpu_module.c      Sat Jul 23 12:52:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_module.c,v 1.10 2022/07/17 15:36:15 riastradh Exp $     */
+/*     $NetBSD: amdgpu_module.c,v 1.11 2022/07/23 12:52:09 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_module.c,v 1.10 2022/07/17 15:36:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_module.c,v 1.11 2022/07/23 12:52:09 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/module.h>
@@ -50,7 +50,7 @@
 #include "amdgpu_amdkfd.h"
 #include "amdgpu_drv.h"
 
-MODULE(MODULE_CLASS_DRIVER, amdgpu, "drmkms,drmkms_pci,drmkms_ttm"); /* XXX drmkms_i2c */
+MODULE(MODULE_CLASS_DRIVER, amdgpu, "drmkms,drmkms_pci,drmkms_sched,drmkms_ttm"); /* XXX drmkms_i2c */
 
 #ifdef _MODULE
 #include "ioconf.c"
diff -r 63ddf3459332 -r 0e527896708b sys/external/bsd/drm2/amdgpu/files.amdgpu
--- a/sys/external/bsd/drm2/amdgpu/files.amdgpu Sat Jul 23 11:49:58 2022 +0000
+++ b/sys/external/bsd/drm2/amdgpu/files.amdgpu Sat Jul 23 12:52:09 2022 +0000
@@ -1,9 +1,9 @@
-#      $NetBSD: files.amdgpu,v 1.27 2022/07/19 23:19:06 riastradh Exp $
+#      $NetBSD: files.amdgpu,v 1.28 2022/07/23 12:52:09 riastradh Exp $
 
 version        20180827
 
 define amdgpufbbus     { }
-device amdgpu: drmkms, drmkms_pci, drmkms_ttm, amdgpufbbus, firmload
+device amdgpu: drmkms, drmkms_pci, drmkms_sched, drmkms_ttm, amdgpufbbus, firmload
 attach amdgpu at pci
 makeoptions    amdgpu          "CPPFLAGS.amdgpu"+="${CPPFLAGS.drmkms}"
 
diff -r 63ddf3459332 -r 0e527896708b sys/external/bsd/drm2/drm/files.drmkms
--- a/sys/external/bsd/drm2/drm/files.drmkms    Sat Jul 23 11:49:58 2022 +0000
+++ b/sys/external/bsd/drm2/drm/files.drmkms    Sat Jul 23 12:52:09 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.drmkms,v 1.79 2022/07/20 10:01:01 riastradh Exp $
+#      $NetBSD: files.drmkms,v 1.80 2022/07/23 12:52:10 riastradh Exp $
 
 version        20180827
 
@@ -98,9 +98,13 @@
 file   external/bsd/drm2/drm/drm_scatter.c             drmums
 
 # GPU scheduler
-file   external/bsd/drm2/dist/drm/scheduler/sched_entity.c     drmkms
-file   external/bsd/drm2/dist/drm/scheduler/sched_fence.c      drmkms
-file   external/bsd/drm2/dist/drm/scheduler/sched_main.c       drmkms
+define drmkms_sched: drmkms
+makeoptions    drmkms_sched    "CPPFLAGS.drmsched"+="${CPPFLAGS.drmkms}"
+
+file   external/bsd/drm2/dist/drm/scheduler/sched_entity.c     drmkms_sched
+file   external/bsd/drm2/dist/drm/scheduler/sched_fence.c      drmkms_sched
+file   external/bsd/drm2/dist/drm/scheduler/sched_main.c       drmkms_sched
+file   external/bsd/drm2/drm/sched_module.c                    drmkms_sched
 
 # Generated from drm2netbsd.
 #file  external/bsd/drm2/dist/drm/drm_agpsupport.c     drmkms  # drmkms_pci
diff -r 63ddf3459332 -r 0e527896708b sys/external/bsd/drm2/drm/sched_module.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/drm2/drm/sched_module.c  Sat Jul 23 12:52:09 2022 +0000
@@ -0,0 +1,48 @@
+/*     $NetBSD: sched_module.c,v 1.1 2022/07/23 12:52:10 riastradh Exp $       */
+
+/*-
+ * Copyright (c) 2022 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: sched_module.c,v 1.1 2022/07/23 12:52:10 riastradh Exp $");
+
+#include <sys/module.h>
+
+MODULE(MODULE_CLASS_MISC, drmkms_sched, "drmkms");
+
+static int
+drmkms_sched_modcmd(modcmd_t cmd, void *arg)
+{
+
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+               return 0;
+       case MODULE_CMD_FINI:
+               return 0;
+       default:
+               return ENOTTY;
+       }
+}
diff -r 63ddf3459332 -r 0e527896708b sys/modules/drmkms_sched/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/drmkms_sched/Makefile Sat Jul 23 12:52:09 2022 +0000
@@ -0,0 +1,18 @@
+#      $NetBSD: Makefile,v 1.1 2022/07/23 12:52:10 riastradh Exp $
+
+.include "../Makefile.inc"
+.include "../drmkms/Makefile.inc"
+
+.PATH: ${S}/external/bsd/drm2/dist/drm/scheduler
+.PATH: ${S}/external/bsd/drm2/drm
+
+KMOD=  drmkms_sched
+
+SRCS+= sched_entity.c
+SRCS+= sched_fence.c
+SRCS+= sched_main.c
+SRCS+= sched_module.c
+
+WARNS= 3
+
+.include <bsd.kmodule.mk>



Home | Main Index | Thread Index | Old Index