From 24c81ef173b7a74b960daa3457556a046f5045d6 Mon Sep 17 00:00:00 2001 From: riastradh Date: Tue, 20 May 2014 15:12:41 +0000 Subject: [PATCH] Don't map the GEM uvm_aobj copy-on-write -- what was I thinking? Do transfer the GEM object reference to the uvm_aobj reference -- these are not the same thing. (There's another uvm object whose references are the same thing as the GEM object references, but that's not the uao.) With these changes, it looks like the GPU is no longer trying to draw graphics all over kernel data structures. Wish I had that month of debugging back! --- sys/external/bsd/drm2/dist/drm/i915/i915_gem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c index 15406eb961d1..1abfa99594e3 100644 --- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c +++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c @@ -1490,9 +1490,11 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, obj->gemo_shm_uao, args->offset, 0, UVM_MAPFLAG((VM_PROT_READ | VM_PROT_WRITE), (VM_PROT_READ | VM_PROT_WRITE), UVM_INH_COPY, UVM_ADV_NORMAL, - UVM_FLAG_COPYONW)); + 0)); if (ret) return ret; + uao_reference(obj->gemo_shm_uao); + drm_gem_object_unreference_unlocked(obj); #else addr = vm_mmap(obj->filp, 0, args->size, PROT_READ | PROT_WRITE, MAP_SHARED,