Index: dist/drm/nouveau/nouveau_drm.c =================================================================== RCS file: /cvsroot/src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c,v retrieving revision 1.5 diff -p -u -r1.5 nouveau_drm.c --- dist/drm/nouveau/nouveau_drm.c 6 Mar 2015 15:39:28 -0000 1.5 +++ dist/drm/nouveau/nouveau_drm.c 13 Oct 2015 01:35:59 -0000 @@ -62,6 +62,7 @@ __KERNEL_RCSID(0, "$NetBSD: nouveau_drm. #include "nouveau_fbcon.h" #include "nouveau_fence.h" #include "nouveau_debugfs.h" +#include "nouveau_ttm.h" MODULE_PARM_DESC(config, "option string to pass to driver core"); char *nouveau_config; @@ -87,6 +88,10 @@ module_param_named(runpm, nouveau_runtim static struct drm_driver driver; #ifdef __NetBSD__ struct drm_driver *const nouveau_drm_driver = &driver; + +/* XXX Kludge for the non-GEM GEM that nouveau uses. */ +static const struct uvm_pagerops nouveau_gem_uvm_ops; + #endif static u64 @@ -880,7 +885,11 @@ driver = { .ioctls = nouveau_ioctls, .num_ioctls = ARRAY_SIZE(nouveau_ioctls), -#ifndef __NetBSD__ +#ifdef __NetBSD__ + .fops = NULL, + .mmap_object = &nouveau_ttm_mmap_object, + .gem_uvm_ops = &nouveau_gem_uvm_ops, +#else .fops = &nouveau_driver_fops, #endif Index: dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c =================================================================== RCS file: /cvsroot/src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c,v retrieving revision 1.4 diff -p -u -r1.4 nouveau_engine_fifo_nve0.c --- dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c 28 Feb 2015 05:38:49 -0000 1.4 +++ dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c 13 Oct 2015 01:35:59 -0000 @@ -136,18 +136,27 @@ nve0_fifo_runlist_update(struct nve0_fif nv_wr32(priv, 0x002274, (engine << 20) | (p >> 3)); #ifdef __NetBSD__ - { - int ret; + if (cold) { + uint count = 2000; + while (count-- > 0) { + if (!(nv_rd32(priv, 0x002284 + (engine * 0x08)) & 0x00100000)) + break; + delay(1000); + } + if (count == 0) + nv_error(priv, "runlist %d update timeout\n", engine); + } else { + int ret; - spin_lock(&engn->lock); - DRM_SPIN_TIMED_WAIT_NOINTR_UNTIL(ret, &engn->wait, &engn->lock, - msecs_to_jiffies(2000), - !(nv_rd32(priv, 0x002284 + - (engine * 0x08)) & 0x00100000)); - if (ret == 0) - nv_error(priv, "runlist %d update timeout\n", engine); - spin_unlock(&engn->lock); - } + spin_lock(&engn->lock); + DRM_SPIN_TIMED_WAIT_NOINTR_UNTIL(ret, &engn->wait, &engn->lock, + msecs_to_jiffies(2000), + !(nv_rd32(priv, 0x002284 + + (engine * 0x08)) & 0x00100000)); + if (ret == 0) + nv_error(priv, "runlist %d update timeout\n", engine); + spin_unlock(&engn->lock); + } #else if (wait_event_timeout(engn->wait, !(nv_rd32(priv, 0x002284 + (engine * 0x08)) & 0x00100000),