Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/external/bsd/drm2/dist/drm/nouveau Pull up following ...



details:   https://anonhg.NetBSD.org/src/rev/e09369db9c13
branches:  netbsd-7
changeset: 799790:e09369db9c13
user:      snj <snj%NetBSD.org@localhost>
date:      Thu Feb 11 23:08:41 2016 +0000

description:
Pull up following revision(s) (requested by riastradh in ticket #1085):
        sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c: revision 1.6
        sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h: revision 1.3
provide a ttm-backed set of nouveau_uvm_ops{} in the ttm_bo_driver{}.
fixes NULL pointer derefs inside UVM due to lack of pager ops.
copy the DRM_FILE_PAGE_OFFSET vs !_LP64 workaround.
with these, X starts up on my GTX 440.

diffstat:

 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c  |  15 +++++++++++++--
 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h |   4 ++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diffs (55 lines):

diff -r 69fb6b10fbb6 -r e09369db9c13 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c       Thu Feb 11 23:06:01 2016 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_bo.c       Thu Feb 11 23:08:41 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_bo.c,v 1.4.4.1 2014/09/21 17:41:52 snj Exp $   */
+/*     $NetBSD: nouveau_bo.c,v 1.4.4.2 2016/02/11 23:08:41 snj Exp $   */
 
 /*
  * Copyright 2007 Dave Airlied
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_bo.c,v 1.4.4.1 2014/09/21 17:41:52 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_bo.c,v 1.4.4.2 2016/02/11 23:08:41 snj Exp $");
 
 #include <core/engine.h>
 #include <linux/swiotlb.h>
@@ -1568,10 +1568,21 @@
        return 0;
 }
 
+#ifdef __NetBSD__
+static const struct uvm_pagerops nouveau_uvm_ops = {
+       .pgo_reference = &ttm_bo_uvm_reference,
+       .pgo_detach = &ttm_bo_uvm_detach,
+       .pgo_fault = &ttm_bo_uvm_fault,
+};
+#endif
+
 struct ttm_bo_driver nouveau_bo_driver = {
        .ttm_tt_create = &nouveau_ttm_tt_create,
        .ttm_tt_populate = &nouveau_ttm_tt_populate,
        .ttm_tt_unpopulate = &nouveau_ttm_tt_unpopulate,
+#ifdef __NetBSD__
+       .ttm_uvm_ops = &nouveau_uvm_ops,
+#endif
        .invalidate_caches = nouveau_bo_invalidate_caches,
        .init_mem_type = nouveau_bo_init_mem_type,
        .evict_flags = nouveau_bo_evict_flags,
diff -r 69fb6b10fbb6 -r e09369db9c13 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h      Thu Feb 11 23:06:01 2016 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h      Thu Feb 11 23:08:41 2016 +0000
@@ -40,7 +40,11 @@
 
 struct nouveau_channel;
 
+#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"



Home | Main Index | Thread Index | Old Index