Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/modules/drmkms_ttm drm: Modularize ttm.
details: https://anonhg.NetBSD.org/src/rev/e8456ba62a50
branches: trunk
changeset: 368540:e8456ba62a50
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Jul 17 15:36:05 2022 +0000
description:
drm: Modularize ttm.
diffstat:
sys/external/bsd/drm2/ttm/files.ttm | 5 +--
sys/external/bsd/drm2/ttm/ttm_module.c | 51 ++++++++++++++++++++++++++++++++++
sys/modules/Makefile | 3 +-
sys/modules/drmkms_ttm/Makefile | 35 +++++++++++++++++++++++
4 files changed, 90 insertions(+), 4 deletions(-)
diffs (130 lines):
diff -r 707badf45c60 -r e8456ba62a50 sys/external/bsd/drm2/ttm/files.ttm
--- a/sys/external/bsd/drm2/ttm/files.ttm Sun Jul 17 15:35:42 2022 +0000
+++ b/sys/external/bsd/drm2/ttm/files.ttm Sun Jul 17 15:36:05 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.ttm,v 1.7 2021/12/19 10:55:38 riastradh Exp $
+# $NetBSD: files.ttm,v 1.8 2022/07/17 15:36:05 riastradh Exp $
# TTM, the texture and tiling manager.
@@ -17,8 +17,7 @@
file external/bsd/drm2/dist/drm/ttm/ttm_bo.c drmkms_ttm
file external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c drmkms_ttm
file external/bsd/drm2/ttm/ttm_bo_vm.c drmkms_ttm
-# Linux module goo.
-#file external/bsd/drm2/dist/drm/ttm/ttm_module.c drmkms_ttm
+file external/bsd/drm2/ttm/ttm_module.c drmkms_ttm
# Used only by vmwgfx. Needs porting for rcu -> pserialize.
#file external/bsd/drm2/dist/drm/ttm/ttm_object.c drmkms_ttm
# Used only by vmwgfx. Needs porting. Does silly things like SIGKILL.
diff -r 707badf45c60 -r e8456ba62a50 sys/external/bsd/drm2/ttm/ttm_module.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/drm2/ttm/ttm_module.c Sun Jul 17 15:36:05 2022 +0000
@@ -0,0 +1,51 @@
+/* $NetBSD: ttm_module.c,v 1.1 2022/07/17 15:36:05 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: ttm_module.c,v 1.1 2022/07/17 15:36:05 riastradh Exp $");
+
+#include <sys/errno.h>
+#include <sys/module.h>
+
+MODULE(MODULE_CLASS_DRIVER, drmkms_ttm, "drmkms");
+
+static int
+drmkms_ttm_modcmd(modcmd_t cmd, void *arg)
+{
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ return 0;
+ case MODULE_CMD_AUTOUNLOAD:
+ return EBUSY;
+ case MODULE_CMD_FINI:
+ return 0;
+ default:
+ return ENOTTY;
+ }
+}
diff -r 707badf45c60 -r e8456ba62a50 sys/modules/Makefile
--- a/sys/modules/Makefile Sun Jul 17 15:35:42 2022 +0000
+++ b/sys/modules/Makefile Sun Jul 17 15:36:05 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.266 2022/06/04 03:31:10 pgoyette Exp $
+# $NetBSD: Makefile,v 1.267 2022/07/17 15:36:05 riastradh Exp $
.include <bsd.own.mk>
@@ -354,6 +354,7 @@
#SUBDIR+= drmkms_agp
#SUBDIR+= drmkms_linux
#SUBDIR+= drmkms_pci
+#SUBDIR+= drmkms_ttm
SUBDIR+= i915drm
#SUBDIR+= i915drmkms
#
diff -r 707badf45c60 -r e8456ba62a50 sys/modules/drmkms_ttm/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/drmkms_ttm/Makefile Sun Jul 17 15:36:05 2022 +0000
@@ -0,0 +1,35 @@
+# $NetBSD: Makefile,v 1.1 2022/07/17 15:36:05 riastradh Exp $
+
+.include "../Makefile.inc"
+.include "../drmkms/Makefile.inc"
+
+KMOD= drmkms_ttm
+
+.PATH: ${S}/external/bsd/drm2/ttm
+.PATH: ${S}/external/bsd/drm2/dist/drm/ttm
+
+CPPFLAGS+= -DCONFIG_AGP=1
+
+WARNS= 3
+
+COPTS.ttm_bo.c+= ${GCC_NO_IMPLICIT_FALLTHRU}
+
+CWARNFLAGS+= -Wno-missing-field-initializers
+CWARNFLAGS+= -Wno-shadow
+
+SRCS+= ttm_agp_backend.c
+SRCS+= ttm_memory.c
+SRCS+= ttm_tt.c
+SRCS+= ttm_bo.c
+SRCS+= ttm_bo_util.c
+SRCS+= ttm_bo_vm.c
+SRCS+= ttm_module.c
+#SRCS+= ttm_object.c
+#SRCS+= ttm_lock.c
+SRCS+= ttm_execbuf_util.c
+#SRCS+= ttm_page_alloc.c
+SRCS+= ttm_bo_manager.c
+#SRCS+= ttm_page_alloc_dma.c
+SRCS+= ttm_bus_dma.c
+
+.include <bsd.kmodule.mk>
Home |
Main Index |
Thread Index |
Old Index