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/ttm Fix up ttm agp.



details:   https://anonhg.NetBSD.org/src/rev/5b83f324765b
branches:  trunk
changeset: 1028099:5b83f324765b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 01:50:54 2021 +0000

description:
Fix up ttm agp.

diffstat:

 sys/external/bsd/drm2/ttm/files.ttm         |   3 ++-
 sys/external/bsd/drm2/ttm/ttm_agp_backend.c |  20 +++++++++-----------
 2 files changed, 11 insertions(+), 12 deletions(-)

diffs (85 lines):

diff -r 682d508017d9 -r 5b83f324765b sys/external/bsd/drm2/ttm/files.ttm
--- a/sys/external/bsd/drm2/ttm/files.ttm       Sun Dec 19 01:50:47 2021 +0000
+++ b/sys/external/bsd/drm2/ttm/files.ttm       Sun Dec 19 01:50:54 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.ttm,v 1.4 2021/12/19 01:47:31 riastradh Exp $
+#      $NetBSD: files.ttm,v 1.5 2021/12/19 01:50:54 riastradh Exp $
 
 # TTM, the texture and tiling manager.
 
@@ -7,6 +7,7 @@
 define drmkms_ttm: drmkms
 
 makeoptions    drmkms  "CWARNFLAGS.ttm_bo.c"+="${${ACTIVE_CC} == gcc && ${HAVE_GCC:U0} >= 7:? -Wno-error=implicit-fallthrough :}"
+makeoptions    drmkms_ttm      "CPPFLAGS.drmkms_ttm"+="-DCONFIG_AGP=1"
 makeoptions    drmkms_ttm      "CWARNFLAGS.drmkms_ttm"+="-Wno-missing-field-initializers"
 makeoptions    drmkms_ttm      "CWARNFLAGS.drmkms_ttm"+="-Wno-shadow"
 
diff -r 682d508017d9 -r 5b83f324765b sys/external/bsd/drm2/ttm/ttm_agp_backend.c
--- a/sys/external/bsd/drm2/ttm/ttm_agp_backend.c       Sun Dec 19 01:50:47 2021 +0000
+++ b/sys/external/bsd/drm2/ttm/ttm_agp_backend.c       Sun Dec 19 01:50:54 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ttm_agp_backend.c,v 1.8 2018/08/28 03:41:40 riastradh Exp $    */
+/*     $NetBSD: ttm_agp_backend.c,v 1.9 2021/12/19 01:50:54 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ttm_agp_backend.c,v 1.8 2018/08/28 03:41:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ttm_agp_backend.c,v 1.9 2021/12/19 01:50:54 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/kmem.h>
@@ -39,10 +39,11 @@
 #include <dev/pci/pcivar.h>
 #include <dev/pci/agpvar.h>
 
+#include <drm/drm_agpsupport.h>
+
 #include <ttm/ttm_bo_driver.h>
 #include <ttm/ttm_page_alloc.h>
-
-#if CONFIG_AGP
+#include <ttm/ttm_tt.h>
 
 struct ttm_agp {
        struct ttm_dma_tt ttm_dma;
@@ -54,8 +55,8 @@
 static const struct ttm_backend_func ttm_agp_backend_func;
 
 struct ttm_tt *
-ttm_agp_tt_create(struct ttm_bo_device *bdev, struct agp_bridge_data *bridge,
-    unsigned long size, uint32_t page_flags, struct page *dummy_read_page)
+ttm_agp_tt_create(struct ttm_buffer_object *bo, struct agp_bridge_data *bridge,
+    uint32_t page_flags)
 {
        struct ttm_agp *ttm_agp;
 
@@ -63,8 +64,7 @@
        ttm_agp->agp = &bridge->abd_sc;
        ttm_agp->ttm_dma.ttm.func = &ttm_agp_backend_func;
 
-       if (ttm_dma_tt_init(&ttm_agp->ttm_dma, bdev, size, page_flags,
-               dummy_read_page) != 0)
+       if (ttm_dma_tt_init(&ttm_agp->ttm_dma, bo, page_flags) != 0)
                goto fail;
 
        /* Success!  */
@@ -75,7 +75,7 @@
 }
 
 int
-ttm_agp_tt_populate(struct ttm_tt *ttm)
+ttm_agp_tt_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
 {
 
        KASSERTMSG((ttm->state == tt_unpopulated),
@@ -169,5 +169,3 @@
        .unbind = &ttm_agp_unbind,
        .destroy = &ttm_agp_destroy,
 };
-
-#endif



Home | Main Index | Thread Index | Old Index