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 drm: Nix driver-specific DRM_...



details:   https://anonhg.NetBSD.org/src/rev/d778c9bff905
branches:  trunk
changeset: 366283:d778c9bff905
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat May 21 17:50:21 2022 +0000

description:
drm: Nix driver-specific DRM_FILE_PAGE_OFFSET defs and tests.

This was consolidated upstream into the vma manager.

PR kern/56812

diffstat:

 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h |   8 +-------
 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c |  12 ++++--------
 sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c   |  13 ++-----------
 3 files changed, 7 insertions(+), 26 deletions(-)

diffs (96 lines):

diff -r 04911ae9e28f -r d778c9bff905 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h      Sat May 21 17:19:10 2022 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h      Sat May 21 17:50:21 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_drv.h,v 1.3 2021/12/19 10:50:13 riastradh Exp $        */
+/*     $NetBSD: nouveau_drv.h,v 1.4 2022/05/21 17:50:21 riastradh Exp $        */
 
 /* SPDX-License-Identifier: MIT */
 #ifndef __NOUVEAU_DRV_H__
@@ -67,12 +67,6 @@
 struct nouveau_channel;
 struct platform_device;
 
-#ifdef _LP64
-#define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
-#else
-#define DRM_FILE_PAGE_OFFSET (0xa0000000UL >> PAGE_SHIFT)
-#endif
-
 #include "nouveau_fence.h"
 #include "nouveau_bios.h"
 #include "nouveau_vmm.h"
diff -r 04911ae9e28f -r d778c9bff905 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c      Sat May 21 17:19:10 2022 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c      Sat May 21 17:50:21 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_ttm.c,v 1.9 2021/12/19 10:51:56 riastradh Exp $        */
+/*     $NetBSD: nouveau_ttm.c,v 1.10 2022/05/21 17:50:21 riastradh Exp $       */
 
 // SPDX-License-Identifier: GPL-2.0 OR MIT
 /*
@@ -25,7 +25,7 @@
  * USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_ttm.c,v 1.9 2021/12/19 10:51:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_ttm.c,v 1.10 2022/05/21 17:50:21 riastradh Exp $");
 
 #include <sys/param.h>
 #include <uvm/uvm_extern.h>    /* pmap_pv_track/untrack */
@@ -177,12 +177,8 @@
 
        KASSERT(0 == (offset & (PAGE_SIZE - 1)));
 
-       if (__predict_false((offset >> PAGE_SHIFT) < DRM_FILE_PAGE_OFFSET))
-               return drm_legacy_mmap_object(dev, offset, size, prot, uobjp,
-                   uoffsetp, file);
-       else
-               return ttm_bo_mmap_object(&drm->ttm.bdev, offset, size, prot,
-                   uobjp, uoffsetp, file);
+       return ttm_bo_mmap_object(&drm->ttm.bdev, offset, size, prot,
+           uobjp, uoffsetp, file);
 }
 
 #else
diff -r 04911ae9e28f -r d778c9bff905 sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c        Sat May 21 17:19:10 2022 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c        Sat May 21 17:50:21 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_ttm.c,v 1.24 2021/12/23 17:09:25 hannken Exp $  */
+/*     $NetBSD: radeon_ttm.c,v 1.25 2022/05/21 17:50:21 riastradh Exp $        */
 
 /*
  * Copyright 2009 Jerome Glisse.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_ttm.c,v 1.24 2021/12/23 17:09:25 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_ttm.c,v 1.25 2022/05/21 17:50:21 riastradh Exp $");
 
 #include <linux/dma-mapping.h>
 #include <linux/pagemap.h>
@@ -65,12 +65,6 @@
 #include <drm/bus_dma_hacks.h>
 #endif
 
-#ifdef _LP64
-#define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
-#else
-#define DRM_FILE_PAGE_OFFSET (0xa0000000UL >> PAGE_SHIFT)
-#endif
-
 static int radeon_ttm_debugfs_init(struct radeon_device *rdev);
 static void radeon_ttm_debugfs_fini(struct radeon_device *rdev);
 
@@ -1108,9 +1102,6 @@
        if (__predict_false(rdev == NULL))      /* XXX How?? */
                return -EINVAL;
 
-       if (__predict_false((offset >> PAGE_SHIFT) < DRM_FILE_PAGE_OFFSET))
-               return -EINVAL;
-
        return ttm_bo_mmap_object(&rdev->mman.bdev, offset, size, prot,
            uobjp, uoffsetp, file);
 }



Home | Main Index | Thread Index | Old Index